[172] | 1 | \hypertarget{classPF}{ |
---|
[8] | 2 | \section{PF Class Reference} |
---|
| 3 | \label{classPF}\index{PF@{PF}} |
---|
[172] | 4 | } |
---|
[32] | 5 | Trivial particle filter with proposal density equal to parameter evolution model. |
---|
[8] | 6 | |
---|
| 7 | |
---|
| 8 | {\tt \#include $<$libPF.h$>$} |
---|
| 9 | |
---|
[19] | 10 | Inheritance diagram for PF:\nopagebreak |
---|
| 11 | \begin{figure}[H] |
---|
[8] | 12 | \begin{center} |
---|
| 13 | \leavevmode |
---|
[91] | 14 | \includegraphics[width=62pt]{classPF__inherit__graph} |
---|
[8] | 15 | \end{center} |
---|
| 16 | \end{figure} |
---|
[19] | 17 | Collaboration diagram for PF:\nopagebreak |
---|
| 18 | \begin{figure}[H] |
---|
| 19 | \begin{center} |
---|
| 20 | \leavevmode |
---|
[91] | 21 | \includegraphics[width=92pt]{classPF__coll__graph} |
---|
[19] | 22 | \end{center} |
---|
| 23 | \end{figure} |
---|
[8] | 24 | \subsection*{Public Member Functions} |
---|
| 25 | \begin{CompactItemize} |
---|
| 26 | \item |
---|
[172] | 27 | \hypertarget{classPF_e99f0d866721405dd281e315ecb690aa}{ |
---|
| 28 | \hyperlink{classPF_e99f0d866721405dd281e315ecb690aa}{PF} (const \hyperlink{classRV}{RV} \&rv0, \hyperlink{classmpdf}{mpdf} \&par0, \hyperlink{classmpdf}{mpdf} \&obs0, int n0)} |
---|
| 29 | \label{classPF_e99f0d866721405dd281e315ecb690aa} |
---|
[8] | 30 | |
---|
[33] | 31 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
[172] | 32 | \hypertarget{classPF_04d38fbcc0348b558212f530d9ec183e}{ |
---|
| 33 | void \hyperlink{classPF_04d38fbcc0348b558212f530d9ec183e}{set\_\-est} (const \hyperlink{classepdf}{epdf} \&epdf0)} |
---|
| 34 | \label{classPF_04d38fbcc0348b558212f530d9ec183e} |
---|
[28] | 35 | |
---|
[33] | 36 | \begin{CompactList}\small\item\em Set posterior density by sampling from epdf0. \item\end{CompactList}\item |
---|
[172] | 37 | void \hyperlink{classPF_64f636bbd63bea9efd778214e6b631d3}{bayes} (const vec \&dt) |
---|
[28] | 38 | \begin{CompactList}\small\item\em Incremental Bayes rule. \item\end{CompactList}\item |
---|
[234] | 39 | \hypertarget{classPF_140a073d5236684078b09021892d3b20}{ |
---|
| 40 | vec $\ast$ \hyperlink{classPF_140a073d5236684078b09021892d3b20}{\_\-\_\-w} ()} |
---|
| 41 | \label{classPF_140a073d5236684078b09021892d3b20} |
---|
| 42 | |
---|
| 43 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
[172] | 44 | \hypertarget{classBM_0186270f75189677f390fe088a9947e9}{ |
---|
| 45 | virtual void \hyperlink{classBM_0186270f75189677f390fe088a9947e9}{bayesB} (const mat \&Dt)} |
---|
| 46 | \label{classBM_0186270f75189677f390fe088a9947e9} |
---|
[28] | 47 | |
---|
| 48 | \begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item |
---|
[172] | 49 | \hypertarget{classBM_8554809fec160bee279bcd5fa14ead5c}{ |
---|
| 50 | virtual const \hyperlink{classepdf}{epdf} \& \hyperlink{classBM_8554809fec160bee279bcd5fa14ead5c}{\_\-epdf} () const =0} |
---|
| 51 | \label{classBM_8554809fec160bee279bcd5fa14ead5c} |
---|
[28] | 52 | |
---|
[210] | 53 | \begin{CompactList}\small\item\em Returns a reference to the \hyperlink{classepdf}{epdf} representing posterior density on parameters. \item\end{CompactList}\item |
---|
| 54 | \hypertarget{classBM_db500c4836f883c175a3cf3ab5a3ce24}{ |
---|
| 55 | virtual const \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classBM_db500c4836f883c175a3cf3ab5a3ce24}{\_\-e} () const =0} |
---|
| 56 | \label{classBM_db500c4836f883c175a3cf3ab5a3ce24} |
---|
| 57 | |
---|
[172] | 58 | \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 |
---|
| 59 | virtual double \hyperlink{classBM_8a8ce6df431689964c41cc6c849cfd06}{logpred} (const vec \&dt) const |
---|
| 60 | \item |
---|
[180] | 61 | \hypertarget{classBM_cd0660f2a1a344b56ac39802708ff165}{ |
---|
| 62 | vec \hyperlink{classBM_cd0660f2a1a344b56ac39802708ff165}{logpred\_\-m} (const mat \&dt) const } |
---|
| 63 | \label{classBM_cd0660f2a1a344b56ac39802708ff165} |
---|
| 64 | |
---|
| 65 | \begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\item |
---|
[210] | 66 | \hypertarget{classBM_5594d68ee9aa6fc8c1e79019da5c9d56}{ |
---|
| 67 | virtual \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classBM_5594d68ee9aa6fc8c1e79019da5c9d56}{predictor} (const \hyperlink{classRV}{RV} \&\hyperlink{classBM_af00f0612fabe66241dd507188cdbf88}{rv}) const } |
---|
| 68 | \label{classBM_5594d68ee9aa6fc8c1e79019da5c9d56} |
---|
[180] | 69 | |
---|
| 70 | \begin{CompactList}\small\item\em Constructs a predictive density (marginal density on data). \item\end{CompactList}\item |
---|
[172] | 71 | \hypertarget{classBM_126bd2595c48e311fc2a7ab72876092a}{ |
---|
| 72 | const \hyperlink{classRV}{RV} \& \hyperlink{classBM_126bd2595c48e311fc2a7ab72876092a}{\_\-rv} () const } |
---|
| 73 | \label{classBM_126bd2595c48e311fc2a7ab72876092a} |
---|
[33] | 74 | |
---|
| 75 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
[172] | 76 | \hypertarget{classBM_87f4a547d2c29180be88175e5eab9c88}{ |
---|
| 77 | double \hyperlink{classBM_87f4a547d2c29180be88175e5eab9c88}{\_\-ll} () const } |
---|
| 78 | \label{classBM_87f4a547d2c29180be88175e5eab9c88} |
---|
[33] | 79 | |
---|
[172] | 80 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
| 81 | \hypertarget{classBM_1ffa9f23669aabecc3760c06c6987522}{ |
---|
| 82 | void \hyperlink{classBM_1ffa9f23669aabecc3760c06c6987522}{set\_\-evalll} (bool evl0)} |
---|
| 83 | \label{classBM_1ffa9f23669aabecc3760c06c6987522} |
---|
| 84 | |
---|
| 85 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
| 86 | virtual \hyperlink{classBM}{BM} $\ast$ \hyperlink{classBM_eb58c81d6a7b75b05fc6f276eed78887}{\_\-copy\_\-} (bool changerv=false) |
---|
| 87 | \end{CompactItemize} |
---|
[32] | 88 | \subsection*{Protected Attributes} |
---|
[28] | 89 | \begin{CompactItemize} |
---|
| 90 | \item |
---|
[172] | 91 | \hypertarget{classPF_2c2f44ed7a4eaa42e07bdb58d503f280}{ |
---|
| 92 | int \hyperlink{classPF_2c2f44ed7a4eaa42e07bdb58d503f280}{n}} |
---|
| 93 | \label{classPF_2c2f44ed7a4eaa42e07bdb58d503f280} |
---|
[32] | 94 | |
---|
| 95 | \begin{CompactList}\small\item\em number of particles; \item\end{CompactList}\item |
---|
[172] | 96 | \hypertarget{classPF_1a0a09e309da997f63ae8e30d1e9806b}{ |
---|
| 97 | \hyperlink{classeEmp}{eEmp} \hyperlink{classPF_1a0a09e309da997f63ae8e30d1e9806b}{est}} |
---|
| 98 | \label{classPF_1a0a09e309da997f63ae8e30d1e9806b} |
---|
[32] | 99 | |
---|
| 100 | \begin{CompactList}\small\item\em posterior density \item\end{CompactList}\item |
---|
[172] | 101 | \hypertarget{classPF_5c87aba508df321ff26536ced64dbb3a}{ |
---|
| 102 | vec \& \hyperlink{classPF_5c87aba508df321ff26536ced64dbb3a}{\_\-w}} |
---|
| 103 | \label{classPF_5c87aba508df321ff26536ced64dbb3a} |
---|
[32] | 104 | |
---|
[172] | 105 | \begin{CompactList}\small\item\em pointer into {\tt \hyperlink{classeEmp}{eEmp}} \item\end{CompactList}\item |
---|
| 106 | \hypertarget{classPF_cf7dad75e31215780a746c30e71ad9c5}{ |
---|
| 107 | Array$<$ vec $>$ \& \hyperlink{classPF_cf7dad75e31215780a746c30e71ad9c5}{\_\-samples}} |
---|
| 108 | \label{classPF_cf7dad75e31215780a746c30e71ad9c5} |
---|
[32] | 109 | |
---|
[172] | 110 | \begin{CompactList}\small\item\em pointer into {\tt \hyperlink{classeEmp}{eEmp}} \item\end{CompactList}\item |
---|
| 111 | \hypertarget{classPF_d92ac103f88f8c21e197e90af5695a09}{ |
---|
| 112 | \hyperlink{classmpdf}{mpdf} \& \hyperlink{classPF_d92ac103f88f8c21e197e90af5695a09}{par}} |
---|
| 113 | \label{classPF_d92ac103f88f8c21e197e90af5695a09} |
---|
[32] | 114 | |
---|
| 115 | \begin{CompactList}\small\item\em Parameter evolution model. \item\end{CompactList}\item |
---|
[172] | 116 | \hypertarget{classPF_dd0a687a4515333d6809147335854e77}{ |
---|
| 117 | \hyperlink{classmpdf}{mpdf} \& \hyperlink{classPF_dd0a687a4515333d6809147335854e77}{obs}} |
---|
| 118 | \label{classPF_dd0a687a4515333d6809147335854e77} |
---|
[32] | 119 | |
---|
| 120 | \begin{CompactList}\small\item\em Observation model. \item\end{CompactList}\item |
---|
[172] | 121 | \hypertarget{classBM_af00f0612fabe66241dd507188cdbf88}{ |
---|
| 122 | \hyperlink{classRV}{RV} \hyperlink{classBM_af00f0612fabe66241dd507188cdbf88}{rv}} |
---|
| 123 | \label{classBM_af00f0612fabe66241dd507188cdbf88} |
---|
[32] | 124 | |
---|
| 125 | \begin{CompactList}\small\item\em Random variable of the posterior. \item\end{CompactList}\item |
---|
[172] | 126 | \hypertarget{classBM_5623fef6572a08c2b53b8c87b82dc979}{ |
---|
| 127 | double \hyperlink{classBM_5623fef6572a08c2b53b8c87b82dc979}{ll}} |
---|
| 128 | \label{classBM_5623fef6572a08c2b53b8c87b82dc979} |
---|
[28] | 129 | |
---|
| 130 | \begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item |
---|
[172] | 131 | \hypertarget{classBM_bf6fb59b30141074f8ee1e2f43d03129}{ |
---|
| 132 | bool \hyperlink{classBM_bf6fb59b30141074f8ee1e2f43d03129}{evalll}} |
---|
| 133 | \label{classBM_bf6fb59b30141074f8ee1e2f43d03129} |
---|
[28] | 134 | |
---|
[172] | 135 | \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} |
---|
[8] | 136 | |
---|
| 137 | |
---|
| 138 | \subsection{Detailed Description} |
---|
[32] | 139 | Trivial particle filter with proposal density equal to parameter evolution model. |
---|
[8] | 140 | |
---|
[172] | 141 | Posterior density is represented by a weighted empirical density ({\tt \hyperlink{classeEmp}{eEmp}} ). |
---|
[8] | 142 | |
---|
[19] | 143 | \subsection{Member Function Documentation} |
---|
[172] | 144 | \hypertarget{classPF_64f636bbd63bea9efd778214e6b631d3}{ |
---|
[19] | 145 | \index{PF@{PF}!bayes@{bayes}} |
---|
| 146 | \index{bayes@{bayes}!PF@{PF}} |
---|
[172] | 147 | \subsubsection[bayes]{\setlength{\rightskip}{0pt plus 5cm}void PF::bayes (const vec \& {\em dt})\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} |
---|
| 148 | \label{classPF_64f636bbd63bea9efd778214e6b631d3} |
---|
[19] | 149 | |
---|
| 150 | |
---|
| 151 | Incremental Bayes rule. |
---|
| 152 | |
---|
| 153 | \begin{Desc} |
---|
| 154 | \item[Parameters:] |
---|
| 155 | \begin{description} |
---|
[28] | 156 | \item[{\em dt}]vector of input data \end{description} |
---|
[19] | 157 | \end{Desc} |
---|
| 158 | |
---|
| 159 | |
---|
[172] | 160 | Implements \hyperlink{classBM_a892eff438aab2dd1a9e2efcb7fb5bdf}{BM}. |
---|
[32] | 161 | |
---|
[172] | 162 | Reimplemented in \hyperlink{classMPF_55daf8e4b6553dd9f47c692de7931623}{MPF$<$ BM\_\-T $>$}. |
---|
[32] | 163 | |
---|
[219] | 164 | References \_\-samples, \_\-w, est, mpdf::evallogcond(), n, obs, par, eEmp::resample(), and mpdf::samplecond().\hypertarget{classBM_8a8ce6df431689964c41cc6c849cfd06}{ |
---|
[172] | 165 | \index{PF@{PF}!logpred@{logpred}} |
---|
| 166 | \index{logpred@{logpred}!PF@{PF}} |
---|
| 167 | \subsubsection[logpred]{\setlength{\rightskip}{0pt plus 5cm}virtual double BM::logpred (const vec \& {\em dt}) const\hspace{0.3cm}{\tt \mbox{[}inline, virtual, inherited\mbox{]}}}} |
---|
| 168 | \label{classBM_8a8ce6df431689964c41cc6c849cfd06} |
---|
[91] | 169 | |
---|
[172] | 170 | |
---|
| 171 | Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. |
---|
| 172 | |
---|
[180] | 173 | Reimplemented in \hyperlink{classARX_e7f9e7823aec9bf7ddc3b42d9b3304c4}{ARX}, \hyperlink{classMixEF_424ca64f36d4e41de7a7e7ae921d35ea}{MixEF}, and \hyperlink{classmultiBM_13e26a61757278981fd8cac9a7ef91eb}{multiBM}. |
---|
| 174 | |
---|
| 175 | Referenced by BM::logpred\_\-m().\hypertarget{classBM_eb58c81d6a7b75b05fc6f276eed78887}{ |
---|
[172] | 176 | \index{PF@{PF}!\_\-copy\_\-@{\_\-copy\_\-}} |
---|
| 177 | \index{\_\-copy\_\-@{\_\-copy\_\-}!PF@{PF}} |
---|
| 178 | \subsubsection[\_\-copy\_\-]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf BM}$\ast$ BM::\_\-copy\_\- (bool {\em changerv} = {\tt false})\hspace{0.3cm}{\tt \mbox{[}inline, virtual, inherited\mbox{]}}}} |
---|
| 179 | \label{classBM_eb58c81d6a7b75b05fc6f276eed78887} |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | Copy function required in vectors, Arrays of \hyperlink{classBM}{BM} etc. Have to be DELETED manually! Prototype: BM$\ast$ \hyperlink{classBM_eb58c81d6a7b75b05fc6f276eed78887}{\_\-copy\_\-()}\{\hyperlink{classBM}{BM} Tmp$\ast$=new Tmp(this$\ast$); return Tmp; \} |
---|
| 183 | |
---|
[210] | 184 | Reimplemented in \hyperlink{classARX_5de61fbd4f97fa3216760b1f733f5af0}{ARX}, and \hyperlink{classBMEF_97f5312efe4a5bedb86d2daec59d8651}{BMEF}. |
---|
[172] | 185 | |
---|
[8] | 186 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
| 187 | \item |
---|
[172] | 188 | work/git/mixpp/bdm/estim/\hyperlink{libPF_8h}{libPF.h}\item |
---|
[145] | 189 | work/git/mixpp/bdm/estim/libPF.cpp\end{CompactItemize} |
---|