1 | \hypertarget{classbdm_1_1PF}{ |
---|
2 | \section{bdm::PF Class Reference} |
---|
3 | \label{classbdm_1_1PF}\index{bdm::PF@{bdm::PF}} |
---|
4 | } |
---|
5 | {\tt \#include $<$libPF.h$>$} |
---|
6 | |
---|
7 | Inheritance diagram for bdm::PF:\nopagebreak |
---|
8 | \begin{figure}[H] |
---|
9 | \begin{center} |
---|
10 | \leavevmode |
---|
11 | \includegraphics[width=77pt]{classbdm_1_1PF__inherit__graph} |
---|
12 | \end{center} |
---|
13 | \end{figure} |
---|
14 | |
---|
15 | |
---|
16 | \subsection{Detailed Description} |
---|
17 | Trivial particle filter with proposal density equal to parameter evolution model. |
---|
18 | |
---|
19 | Posterior density is represented by a weighted empirical density ({\tt \hyperlink{classbdm_1_1eEmp}{eEmp}} ). \subsection*{Public Member Functions} |
---|
20 | \begin{CompactItemize} |
---|
21 | \item |
---|
22 | \hypertarget{classbdm_1_1PF_db2ed4517083f83de9d61750a87274de}{ |
---|
23 | \hyperlink{classbdm_1_1PF_db2ed4517083f83de9d61750a87274de}{PF} (\hyperlink{classbdm_1_1mpdf}{mpdf} \&par0, \hyperlink{classbdm_1_1mpdf}{mpdf} \&obs0, int n0)} |
---|
24 | \label{classbdm_1_1PF_db2ed4517083f83de9d61750a87274de} |
---|
25 | |
---|
26 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
27 | \hypertarget{classbdm_1_1PF_6f1988db4c3f602d187a6c15ec89cb1e}{ |
---|
28 | void \hyperlink{classbdm_1_1PF_6f1988db4c3f602d187a6c15ec89cb1e}{set\_\-est} (const \hyperlink{classbdm_1_1epdf}{epdf} \&epdf0)} |
---|
29 | \label{classbdm_1_1PF_6f1988db4c3f602d187a6c15ec89cb1e} |
---|
30 | |
---|
31 | \begin{CompactList}\small\item\em Set posterior density by sampling from epdf0. \item\end{CompactList}\item |
---|
32 | void \hyperlink{classbdm_1_1PF_638946eea22d4964bf9350286bb4efd8}{bayes} (const vec \&dt) |
---|
33 | \begin{CompactList}\small\item\em Incremental Bayes rule. \item\end{CompactList}\item |
---|
34 | \hypertarget{classbdm_1_1PF_78a9f6809827be1d9bfe215d03b1c6ed}{ |
---|
35 | vec $\ast$ \hyperlink{classbdm_1_1PF_78a9f6809827be1d9bfe215d03b1c6ed}{\_\-\_\-w} ()} |
---|
36 | \label{classbdm_1_1PF_78a9f6809827be1d9bfe215d03b1c6ed} |
---|
37 | |
---|
38 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize} |
---|
39 | \begin{Indent}{\bf Constructors}\par |
---|
40 | \begin{CompactItemize} |
---|
41 | \item |
---|
42 | virtual \hyperlink{classbdm_1_1BM}{BM} $\ast$ \hyperlink{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff}{\_\-copy\_\-} () |
---|
43 | \end{CompactItemize} |
---|
44 | \end{Indent} |
---|
45 | \begin{Indent}{\bf Mathematical operations}\par |
---|
46 | \begin{CompactItemize} |
---|
47 | \item |
---|
48 | \hypertarget{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{ |
---|
49 | virtual void \hyperlink{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{bayesB} (const mat \&Dt)} |
---|
50 | \label{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc} |
---|
51 | |
---|
52 | \begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item |
---|
53 | virtual double \hyperlink{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{logpred} (const vec \&dt) const |
---|
54 | \item |
---|
55 | \hypertarget{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{ |
---|
56 | vec \hyperlink{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{logpred\_\-m} (const mat \&dt) const } |
---|
57 | \label{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae} |
---|
58 | |
---|
59 | \begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\item |
---|
60 | \hypertarget{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}{ |
---|
61 | virtual \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}{epredictor} () const } |
---|
62 | \label{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba} |
---|
63 | |
---|
64 | \begin{CompactList}\small\item\em Constructs a predictive density $ f(d_{t+1} |d_{t}, \ldots d_{0}) $. \item\end{CompactList}\item |
---|
65 | \hypertarget{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{ |
---|
66 | virtual \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ \hyperlink{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{predictor} () const } |
---|
67 | \label{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912} |
---|
68 | |
---|
69 | \begin{CompactList}\small\item\em Constructs a conditional density 1-step ahead predictor. \item\end{CompactList}\end{CompactItemize} |
---|
70 | \end{Indent} |
---|
71 | \begin{Indent}{\bf Access to attributes}\par |
---|
72 | \begin{CompactItemize} |
---|
73 | \item |
---|
74 | \hypertarget{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{ |
---|
75 | const \hyperlink{classbdm_1_1RV}{RV} \& \textbf{\_\-drv} () const } |
---|
76 | \label{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c} |
---|
77 | |
---|
78 | \item |
---|
79 | \hypertarget{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{ |
---|
80 | void \textbf{set\_\-drv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv)} |
---|
81 | \label{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96} |
---|
82 | |
---|
83 | \item |
---|
84 | \hypertarget{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{ |
---|
85 | double \textbf{\_\-ll} () const } |
---|
86 | \label{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70} |
---|
87 | |
---|
88 | \item |
---|
89 | \hypertarget{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{ |
---|
90 | void \textbf{set\_\-evalll} (bool evl0)} |
---|
91 | \label{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f} |
---|
92 | |
---|
93 | \item |
---|
94 | \hypertarget{classbdm_1_1BM_963258c4c2dd05be001003b19aceefef}{ |
---|
95 | virtual const \hyperlink{classbdm_1_1epdf}{epdf} \& \textbf{\_\-epdf} () const =0} |
---|
96 | \label{classbdm_1_1BM_963258c4c2dd05be001003b19aceefef} |
---|
97 | |
---|
98 | \item |
---|
99 | \hypertarget{classbdm_1_1BM_4ed0f8b880e606316ae800f3a011c3a6}{ |
---|
100 | virtual const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \textbf{\_\-e} () const =0} |
---|
101 | \label{classbdm_1_1BM_4ed0f8b880e606316ae800f3a011c3a6} |
---|
102 | |
---|
103 | \end{CompactItemize} |
---|
104 | \end{Indent} |
---|
105 | \subsection*{Protected Attributes} |
---|
106 | \begin{CompactItemize} |
---|
107 | \item |
---|
108 | \hypertarget{classbdm_1_1PF_eeafaf9b8ad75fe62ee9fd6369e3f7fe}{ |
---|
109 | int \hyperlink{classbdm_1_1PF_eeafaf9b8ad75fe62ee9fd6369e3f7fe}{n}} |
---|
110 | \label{classbdm_1_1PF_eeafaf9b8ad75fe62ee9fd6369e3f7fe} |
---|
111 | |
---|
112 | \begin{CompactList}\small\item\em number of particles; \item\end{CompactList}\item |
---|
113 | \hypertarget{classbdm_1_1PF_dc049265b9086cad7071f98d00a2b9af}{ |
---|
114 | \hyperlink{classbdm_1_1eEmp}{eEmp} \hyperlink{classbdm_1_1PF_dc049265b9086cad7071f98d00a2b9af}{est}} |
---|
115 | \label{classbdm_1_1PF_dc049265b9086cad7071f98d00a2b9af} |
---|
116 | |
---|
117 | \begin{CompactList}\small\item\em posterior density \item\end{CompactList}\item |
---|
118 | \hypertarget{classbdm_1_1PF_f5149d5522d1095d39240c4c607f61a3}{ |
---|
119 | vec \& \hyperlink{classbdm_1_1PF_f5149d5522d1095d39240c4c607f61a3}{\_\-w}} |
---|
120 | \label{classbdm_1_1PF_f5149d5522d1095d39240c4c607f61a3} |
---|
121 | |
---|
122 | \begin{CompactList}\small\item\em pointer into {\tt \hyperlink{classbdm_1_1eEmp}{eEmp}} \item\end{CompactList}\item |
---|
123 | \hypertarget{classbdm_1_1PF_914bd66025692c4018dbd482cb3c47c1}{ |
---|
124 | Array$<$ vec $>$ \& \hyperlink{classbdm_1_1PF_914bd66025692c4018dbd482cb3c47c1}{\_\-samples}} |
---|
125 | \label{classbdm_1_1PF_914bd66025692c4018dbd482cb3c47c1} |
---|
126 | |
---|
127 | \begin{CompactList}\small\item\em pointer into {\tt \hyperlink{classbdm_1_1eEmp}{eEmp}} \item\end{CompactList}\item |
---|
128 | \hypertarget{classbdm_1_1PF_cf3a1b2a407012e47ac878e3aa2fbf34}{ |
---|
129 | \hyperlink{classbdm_1_1mpdf}{mpdf} \& \hyperlink{classbdm_1_1PF_cf3a1b2a407012e47ac878e3aa2fbf34}{par}} |
---|
130 | \label{classbdm_1_1PF_cf3a1b2a407012e47ac878e3aa2fbf34} |
---|
131 | |
---|
132 | \begin{CompactList}\small\item\em Parameter evolution model. \item\end{CompactList}\item |
---|
133 | \hypertarget{classbdm_1_1PF_c58b8fa634272c3f48845a9020ba55aa}{ |
---|
134 | \hyperlink{classbdm_1_1mpdf}{mpdf} \& \hyperlink{classbdm_1_1PF_c58b8fa634272c3f48845a9020ba55aa}{obs}} |
---|
135 | \label{classbdm_1_1PF_c58b8fa634272c3f48845a9020ba55aa} |
---|
136 | |
---|
137 | \begin{CompactList}\small\item\em Observation model. \item\end{CompactList}\item |
---|
138 | \hypertarget{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{ |
---|
139 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{drv}} |
---|
140 | \label{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed} |
---|
141 | |
---|
142 | \begin{CompactList}\small\item\em Random variable of the data (optional). \item\end{CompactList}\item |
---|
143 | \hypertarget{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ |
---|
144 | double \hyperlink{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ll}} |
---|
145 | \label{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a} |
---|
146 | |
---|
147 | \begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item |
---|
148 | \hypertarget{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{ |
---|
149 | bool \hyperlink{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{evalll}} |
---|
150 | \label{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee} |
---|
151 | |
---|
152 | \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} |
---|
153 | |
---|
154 | |
---|
155 | \subsection{Member Function Documentation} |
---|
156 | \hypertarget{classbdm_1_1PF_638946eea22d4964bf9350286bb4efd8}{ |
---|
157 | \index{bdm::PF@{bdm::PF}!bayes@{bayes}} |
---|
158 | \index{bayes@{bayes}!bdm::PF@{bdm::PF}} |
---|
159 | \subsubsection[bayes]{\setlength{\rightskip}{0pt plus 5cm}void bdm::PF::bayes (const vec \& {\em dt})\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} |
---|
160 | \label{classbdm_1_1PF_638946eea22d4964bf9350286bb4efd8} |
---|
161 | |
---|
162 | |
---|
163 | Incremental Bayes rule. |
---|
164 | |
---|
165 | \begin{Desc} |
---|
166 | \item[Parameters:] |
---|
167 | \begin{description} |
---|
168 | \item[{\em dt}]vector of input data \end{description} |
---|
169 | \end{Desc} |
---|
170 | |
---|
171 | |
---|
172 | Implements \hyperlink{classbdm_1_1BM_60b1779a577367c369a932cabd3a6188}{bdm::BM}. |
---|
173 | |
---|
174 | Reimplemented in \hyperlink{classbdm_1_1MPF_286d040770d08bd7ff416cea617b1b14}{bdm::MPF$<$ BM\_\-T $>$}. |
---|
175 | |
---|
176 | References bdm::mpdf::\_\-e(), \_\-samples, \_\-w, est, bdm::epdf::evallog(), bdm::mpdf::evallogcond(), n, obs, par, bdm::eEmp::resample(), and bdm::mpdf::samplecond().\hypertarget{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff}{ |
---|
177 | \index{bdm::PF@{bdm::PF}!\_\-copy\_\-@{\_\-copy\_\-}} |
---|
178 | \index{\_\-copy\_\-@{\_\-copy\_\-}!bdm::PF@{bdm::PF}} |
---|
179 | \subsubsection[\_\-copy\_\-]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf BM}$\ast$ bdm::BM::\_\-copy\_\- ()\hspace{0.3cm}{\tt \mbox{[}inline, virtual, inherited\mbox{]}}}} |
---|
180 | \label{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff} |
---|
181 | |
---|
182 | |
---|
183 | Copy function required in vectors, Arrays of \hyperlink{classbdm_1_1BM}{BM} etc. Have to be DELETED manually! Prototype: |
---|
184 | |
---|
185 | \begin{Code}\begin{verbatim} BM* _copy_(){return new BM(*this);} |
---|
186 | \end{verbatim} |
---|
187 | \end{Code} |
---|
188 | |
---|
189 | |
---|
190 | |
---|
191 | Reimplemented in \hyperlink{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}{bdm::ARX}.\hypertarget{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{ |
---|
192 | \index{bdm::PF@{bdm::PF}!logpred@{logpred}} |
---|
193 | \index{logpred@{logpred}!bdm::PF@{bdm::PF}} |
---|
194 | \subsubsection[logpred]{\setlength{\rightskip}{0pt plus 5cm}virtual double bdm::BM::logpred (const vec \& {\em dt}) const\hspace{0.3cm}{\tt \mbox{[}inline, virtual, inherited\mbox{]}}}} |
---|
195 | \label{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0} |
---|
196 | |
---|
197 | |
---|
198 | Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. |
---|
199 | |
---|
200 | Reimplemented in \hyperlink{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}{bdm::ARX}, \hyperlink{classbdm_1_1MixEF_da724da464a75e07521941e430929efa}{bdm::MixEF}, and \hyperlink{classbdm_1_1multiBM_e157b607c1e3fa91d42aeea44458e2bf}{bdm::multiBM}. |
---|
201 | |
---|
202 | Referenced by bdm::BM::logpred\_\-m(). |
---|
203 | |
---|
204 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
205 | \item |
---|
206 | \hyperlink{libPF_8h}{libPF.h}\item |
---|
207 | libPF.cpp\end{CompactItemize} |
---|