1 | \hypertarget{classbdm_1_1multiBM}{ |
---|
2 | \section{bdm::multiBM Class Reference} |
---|
3 | \label{classbdm_1_1multiBM}\index{bdm::multiBM@{bdm::multiBM}} |
---|
4 | } |
---|
5 | Estimator for Multinomial density. |
---|
6 | |
---|
7 | |
---|
8 | {\tt \#include $<$libEF.h$>$} |
---|
9 | |
---|
10 | Inheritance diagram for bdm::multiBM:\nopagebreak |
---|
11 | \begin{figure}[H] |
---|
12 | \begin{center} |
---|
13 | \leavevmode |
---|
14 | \includegraphics[width=64pt]{classbdm_1_1multiBM__inherit__graph} |
---|
15 | \end{center} |
---|
16 | \end{figure} |
---|
17 | Collaboration diagram for bdm::multiBM:\nopagebreak |
---|
18 | \begin{figure}[H] |
---|
19 | \begin{center} |
---|
20 | \leavevmode |
---|
21 | \includegraphics[height=400pt]{classbdm_1_1multiBM__coll__graph} |
---|
22 | \end{center} |
---|
23 | \end{figure} |
---|
24 | \subsection*{Public Member Functions} |
---|
25 | \begin{CompactItemize} |
---|
26 | \item |
---|
27 | \hypertarget{classbdm_1_1multiBM_65dc7567b67ce86a8f339dd496ed8e88}{ |
---|
28 | \hyperlink{classbdm_1_1multiBM_65dc7567b67ce86a8f339dd496ed8e88}{multiBM} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{rv}, const vec beta0)} |
---|
29 | \label{classbdm_1_1multiBM_65dc7567b67ce86a8f339dd496ed8e88} |
---|
30 | |
---|
31 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
32 | \hypertarget{classbdm_1_1multiBM_c4378cf8037f6bed29c74eea63344b31}{ |
---|
33 | \hyperlink{classbdm_1_1multiBM_c4378cf8037f6bed29c74eea63344b31}{multiBM} (const \hyperlink{classbdm_1_1multiBM}{multiBM} \&B)} |
---|
34 | \label{classbdm_1_1multiBM_c4378cf8037f6bed29c74eea63344b31} |
---|
35 | |
---|
36 | \begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item |
---|
37 | \hypertarget{classbdm_1_1multiBM_dbe6b90d410dc062a233d1dc09eeba52}{ |
---|
38 | void \hyperlink{classbdm_1_1multiBM_dbe6b90d410dc062a233d1dc09eeba52}{set\_\-statistics} (const \hyperlink{classbdm_1_1BM}{BM} $\ast$mB0)} |
---|
39 | \label{classbdm_1_1multiBM_dbe6b90d410dc062a233d1dc09eeba52} |
---|
40 | |
---|
41 | \begin{CompactList}\small\item\em Sets sufficient statistics to match that of givefrom mB0. \item\end{CompactList}\item |
---|
42 | void \hyperlink{classbdm_1_1multiBM_1e4bf41b61937fd80f34049742e23f95}{bayes} (const vec \&dt) |
---|
43 | \begin{CompactList}\small\item\em Incremental Bayes rule. \item\end{CompactList}\item |
---|
44 | double \hyperlink{classbdm_1_1multiBM_e157b607c1e3fa91d42aeea44458e2bf}{logpred} (const vec \&dt) const |
---|
45 | \item |
---|
46 | \hypertarget{classbdm_1_1multiBM_aaeb18c989088feb8d26d300e4971732}{ |
---|
47 | void \hyperlink{classbdm_1_1multiBM_aaeb18c989088feb8d26d300e4971732}{flatten} (const \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$B)} |
---|
48 | \label{classbdm_1_1multiBM_aaeb18c989088feb8d26d300e4971732} |
---|
49 | |
---|
50 | \begin{CompactList}\small\item\em Flatten the posterior according to the given \hyperlink{classbdm_1_1BMEF}{BMEF} (of the same type!). \item\end{CompactList}\item |
---|
51 | \hypertarget{classbdm_1_1multiBM_98c22316ecfef589989baca261713c8d}{ |
---|
52 | const \hyperlink{classbdm_1_1epdf}{epdf} \& \hyperlink{classbdm_1_1multiBM_98c22316ecfef589989baca261713c8d}{\_\-epdf} () const } |
---|
53 | \label{classbdm_1_1multiBM_98c22316ecfef589989baca261713c8d} |
---|
54 | |
---|
55 | \begin{CompactList}\small\item\em Returns a reference to the \hyperlink{classbdm_1_1epdf}{epdf} representing posterior density on parameters. \item\end{CompactList}\item |
---|
56 | \hypertarget{classbdm_1_1multiBM_c996f6b9ca930182030e1027318f1ca6}{ |
---|
57 | const \hyperlink{classbdm_1_1eDirich}{eDirich} $\ast$ \hyperlink{classbdm_1_1multiBM_c996f6b9ca930182030e1027318f1ca6}{\_\-e} () const } |
---|
58 | \label{classbdm_1_1multiBM_c996f6b9ca930182030e1027318f1ca6} |
---|
59 | |
---|
60 | \begin{CompactList}\small\item\em Returns a pointer to the \hyperlink{classbdm_1_1epdf}{epdf} representing posterior density on parameters. Use with care! \item\end{CompactList}\item |
---|
61 | \hypertarget{classbdm_1_1multiBM_7a480eace4446661bacca94c57499f01}{ |
---|
62 | void \textbf{set\_\-parameters} (const vec \&beta0)} |
---|
63 | \label{classbdm_1_1multiBM_7a480eace4446661bacca94c57499f01} |
---|
64 | |
---|
65 | \item |
---|
66 | \hypertarget{classbdm_1_1BMEF_d2b528b7a41ca67163152142f5404051}{ |
---|
67 | virtual void \hyperlink{classbdm_1_1BMEF_d2b528b7a41ca67163152142f5404051}{set\_\-statistics} (const \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$BM0)} |
---|
68 | \label{classbdm_1_1BMEF_d2b528b7a41ca67163152142f5404051} |
---|
69 | |
---|
70 | \begin{CompactList}\small\item\em get statistics from another model \item\end{CompactList}\item |
---|
71 | \hypertarget{classbdm_1_1BMEF_bf58deb99af2a6cc674f13ff90300de6}{ |
---|
72 | virtual void \hyperlink{classbdm_1_1BMEF_bf58deb99af2a6cc674f13ff90300de6}{bayes} (const vec \&data, const double w)} |
---|
73 | \label{classbdm_1_1BMEF_bf58deb99af2a6cc674f13ff90300de6} |
---|
74 | |
---|
75 | \begin{CompactList}\small\item\em Weighted update of sufficient statistics (Bayes rule). \item\end{CompactList}\item |
---|
76 | \hypertarget{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6}{ |
---|
77 | \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$ \hyperlink{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6}{\_\-copy\_\-} (bool changerv=false)} |
---|
78 | \label{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6} |
---|
79 | |
---|
80 | \begin{CompactList}\small\item\em Flatten the posterior as if to keep nu0 data. \item\end{CompactList}\item |
---|
81 | \hypertarget{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{ |
---|
82 | virtual void \hyperlink{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{bayesB} (const mat \&Dt)} |
---|
83 | \label{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc} |
---|
84 | |
---|
85 | \begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item |
---|
86 | \hypertarget{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{ |
---|
87 | vec \hyperlink{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{logpred\_\-m} (const mat \&dt) const } |
---|
88 | \label{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae} |
---|
89 | |
---|
90 | \begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\item |
---|
91 | \hypertarget{classbdm_1_1BM_710e7d69c0d8791fb41a7cd4683cca2c}{ |
---|
92 | virtual \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1BM_710e7d69c0d8791fb41a7cd4683cca2c}{predictor} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{rv}) const } |
---|
93 | \label{classbdm_1_1BM_710e7d69c0d8791fb41a7cd4683cca2c} |
---|
94 | |
---|
95 | \begin{CompactList}\small\item\em Constructs a predictive density (marginal density on data). \item\end{CompactList}\item |
---|
96 | \hypertarget{classbdm_1_1BM_40a3c891996391e3135518053a917793}{ |
---|
97 | const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1BM_40a3c891996391e3135518053a917793}{\_\-rv} () const } |
---|
98 | \label{classbdm_1_1BM_40a3c891996391e3135518053a917793} |
---|
99 | |
---|
100 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
101 | \hypertarget{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{ |
---|
102 | const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{\_\-drv} () const } |
---|
103 | \label{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c} |
---|
104 | |
---|
105 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
106 | \hypertarget{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{ |
---|
107 | void \hyperlink{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{set\_\-drv} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{rv})} |
---|
108 | \label{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96} |
---|
109 | |
---|
110 | \begin{CompactList}\small\item\em set drv \item\end{CompactList}\item |
---|
111 | \hypertarget{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{ |
---|
112 | double \hyperlink{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{\_\-ll} () const } |
---|
113 | \label{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70} |
---|
114 | |
---|
115 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
116 | \hypertarget{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{ |
---|
117 | void \hyperlink{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{set\_\-evalll} (bool evl0)} |
---|
118 | \label{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f} |
---|
119 | |
---|
120 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize} |
---|
121 | \subsection*{Protected Attributes} |
---|
122 | \begin{CompactItemize} |
---|
123 | \item |
---|
124 | \hypertarget{classbdm_1_1multiBM_9ecc6878abbd20eb8d8e43b6ab3f941a}{ |
---|
125 | \hyperlink{classbdm_1_1eDirich}{eDirich} \hyperlink{classbdm_1_1multiBM_9ecc6878abbd20eb8d8e43b6ab3f941a}{est}} |
---|
126 | \label{classbdm_1_1multiBM_9ecc6878abbd20eb8d8e43b6ab3f941a} |
---|
127 | |
---|
128 | \begin{CompactList}\small\item\em Conjugate prior and posterior. \item\end{CompactList}\item |
---|
129 | \hypertarget{classbdm_1_1multiBM_044263356944c92209eecd39a5187d25}{ |
---|
130 | vec \& \hyperlink{classbdm_1_1multiBM_044263356944c92209eecd39a5187d25}{beta}} |
---|
131 | \label{classbdm_1_1multiBM_044263356944c92209eecd39a5187d25} |
---|
132 | |
---|
133 | \begin{CompactList}\small\item\em Pointer inside est to sufficient statistics. \item\end{CompactList}\item |
---|
134 | \hypertarget{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64}{ |
---|
135 | double \hyperlink{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64}{frg}} |
---|
136 | \label{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64} |
---|
137 | |
---|
138 | \begin{CompactList}\small\item\em forgetting factor \item\end{CompactList}\item |
---|
139 | \hypertarget{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865}{ |
---|
140 | double \hyperlink{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865}{last\_\-lognc}} |
---|
141 | \label{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865} |
---|
142 | |
---|
143 | \begin{CompactList}\small\item\em cached value of lognc() in the previous step (used in evaluation of {\tt ll} ) \item\end{CompactList}\item |
---|
144 | \hypertarget{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{ |
---|
145 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{rv}} |
---|
146 | \label{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca} |
---|
147 | |
---|
148 | \begin{CompactList}\small\item\em Random variable of the posterior. \item\end{CompactList}\item |
---|
149 | \hypertarget{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{ |
---|
150 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{drv}} |
---|
151 | \label{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed} |
---|
152 | |
---|
153 | \begin{CompactList}\small\item\em Random variable of the data (optional). \item\end{CompactList}\item |
---|
154 | \hypertarget{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ |
---|
155 | double \hyperlink{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ll}} |
---|
156 | \label{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a} |
---|
157 | |
---|
158 | \begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item |
---|
159 | \hypertarget{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{ |
---|
160 | bool \hyperlink{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{evalll}} |
---|
161 | \label{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee} |
---|
162 | |
---|
163 | \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} |
---|
164 | |
---|
165 | |
---|
166 | \subsection{Detailed Description} |
---|
167 | Estimator for Multinomial density. |
---|
168 | |
---|
169 | \subsection{Member Function Documentation} |
---|
170 | \hypertarget{classbdm_1_1multiBM_1e4bf41b61937fd80f34049742e23f95}{ |
---|
171 | \index{bdm::multiBM@{bdm::multiBM}!bayes@{bayes}} |
---|
172 | \index{bayes@{bayes}!bdm::multiBM@{bdm::multiBM}} |
---|
173 | \subsubsection[bayes]{\setlength{\rightskip}{0pt plus 5cm}void bdm::multiBM::bayes (const vec \& {\em dt})\hspace{0.3cm}{\tt \mbox{[}inline, virtual\mbox{]}}}} |
---|
174 | \label{classbdm_1_1multiBM_1e4bf41b61937fd80f34049742e23f95} |
---|
175 | |
---|
176 | |
---|
177 | Incremental Bayes rule. |
---|
178 | |
---|
179 | \begin{Desc} |
---|
180 | \item[Parameters:] |
---|
181 | \begin{description} |
---|
182 | \item[{\em dt}]vector of input data \end{description} |
---|
183 | \end{Desc} |
---|
184 | |
---|
185 | |
---|
186 | Reimplemented from \hyperlink{classbdm_1_1BMEF_c287f4c0c1ea31b91572ec45351838f1}{bdm::BMEF}. |
---|
187 | |
---|
188 | References beta, est, bdm::BM::evalll, bdm::BMEF::frg, bdm::BMEF::last\_\-lognc, bdm::BM::ll, and bdm::eDirich::lognc().\hypertarget{classbdm_1_1multiBM_e157b607c1e3fa91d42aeea44458e2bf}{ |
---|
189 | \index{bdm::multiBM@{bdm::multiBM}!logpred@{logpred}} |
---|
190 | \index{logpred@{logpred}!bdm::multiBM@{bdm::multiBM}} |
---|
191 | \subsubsection[logpred]{\setlength{\rightskip}{0pt plus 5cm}double bdm::multiBM::logpred (const vec \& {\em dt}) const\hspace{0.3cm}{\tt \mbox{[}inline, virtual\mbox{]}}}} |
---|
192 | \label{classbdm_1_1multiBM_e157b607c1e3fa91d42aeea44458e2bf} |
---|
193 | |
---|
194 | |
---|
195 | Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. |
---|
196 | |
---|
197 | Reimplemented from \hyperlink{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{bdm::BM}. |
---|
198 | |
---|
199 | References bdm::eDirich::\_\-beta(), beta, est, bdm::BM::evalll, bdm::BMEF::frg, bdm::BMEF::last\_\-lognc, and bdm::eDirich::lognc(). |
---|
200 | |
---|
201 | The documentation for this class was generated from the following file:\begin{CompactItemize} |
---|
202 | \item |
---|
203 | \hyperlink{libEF_8h}{libEF.h}\end{CompactItemize} |
---|