\hypertarget{classbdm_1_1PF}{
\section{bdm::PF Class Reference}
\label{classbdm_1_1PF}\index{bdm::PF@{bdm::PF}}
}
{\tt \#include $<$libPF.h$>$}

Inheritance diagram for bdm::PF::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{classbdm_1_1PF}
\end{center}
\end{figure}


\subsection{Detailed Description}
Trivial particle filter with proposal density equal to parameter evolution model. 

Posterior density is represented by a weighted empirical density ({\tt \hyperlink{classbdm_1_1eEmp}{eEmp}} ). \subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
void \hyperlink{classbdm_1_1PF_6f1988db4c3f602d187a6c15ec89cb1e}{set\_\-est} (const \hyperlink{classbdm_1_1epdf}{epdf} \&epdf0)
\item 
void \hyperlink{classbdm_1_1PF_638946eea22d4964bf9350286bb4efd8}{bayes} (const vec \&dt)
\begin{CompactList}\small\item\em Incremental Bayes rule. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1PF_78a9f6809827be1d9bfe215d03b1c6ed}{
vec $\ast$ \hyperlink{classbdm_1_1PF_78a9f6809827be1d9bfe215d03b1c6ed}{\_\-\_\-w} ()}
\label{classbdm_1_1PF_78a9f6809827be1d9bfe215d03b1c6ed}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize}
\begin{Indent}{\bf Constructors}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1PF_297339fd48bc1cfd011d16603d54accb}{
\textbf{PF} ()}
\label{classbdm_1_1PF_297339fd48bc1cfd011d16603d54accb}

\item 
\hypertarget{classbdm_1_1PF_3b9fdf0d1e712392bfcad5a26c727d44}{
\textbf{PF} (\hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$par0, \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$obs0, \hyperlink{classbdm_1_1epdf}{epdf} $\ast$epdf0, int n0)}
\label{classbdm_1_1PF_3b9fdf0d1e712392bfcad5a26c727d44}

\item 
\hypertarget{classbdm_1_1PF_e6d63c627cd1600eb0a88294d0ff6ca3}{
void \textbf{set\_\-parameters} (\hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$par0, \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$obs0, int n0)}
\label{classbdm_1_1PF_e6d63c627cd1600eb0a88294d0ff6ca3}

\item 
\hypertarget{classbdm_1_1PF_9830cb311f67e8276d3f2b167ab681b9}{
void \textbf{set\_\-statistics} (const vec w0, \hyperlink{classbdm_1_1epdf}{epdf} $\ast$epdf0)}
\label{classbdm_1_1PF_9830cb311f67e8276d3f2b167ab681b9}

