[172] | 1 | \hypertarget{classmultiBM}{ |
---|
| 2 | \section{multiBM Class Reference} |
---|
| 3 | \label{classmultiBM}\index{multiBM@{multiBM}} |
---|
| 4 | } |
---|
| 5 | Estimator for Multinomial density. |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | {\tt \#include $<$libEF.h$>$} |
---|
| 9 | |
---|
| 10 | Inheritance diagram for multiBM:\nopagebreak |
---|
| 11 | \begin{figure}[H] |
---|
| 12 | \begin{center} |
---|
| 13 | \leavevmode |
---|
| 14 | \includegraphics[width=49pt]{classmultiBM__inherit__graph} |
---|
| 15 | \end{center} |
---|
| 16 | \end{figure} |
---|
| 17 | Collaboration diagram for multiBM:\nopagebreak |
---|
| 18 | \begin{figure}[H] |
---|
| 19 | \begin{center} |
---|
| 20 | \leavevmode |
---|
| 21 | \includegraphics[width=69pt]{classmultiBM__coll__graph} |
---|
| 22 | \end{center} |
---|
| 23 | \end{figure} |
---|
| 24 | \subsection*{Public Member Functions} |
---|
| 25 | \begin{CompactItemize} |
---|
| 26 | \item |
---|
| 27 | \hypertarget{classmultiBM_7d7d7e78c129602bcde96078359dc6e5}{ |
---|
| 28 | \hyperlink{classmultiBM_7d7d7e78c129602bcde96078359dc6e5}{multiBM} (const \hyperlink{classRV}{RV} \&\hyperlink{classBM_af00f0612fabe66241dd507188cdbf88}{rv}, const vec beta0)} |
---|
| 29 | \label{classmultiBM_7d7d7e78c129602bcde96078359dc6e5} |
---|
| 30 | |
---|
| 31 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
| 32 | \hypertarget{classmultiBM_b92751adbfb9f259ca8c95232cfd9c09}{ |
---|
| 33 | \hyperlink{classmultiBM_b92751adbfb9f259ca8c95232cfd9c09}{multiBM} (const \hyperlink{classmultiBM}{multiBM} \&B)} |
---|
| 34 | \label{classmultiBM_b92751adbfb9f259ca8c95232cfd9c09} |
---|
| 35 | |
---|
| 36 | \begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item |
---|
| 37 | \hypertarget{classmultiBM_42e36804041e551d3ceea6c75abc0562}{ |
---|
[181] | 38 | void \hyperlink{classmultiBM_42e36804041e551d3ceea6c75abc0562}{set\_\-statistics} (const \hyperlink{classBM}{BM} $\ast$mB0)} |
---|
[172] | 39 | \label{classmultiBM_42e36804041e551d3ceea6c75abc0562} |
---|
| 40 | |
---|
[181] | 41 | \begin{CompactList}\small\item\em Sets sufficient statistics to match that of givefrom mB0. \item\end{CompactList}\item |
---|
[172] | 42 | void \hyperlink{classmultiBM_11eeba7e97954e316e959116f90d80e2}{bayes} (const vec \&dt) |
---|
| 43 | \begin{CompactList}\small\item\em Incremental Bayes rule. \item\end{CompactList}\item |
---|
| 44 | double \hyperlink{classmultiBM_13e26a61757278981fd8cac9a7ef91eb}{logpred} (const vec \&dt) const |
---|
| 45 | \item |
---|
[181] | 46 | \hypertarget{classmultiBM_3988322f8f51b153622036f461f62a67}{ |
---|
| 47 | void \hyperlink{classmultiBM_3988322f8f51b153622036f461f62a67}{flatten} (const \hyperlink{classBMEF}{BMEF} $\ast$B)} |
---|
| 48 | \label{classmultiBM_3988322f8f51b153622036f461f62a67} |
---|
[172] | 49 | |
---|
[181] | 50 | \begin{CompactList}\small\item\em Flatten the posterior according to the given \hyperlink{classBMEF}{BMEF} (of the same type!). \item\end{CompactList}\item |
---|
[172] | 51 | \hypertarget{classmultiBM_66cdfd83a70bc281840ab0646b941684}{ |
---|
| 52 | const \hyperlink{classepdf}{epdf} \& \hyperlink{classmultiBM_66cdfd83a70bc281840ab0646b941684}{\_\-epdf} () const } |
---|
| 53 | \label{classmultiBM_66cdfd83a70bc281840ab0646b941684} |
---|
| 54 | |
---|
[210] | 55 | \begin{CompactList}\small\item\em Returns a reference to the \hyperlink{classepdf}{epdf} representing posterior density on parameters. \item\end{CompactList}\item |
---|
| 56 | \hypertarget{classmultiBM_66a0fa6966e40bb6c3e7ba22d26e9d35}{ |
---|
| 57 | const \hyperlink{classeDirich}{eDirich} $\ast$ \hyperlink{classmultiBM_66a0fa6966e40bb6c3e7ba22d26e9d35}{\_\-e} () const } |
---|
| 58 | \label{classmultiBM_66a0fa6966e40bb6c3e7ba22d26e9d35} |
---|
| 59 | |
---|
[172] | 60 | \begin{CompactList}\small\item\em Returns a pointer to the \hyperlink{classepdf}{epdf} representing posterior density on parameters. Use with care! \item\end{CompactList}\item |
---|
[180] | 61 | \hypertarget{classmultiBM_164117b1a5eb6f33db9b4b0f4b2d2842}{ |
---|
| 62 | void \textbf{set\_\-parameters} (const vec \&beta0)} |
---|
| 63 | \label{classmultiBM_164117b1a5eb6f33db9b4b0f4b2d2842} |
---|
| 64 | |
---|
| 65 | \item |
---|
[172] | 66 | \hypertarget{classBMEF_30bb40eb1fd31869b2e62e79e1ecdcb4}{ |
---|
| 67 | virtual void \hyperlink{classBMEF_30bb40eb1fd31869b2e62e79e1ecdcb4}{set\_\-statistics} (const \hyperlink{classBMEF}{BMEF} $\ast$BM0)} |
---|
| 68 | \label{classBMEF_30bb40eb1fd31869b2e62e79e1ecdcb4} |
---|
| 69 | |
---|
| 70 | \begin{CompactList}\small\item\em get statistics from another model \item\end{CompactList}\item |
---|
| 71 | \hypertarget{classBMEF_8f4ecb6e2eaf630155a1fa98f35aa6ad}{ |
---|
| 72 | virtual void \hyperlink{classBMEF_8f4ecb6e2eaf630155a1fa98f35aa6ad}{bayes} (const vec \&data, const double w)} |
---|
| 73 | \label{classBMEF_8f4ecb6e2eaf630155a1fa98f35aa6ad} |
---|
| 74 | |
---|
| 75 | \begin{CompactList}\small\item\em Weighted update of sufficient statistics (Bayes rule). \item\end{CompactList}\item |
---|
[210] | 76 | \hypertarget{classBMEF_97f5312efe4a5bedb86d2daec59d8651}{ |
---|
| 77 | \hyperlink{classBMEF}{BMEF} $\ast$ \hyperlink{classBMEF_97f5312efe4a5bedb86d2daec59d8651}{\_\-copy\_\-} (bool changerv=false)} |
---|
| 78 | \label{classBMEF_97f5312efe4a5bedb86d2daec59d8651} |
---|
[181] | 79 | |
---|
| 80 | \begin{CompactList}\small\item\em Flatten the posterior as if to keep nu0 data. \item\end{CompactList}\item |
---|
[172] | 81 | \hypertarget{classBM_0186270f75189677f390fe088a9947e9}{ |
---|
| 82 | virtual void \hyperlink{classBM_0186270f75189677f390fe088a9947e9}{bayesB} (const mat \&Dt)} |
---|
| 83 | \label{classBM_0186270f75189677f390fe088a9947e9} |
---|
| 84 | |
---|
| 85 | \begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item |
---|
[180] | 86 | \hypertarget{classBM_cd0660f2a1a344b56ac39802708ff165}{ |
---|
| 87 | vec \hyperlink{classBM_cd0660f2a1a344b56ac39802708ff165}{logpred\_\-m} (const mat \&dt) const } |
---|
| 88 | \label{classBM_cd0660f2a1a344b56ac39802708ff165} |
---|
| 89 | |
---|
| 90 | \begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\item |
---|
[210] | 91 | \hypertarget{classBM_5594d68ee9aa6fc8c1e79019da5c9d56}{ |
---|
| 92 | virtual \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classBM_5594d68ee9aa6fc8c1e79019da5c9d56}{predictor} (const \hyperlink{classRV}{RV} \&\hyperlink{classBM_af00f0612fabe66241dd507188cdbf88}{rv}) const } |
---|
| 93 | \label{classBM_5594d68ee9aa6fc8c1e79019da5c9d56} |
---|
[180] | 94 | |
---|
| 95 | \begin{CompactList}\small\item\em Constructs a predictive density (marginal density on data). \item\end{CompactList}\item |
---|
[172] | 96 | \hypertarget{classBM_126bd2595c48e311fc2a7ab72876092a}{ |
---|
| 97 | const \hyperlink{classRV}{RV} \& \hyperlink{classBM_126bd2595c48e311fc2a7ab72876092a}{\_\-rv} () const } |
---|
| 98 | \label{classBM_126bd2595c48e311fc2a7ab72876092a} |
---|
| 99 | |
---|
| 100 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
| 101 | \hypertarget{classBM_87f4a547d2c29180be88175e5eab9c88}{ |
---|
| 102 | double \hyperlink{classBM_87f4a547d2c29180be88175e5eab9c88}{\_\-ll} () const } |
---|
| 103 | \label{classBM_87f4a547d2c29180be88175e5eab9c88} |
---|
| 104 | |
---|
| 105 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
| 106 | \hypertarget{classBM_1ffa9f23669aabecc3760c06c6987522}{ |
---|
| 107 | void \hyperlink{classBM_1ffa9f23669aabecc3760c06c6987522}{set\_\-evalll} (bool evl0)} |
---|
| 108 | \label{classBM_1ffa9f23669aabecc3760c06c6987522} |
---|
| 109 | |
---|
[210] | 110 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize} |
---|
[172] | 111 | \subsection*{Protected Attributes} |
---|
| 112 | \begin{CompactItemize} |
---|
| 113 | \item |
---|
| 114 | \hypertarget{classmultiBM_eddee08a724170de63f36e40c57b27b5}{ |
---|
| 115 | \hyperlink{classeDirich}{eDirich} \hyperlink{classmultiBM_eddee08a724170de63f36e40c57b27b5}{est}} |
---|
| 116 | \label{classmultiBM_eddee08a724170de63f36e40c57b27b5} |
---|
| 117 | |
---|
| 118 | \begin{CompactList}\small\item\em Conjugate prior and posterior. \item\end{CompactList}\item |
---|
| 119 | \hypertarget{classmultiBM_7b606116aed7e8834a339cbb0424b1d6}{ |
---|
[181] | 120 | vec \& \hyperlink{classmultiBM_7b606116aed7e8834a339cbb0424b1d6}{beta}} |
---|
[172] | 121 | \label{classmultiBM_7b606116aed7e8834a339cbb0424b1d6} |
---|
| 122 | |
---|
[181] | 123 | \begin{CompactList}\small\item\em Pointer inside est to sufficient statistics. \item\end{CompactList}\item |
---|
[172] | 124 | \hypertarget{classBMEF_538d632e59f9afa8daa1de74da12ce71}{ |
---|
| 125 | double \hyperlink{classBMEF_538d632e59f9afa8daa1de74da12ce71}{frg}} |
---|
| 126 | \label{classBMEF_538d632e59f9afa8daa1de74da12ce71} |
---|
| 127 | |
---|
| 128 | \begin{CompactList}\small\item\em forgetting factor \item\end{CompactList}\item |
---|
| 129 | \hypertarget{classBMEF_308cf5d4133cd471fdf1ecd5dfa09d02}{ |
---|
| 130 | double \hyperlink{classBMEF_308cf5d4133cd471fdf1ecd5dfa09d02}{last\_\-lognc}} |
---|
| 131 | \label{classBMEF_308cf5d4133cd471fdf1ecd5dfa09d02} |
---|
| 132 | |
---|
| 133 | \begin{CompactList}\small\item\em cached value of lognc() in the previous step (used in evaluation of {\tt ll} ) \item\end{CompactList}\item |
---|
| 134 | \hypertarget{classBM_af00f0612fabe66241dd507188cdbf88}{ |
---|
| 135 | \hyperlink{classRV}{RV} \hyperlink{classBM_af00f0612fabe66241dd507188cdbf88}{rv}} |
---|
| 136 | \label{classBM_af00f0612fabe66241dd507188cdbf88} |
---|
| 137 | |
---|
| 138 | \begin{CompactList}\small\item\em Random variable of the posterior. \item\end{CompactList}\item |
---|
| 139 | \hypertarget{classBM_5623fef6572a08c2b53b8c87b82dc979}{ |
---|
| 140 | double \hyperlink{classBM_5623fef6572a08c2b53b8c87b82dc979}{ll}} |
---|
| 141 | \label{classBM_5623fef6572a08c2b53b8c87b82dc979} |
---|
| 142 | |
---|
| 143 | \begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item |
---|
| 144 | \hypertarget{classBM_bf6fb59b30141074f8ee1e2f43d03129}{ |
---|
| 145 | bool \hyperlink{classBM_bf6fb59b30141074f8ee1e2f43d03129}{evalll}} |
---|
| 146 | \label{classBM_bf6fb59b30141074f8ee1e2f43d03129} |
---|
| 147 | |
---|
| 148 | \begin{CompactList}\small\item\em If true, the filter will compute likelihood of the data record and store it in {\tt ll} . Set to false if you want to save computational time. \item\end{CompactList}\end{CompactItemize} |
---|
| 149 | |
---|
| 150 | |
---|
| 151 | \subsection{Detailed Description} |
---|
| 152 | Estimator for Multinomial density. |
---|
| 153 | |
---|
| 154 | \subsection{Member Function Documentation} |
---|
| 155 | \hypertarget{classmultiBM_11eeba7e97954e316e959116f90d80e2}{ |
---|
| 156 | \index{multiBM@{multiBM}!bayes@{bayes}} |
---|
| 157 | \index{bayes@{bayes}!multiBM@{multiBM}} |
---|
| 158 | \subsubsection[bayes]{\setlength{\rightskip}{0pt plus 5cm}void multiBM::bayes (const vec \& {\em dt})\hspace{0.3cm}{\tt \mbox{[}inline, virtual\mbox{]}}}} |
---|
| 159 | \label{classmultiBM_11eeba7e97954e316e959116f90d80e2} |
---|
| 160 | |
---|
| 161 | |
---|
| 162 | Incremental Bayes rule. |
---|
| 163 | |
---|
| 164 | \begin{Desc} |
---|
| 165 | \item[Parameters:] |
---|
| 166 | \begin{description} |
---|
| 167 | \item[{\em dt}]vector of input data \end{description} |
---|
| 168 | \end{Desc} |
---|
| 169 | |
---|
| 170 | |
---|
| 171 | Reimplemented from \hyperlink{classBMEF_52b7719312d545215cca1ff87722a35a}{BMEF}. |
---|
| 172 | |
---|
[210] | 173 | References beta, est, BM::evalll, BMEF::frg, BMEF::last\_\-lognc, BM::ll, and eDirich::lognc().\hypertarget{classmultiBM_13e26a61757278981fd8cac9a7ef91eb}{ |
---|
[172] | 174 | \index{multiBM@{multiBM}!logpred@{logpred}} |
---|
| 175 | \index{logpred@{logpred}!multiBM@{multiBM}} |
---|
| 176 | \subsubsection[logpred]{\setlength{\rightskip}{0pt plus 5cm}double multiBM::logpred (const vec \& {\em dt}) const\hspace{0.3cm}{\tt \mbox{[}inline, virtual\mbox{]}}}} |
---|
| 177 | \label{classmultiBM_13e26a61757278981fd8cac9a7ef91eb} |
---|
| 178 | |
---|
| 179 | |
---|
| 180 | Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. |
---|
| 181 | |
---|
| 182 | Reimplemented from \hyperlink{classBM_8a8ce6df431689964c41cc6c849cfd06}{BM}. |
---|
| 183 | |
---|
[181] | 184 | References eDirich::\_\-beta(), beta, est, BM::evalll, BMEF::frg, BMEF::last\_\-lognc, and eDirich::lognc(). |
---|
[172] | 185 | |
---|
| 186 | The documentation for this class was generated from the following file:\begin{CompactItemize} |
---|
| 187 | \item |
---|
| 188 | work/git/mixpp/bdm/stat/\hyperlink{libEF_8h}{libEF.h}\end{CompactItemize} |
---|