\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Constructors}\par
\begin{CompactItemize}
\item 
virtual \hyperlink{classbdm_1_1BM}{BM} $\ast$ \hyperlink{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff}{\_\-copy\_\-} ()
\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Mathematical operations}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{
virtual void \hyperlink{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{bayesB} (const mat \&Dt)}
\label{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}

\begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item 
virtual double \hyperlink{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{logpred} (const vec \&dt) const 
\item 
\hypertarget{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{
vec \hyperlink{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{logpred\_\-m} (const mat \&dt) const }
\label{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}

\begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}{
virtual \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}{epredictor} () const }
\label{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}

\begin{CompactList}\small\item\em Constructs a predictive density $ f(d_{t+1} |d_{t}, \ldots d_{0}) $. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{
virtual \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ \hyperlink{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{predictor} () const }
\label{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}

\begin{CompactList}\small\item\em Constructs a conditional density 1-step ahead predictor. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Access to attributes}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{
const \hyperlink{classbdm_1_1RV}{RV} \& \textbf{\_\-drv} () const }
\label{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}

\item 
\hypertarget{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{
void \textbf{set\_\-drv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv)}
\label{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}

\item 
\hypertarget{classbdm_1_1BM_b38d92f17620813ad872d86e01a26e5e}{
void \textbf{set\_\-rv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv)}
\label{classbdm_1_1BM_b38d92f17620813ad872d86e01a26e5e}

\item 
\hypertarget{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{
double \textbf{\_\-ll} () const }
\label{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}

\item 
\hypertarget{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{
void \textbf{set\_\-evalll} (bool evl0)}
\label{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}

\item 
\hypertarget{classbdm_1_1BM_bb7b0065d6cb722a66b371a8260121e1}{
virtual const \hyperlink{classbdm_1_1epdf}{epdf} \& \textbf{posterior} () const =0}
\label{classbdm_1_1BM_bb7b0065d6cb722a66b371a8260121e1}

\item 
\hypertarget{classbdm_1_1BM_4ed0f8b880e606316ae800f3a011c3a6}{
virtual const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \textbf{\_\-e} () const =0}
\label{classbdm_1_1BM_4ed0f8b880e606316ae800f3a011c3a6}

\end{CompactItemize}
\end{Indent}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1PF_eeafaf9b8ad75fe62ee9fd6369e3f7fe}{
int \hyperlink{classbdm_1_1PF_eeafaf9b8ad75fe62ee9fd6369e3f7fe}{n}}
\label{classbdm_1_1PF_eeafaf9b8ad75fe62ee9fd6369e3f7fe}

\begin{CompactList}\small\item\em number of particles; \item\end{CompactList}\item 
\hypertarget{classbdm_1_1PF_dc049265b9086cad7071f98d00a2b9af}{
\hyperlink{classbdm_1_1eEmp}{eEmp} \hyperlink{classbdm_1_1PF_dc049265b9086cad7071f98d00a2b9af}{est}}
\label{classbdm_1_1PF_dc049265b9086cad7071f98d00a2b9af}

\begin{CompactList}\small\item\em posterior density \item\end{CompactList}\item 
\hypertarget{classbdm_1_1PF_f5149d5522d1095d39240c4c607f61a3}{
vec \& \hyperlink{classbdm_1_1PF_f5149d5522d1095d39240c4c607f61a3}{\_\-w}}
\label{classbdm_1_1PF_f5149d5522d1095d39240c4c607f61a3}

\begin{CompactList}\small\item\em pointer into {\tt \hyperlink{classbdm_1_1eEmp}{eEmp}} \item\end{CompactList}\item 
\hypertarget{classbdm_1_1PF_914bd66025692c4018dbd482cb3c47c1}{
Array$<$ vec $>$ \& \hyperlink{classbdm_1_1PF_914bd66025692c4018dbd482cb3c47c1}{\_\-samples}}
\label{classbdm_1_1PF_914bd66025692c4018dbd482cb3c47c1}

\begin{CompactList}\small\item\em pointer into {\tt \hyperlink{classbdm_1_1eEmp}{eEmp}} \item\end{CompactList}\item 
\hypertarget{classbdm_1_1PF_521e9621d3b5e1274275f323691afdaf}{
\hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ \hyperlink{classbdm_1_1PF_521e9621d3b5e1274275f323691afdaf}{par}}
\label{classbdm_1_1PF_521e9621d3b5e1274275f323691afdaf}

\begin{CompactList}\small\item\em Parameter evolution model. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1PF_d6e7a62fba1e0a0d73c9b87f4fb683ec}{
\hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ \hyperlink{classbdm_1_1PF_d6e7a62fba1e0a0d73c9b87f4fb683ec}{obs}}
\label{classbdm_1_1PF_d6e7a62fba1e0a0d73c9b87f4fb683ec}

\begin{CompactList}\small\item\em Observation model. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{drv}}
\label{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}

\begin{CompactList}\small\item\em Random variable of the data (optional). \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{
double \hyperlink{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ll}}
\label{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}

\begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{
bool \hyperlink{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{evalll}}
\label{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}

\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}


\subsection{Member Function Documentation}
\hypertarget{classbdm_1_1PF_6f1988db4c3f602d187a6c15ec89cb1e}{
\index{bdm::PF@{bdm::PF}!set\_\-est@{set\_\-est}}
\index{set\_\-est@{set\_\-est}!bdm::PF@{bdm::PF}}
\subsubsection[set\_\-est]{\setlength{\rightskip}{0pt plus 5cm}void bdm::PF::set\_\-est (const {\bf epdf} \& {\em epdf0})}}
\label{classbdm_1_1PF_6f1988db4c3f602d187a6c15ec89cb1e}


Set posterior density by sampling from epdf0 

Reimplemented in \hyperlink{classbdm_1_1MPF_dcecdaf2acbbee51acf3018a70989a7e}{bdm::MPF$<$ BM\_\-T $>$}.

References \_\-samples, n, and bdm::epdf::sample().

Referenced by bdm::MPF$<$ BM\_\-T $>$::set\_\-est().\hypertarget{classbdm_1_1PF_638946eea22d4964bf9350286bb4efd8}{
\index{bdm::PF@{bdm::PF}!bayes@{bayes}}
\index{bayes@{bayes}!bdm::PF@{bdm::PF}}
\subsubsection[bayes]{\setlength{\rightskip}{0pt plus 5cm}void bdm::PF::bayes (const vec \& {\em dt})\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
\label{classbdm_1_1PF_638946eea22d4964bf9350286bb4efd8}


Incremental Bayes rule. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dt}]vector of input data \end{description}
\end{Desc}


Implements \hyperlink{classbdm_1_1BM_60b1779a577367c369a932cabd3a6188}{bdm::BM}.

Reimplemented in \hyperlink{classbdm_1_1MPF_286d040770d08bd7ff416cea617b1b14}{bdm::MPF$<$ BM\_\-T $>$}.

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}{
\index{bdm::PF@{bdm::PF}!\_\-copy\_\-@{\_\-copy\_\-}}
\index{\_\-copy\_\-@{\_\-copy\_\-}!bdm::PF@{bdm::PF}}
\subsubsection[\_\-copy\_\-]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf BM}$\ast$ bdm::BM::\_\-copy\_\- ()\hspace{0.3cm}{\tt  \mbox{[}inline, virtual, inherited\mbox{]}}}}
\label{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff}


Copy function required in vectors, Arrays of \hyperlink{classbdm_1_1BM}{BM} etc. Have to be DELETED manually! Prototype: 

\begin{Code}\begin{verbatim} BM* _copy_(){return new BM(*this);} 
\end{verbatim}
\end{Code}

 

Reimplemented in \hyperlink{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}{bdm::ARX}.\hypertarget{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{
\index{bdm::PF@{bdm::PF}!logpred@{logpred}}
\index{logpred@{logpred}!bdm::PF@{bdm::PF}}
\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{]}}}}
\label{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}


Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. 

Reimplemented in \hyperlink{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}{bdm::ARX}, \hyperlink{classbdm_1_1MixEF_da724da464a75e07521941e430929efa}{bdm::MixEF}, and \hyperlink{classbdm_1_1multiBM_e157b607c1e3fa91d42aeea44458e2bf}{bdm::multiBM}.

Referenced by bdm::BM::logpred\_\-m().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
\hyperlink{libPF_8h}{libPF.h}\item 
libPF.cpp\end{CompactItemize}
