root/doc/latex/classbdm_1_1EKF.tex @ 271

Revision 271, 14.9 kB (checked in by smidl, 16 years ago)

Next major revision

Line 
1\hypertarget{classbdm_1_1EKF}{
2\section{bdm::EKF$<$ sq\_\-T $>$ Class Template Reference}
3\label{classbdm_1_1EKF}\index{bdm::EKF@{bdm::EKF}}
4}
5{\tt \#include $<$libKF.h$>$}
6
7Inheritance diagram for bdm::EKF$<$ sq\_\-T $>$::\begin{figure}[H]
8\begin{center}
9\leavevmode
10\includegraphics[height=4cm]{classbdm_1_1EKF}
11\end{center}
12\end{figure}
13
14
15\subsection{Detailed Description}
16\subsubsection*{template$<$class sq\_\-T$>$ class bdm::EKF$<$ sq\_\-T $>$}
17
18Extended \hyperlink{classbdm_1_1Kalman}{Kalman} Filter.
19
20An approximation of the exact Bayesian filter with Gaussian noices and non-linear evolutions of their mean. \subsection*{Public Member Functions}
21\begin{CompactItemize}
22\item 
23\hypertarget{classbdm_1_1EKF_d087a8bb408d26ac4f5c542746b81059}{
24\hyperlink{classbdm_1_1EKF_d087a8bb408d26ac4f5c542746b81059}{EKF} (\hyperlink{classbdm_1_1RV}{RV} rvx, \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1Kalman_3fe475a1e920b20b63bb342c0e1571f7}{rvy}, \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1Kalman_149e27424fd1a7cc1c998ea088618a94}{rvu})}
25\label{classbdm_1_1EKF_d087a8bb408d26ac4f5c542746b81059}
26
27\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
28\hypertarget{classbdm_1_1EKF_00fec1a0a6a467eb83fb36c65eba7bcb}{
29void \hyperlink{classbdm_1_1EKF_00fec1a0a6a467eb83fb36c65eba7bcb}{set\_\-parameters} (\hyperlink{classbdm_1_1diffbifn}{diffbifn} $\ast$pfxu, \hyperlink{classbdm_1_1diffbifn}{diffbifn} $\ast$phxu, const sq\_\-T Q0, const sq\_\-T R0)}
30\label{classbdm_1_1EKF_00fec1a0a6a467eb83fb36c65eba7bcb}
31
32\begin{CompactList}\small\item\em Set nonlinear functions for mean values and covariance matrices. \item\end{CompactList}\item 
33\hypertarget{classbdm_1_1EKF_3fb182ecc29b10ca1163cecbf3bcccfa}{
34void \hyperlink{classbdm_1_1EKF_3fb182ecc29b10ca1163cecbf3bcccfa}{bayes} (const vec \&dt)}
35\label{classbdm_1_1EKF_3fb182ecc29b10ca1163cecbf3bcccfa}
36
37\begin{CompactList}\small\item\em Here dt = \mbox{[}yt;ut\mbox{]} of appropriate dimensions. \item\end{CompactList}\item 
38\hypertarget{classbdm_1_1Kalman_3c7fb87fb6b87d08deb6a5a7862da957}{
39void \hyperlink{classbdm_1_1Kalman_3c7fb87fb6b87d08deb6a5a7862da957}{set\_\-parameters} (const mat \&A0, const mat \&B0, const mat \&C0, const mat \&D0, const \hyperlink{classfsqmat}{fsqmat} \&Q0, const \hyperlink{classfsqmat}{fsqmat} \&R0)}
40\label{classbdm_1_1Kalman_3c7fb87fb6b87d08deb6a5a7862da957}
41
42\begin{CompactList}\small\item\em Set parameters with check of relevance. \item\end{CompactList}\item 
43\hypertarget{classbdm_1_1Kalman_9264fc6b173ecb803d2684b883f32c68}{
44void \hyperlink{classbdm_1_1Kalman_9264fc6b173ecb803d2684b883f32c68}{set\_\-est} (const vec \&mu0, const \hyperlink{classfsqmat}{fsqmat} \&P0)}
45\label{classbdm_1_1Kalman_9264fc6b173ecb803d2684b883f32c68}
46
47\begin{CompactList}\small\item\em Set estimate values, used e.g. in initialization. \item\end{CompactList}\item 
48\hypertarget{classbdm_1_1Kalman_f75e487ff6c129d7012d702030f8c890}{
49const \hyperlink{classbdm_1_1epdf}{epdf} \& \hyperlink{classbdm_1_1Kalman_f75e487ff6c129d7012d702030f8c890}{posterior} () const }
50\label{classbdm_1_1Kalman_f75e487ff6c129d7012d702030f8c890}
51
52\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
53\hypertarget{classbdm_1_1Kalman_c34989b1e53c7d4ecdaea63a95ddbd77}{
54const \hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classfsqmat}{fsqmat} $>$ $\ast$ \textbf{\_\-e} () const }
55\label{classbdm_1_1Kalman_c34989b1e53c7d4ecdaea63a95ddbd77}
56
57\item 
58\hypertarget{classbdm_1_1Kalman_c788ec6e6c6f5f5861ae8a56d8ede277}{
59mat \& \hyperlink{classbdm_1_1Kalman_c788ec6e6c6f5f5861ae8a56d8ede277}{\_\-\_\-K} ()}
60\label{classbdm_1_1Kalman_c788ec6e6c6f5f5861ae8a56d8ede277}
61
62\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
63\hypertarget{classbdm_1_1Kalman_a250d1dbe7bba861dba2a324520cfa48}{
64vec \hyperlink{classbdm_1_1Kalman_a250d1dbe7bba861dba2a324520cfa48}{\_\-dP} ()}
65\label{classbdm_1_1Kalman_a250d1dbe7bba861dba2a324520cfa48}
66
67\begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize}
68\begin{Indent}{\bf Constructors}\par
69\begin{CompactItemize}
70\item 
71virtual \hyperlink{classbdm_1_1BM}{BM} $\ast$ \hyperlink{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff}{\_\-copy\_\-} ()
72\end{CompactItemize}
73\end{Indent}
74\begin{Indent}{\bf Mathematical operations}\par
75\begin{CompactItemize}
76\item 
77\hypertarget{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{
78virtual void \hyperlink{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{bayesB} (const mat \&Dt)}
79\label{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}
80
81\begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item 
82virtual double \hyperlink{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{logpred} (const vec \&dt) const
83\item 
84\hypertarget{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{
85vec \hyperlink{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{logpred\_\-m} (const mat \&dt) const }
86\label{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}
87
88\begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\item 
89\hypertarget{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}{
90virtual \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}{epredictor} () const }
91\label{classbdm_1_1BM_688d7a2aced1e06aa1c468d73a9e5eba}
92
93\begin{CompactList}\small\item\em Constructs a predictive density $ f(d_{t+1} |d_{t}, \ldots d_{0}) $. \item\end{CompactList}\item 
94\hypertarget{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{
95virtual \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ \hyperlink{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{predictor} () const }
96\label{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}
97
98\begin{CompactList}\small\item\em Constructs a conditional density 1-step ahead predictor. \item\end{CompactList}\end{CompactItemize}
99\end{Indent}
100\begin{Indent}{\bf Access to attributes}\par
101\begin{CompactItemize}
102\item 
103\hypertarget{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{
104const \hyperlink{classbdm_1_1RV}{RV} \& \textbf{\_\-drv} () const }
105\label{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}
106
107\item 
108\hypertarget{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{
109void \textbf{set\_\-drv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv)}
110\label{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}
111
112\item 
113\hypertarget{classbdm_1_1BM_b38d92f17620813ad872d86e01a26e5e}{
114void \textbf{set\_\-rv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv)}
115\label{classbdm_1_1BM_b38d92f17620813ad872d86e01a26e5e}
116
117\item 
118\hypertarget{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{
119double \textbf{\_\-ll} () const }
120\label{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}
121
122\item 
123\hypertarget{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{
124void \textbf{set\_\-evalll} (bool evl0)}
125\label{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}
126
127\end{CompactItemize}
128\end{Indent}
129\subsection*{Protected Attributes}
130\begin{CompactItemize}
131\item 
132\hypertarget{classbdm_1_1Kalman_3fe475a1e920b20b63bb342c0e1571f7}{
133\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1Kalman_3fe475a1e920b20b63bb342c0e1571f7}{rvy}}
134\label{classbdm_1_1Kalman_3fe475a1e920b20b63bb342c0e1571f7}
135
136\begin{CompactList}\small\item\em Indetifier of output rv. \item\end{CompactList}\item 
137\hypertarget{classbdm_1_1Kalman_149e27424fd1a7cc1c998ea088618a94}{
138\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1Kalman_149e27424fd1a7cc1c998ea088618a94}{rvu}}
139\label{classbdm_1_1Kalman_149e27424fd1a7cc1c998ea088618a94}
140
141\begin{CompactList}\small\item\em Indetifier of exogeneous rv. \item\end{CompactList}\item 
142\hypertarget{classbdm_1_1Kalman_ba7699cdb3b1382a54d3e28b9b7517fa}{
143int \hyperlink{classbdm_1_1Kalman_ba7699cdb3b1382a54d3e28b9b7517fa}{dimx}}
144\label{classbdm_1_1Kalman_ba7699cdb3b1382a54d3e28b9b7517fa}
145
146\begin{CompactList}\small\item\em cache of rv.count() \item\end{CompactList}\item 
147\hypertarget{classbdm_1_1Kalman_d2c36ba01760bf207b985bf321b7817f}{
148int \hyperlink{classbdm_1_1Kalman_d2c36ba01760bf207b985bf321b7817f}{dimy}}
149\label{classbdm_1_1Kalman_d2c36ba01760bf207b985bf321b7817f}
150
151\begin{CompactList}\small\item\em cache of rvy.count() \item\end{CompactList}\item 
152\hypertarget{classbdm_1_1Kalman_c5136ef617f6ac0e426bea222755d92b}{
153int \hyperlink{classbdm_1_1Kalman_c5136ef617f6ac0e426bea222755d92b}{dimu}}
154\label{classbdm_1_1Kalman_c5136ef617f6ac0e426bea222755d92b}
155
156\begin{CompactList}\small\item\em cache of rvu.count() \item\end{CompactList}\item 
157\hypertarget{classbdm_1_1Kalman_0a2072e2090c10fac74ad30a023a4ace}{
158mat \hyperlink{classbdm_1_1Kalman_0a2072e2090c10fac74ad30a023a4ace}{A}}
159\label{classbdm_1_1Kalman_0a2072e2090c10fac74ad30a023a4ace}
160
161\begin{CompactList}\small\item\em Matrix A. \item\end{CompactList}\item 
162\hypertarget{classbdm_1_1Kalman_5977b2c81857948a35105f0e7840203c}{
163mat \hyperlink{classbdm_1_1Kalman_5977b2c81857948a35105f0e7840203c}{B}}
164\label{classbdm_1_1Kalman_5977b2c81857948a35105f0e7840203c}
165
166\begin{CompactList}\small\item\em Matrix B. \item\end{CompactList}\item 
167\hypertarget{classbdm_1_1Kalman_818eba63a23972786a4579ad30294177}{
168mat \hyperlink{classbdm_1_1Kalman_818eba63a23972786a4579ad30294177}{C}}
169\label{classbdm_1_1Kalman_818eba63a23972786a4579ad30294177}
170
171\begin{CompactList}\small\item\em Matrix C. \item\end{CompactList}\item 
172\hypertarget{classbdm_1_1Kalman_7b56ac423d0654b5755e4f852a870456}{
173mat \hyperlink{classbdm_1_1Kalman_7b56ac423d0654b5755e4f852a870456}{D}}
174\label{classbdm_1_1Kalman_7b56ac423d0654b5755e4f852a870456}
175
176\begin{CompactList}\small\item\em Matrix D. \item\end{CompactList}\item 
177\hypertarget{classbdm_1_1Kalman_70f8bf19e81b532c60fd3a7a152425ee}{
178\hyperlink{classfsqmat}{fsqmat} \hyperlink{classbdm_1_1Kalman_70f8bf19e81b532c60fd3a7a152425ee}{Q}}
179\label{classbdm_1_1Kalman_70f8bf19e81b532c60fd3a7a152425ee}
180
181\begin{CompactList}\small\item\em Matrix Q in square-root form. \item\end{CompactList}\item 
182\hypertarget{classbdm_1_1Kalman_475b088287cdfbba4dc60a3d027728b7}{
183\hyperlink{classfsqmat}{fsqmat} \hyperlink{classbdm_1_1Kalman_475b088287cdfbba4dc60a3d027728b7}{R}}
184\label{classbdm_1_1Kalman_475b088287cdfbba4dc60a3d027728b7}
185
186\begin{CompactList}\small\item\em Matrix R in square-root form. \item\end{CompactList}\item 
187\hypertarget{classbdm_1_1Kalman_383f329ff18bbe219254c8b3b916f40d}{
188\hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classfsqmat}{fsqmat} $>$ \hyperlink{classbdm_1_1Kalman_383f329ff18bbe219254c8b3b916f40d}{est}}
189\label{classbdm_1_1Kalman_383f329ff18bbe219254c8b3b916f40d}
190
191\begin{CompactList}\small\item\em posterior density on \$x\_\-t\$ \item\end{CompactList}\item 
192\hypertarget{classbdm_1_1Kalman_ba555c394c429f6831c9bbabfa2c944c}{
193\hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classfsqmat}{fsqmat} $>$ \hyperlink{classbdm_1_1Kalman_ba555c394c429f6831c9bbabfa2c944c}{fy}}
194\label{classbdm_1_1Kalman_ba555c394c429f6831c9bbabfa2c944c}
195
196\begin{CompactList}\small\item\em preditive density on \$y\_\-t\$ \item\end{CompactList}\item 
197\hypertarget{classbdm_1_1Kalman_bd69dfb802465f22dd84d73a180d5c92}{
198mat \hyperlink{classbdm_1_1Kalman_bd69dfb802465f22dd84d73a180d5c92}{\_\-K}}
199\label{classbdm_1_1Kalman_bd69dfb802465f22dd84d73a180d5c92}
200
201\begin{CompactList}\small\item\em placeholder for Kalman gain \item\end{CompactList}\item 
202\hypertarget{classbdm_1_1Kalman_c249d45258c8578b13858ad3e7b729b1}{
203vec \& \hyperlink{classbdm_1_1Kalman_c249d45258c8578b13858ad3e7b729b1}{\_\-yp}}
204\label{classbdm_1_1Kalman_c249d45258c8578b13858ad3e7b729b1}
205
206\begin{CompactList}\small\item\em cache of fy.mu \item\end{CompactList}\item 
207\hypertarget{classbdm_1_1Kalman_2dd268f2d7fbe6382cb8825a1114192a}{
208\hyperlink{classfsqmat}{fsqmat} \& \hyperlink{classbdm_1_1Kalman_2dd268f2d7fbe6382cb8825a1114192a}{\_\-Ry}}
209\label{classbdm_1_1Kalman_2dd268f2d7fbe6382cb8825a1114192a}
210
211\begin{CompactList}\small\item\em cache of fy.R \item\end{CompactList}\item 
212\hypertarget{classbdm_1_1Kalman_fa172078091e45561343fa513dd573b0}{
213vec \& \hyperlink{classbdm_1_1Kalman_fa172078091e45561343fa513dd573b0}{\_\-mu}}
214\label{classbdm_1_1Kalman_fa172078091e45561343fa513dd573b0}
215
216\begin{CompactList}\small\item\em cache of est.mu \item\end{CompactList}\item 
217\hypertarget{classbdm_1_1Kalman_00c27b0bf324f0018497921ca23c71ed}{
218\hyperlink{classfsqmat}{fsqmat} \& \hyperlink{classbdm_1_1Kalman_00c27b0bf324f0018497921ca23c71ed}{\_\-P}}
219\label{classbdm_1_1Kalman_00c27b0bf324f0018497921ca23c71ed}
220
221\begin{CompactList}\small\item\em cache of est.R \item\end{CompactList}\item 
222\hypertarget{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{
223\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{drv}}
224\label{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}
225
226\begin{CompactList}\small\item\em Random variable of the data (optional). \item\end{CompactList}\item 
227\hypertarget{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{
228double \hyperlink{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ll}}
229\label{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}
230
231\begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item 
232\hypertarget{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{
233bool \hyperlink{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{evalll}}
234\label{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}
235
236\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}
237
238
239\subsection{Member Function Documentation}
240\hypertarget{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff}{
241\index{bdm::EKF@{bdm::EKF}!\_\-copy\_\-@{\_\-copy\_\-}}
242\index{\_\-copy\_\-@{\_\-copy\_\-}!bdm::EKF@{bdm::EKF}}
243\subsubsection[\_\-copy\_\-]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf BM}$\ast$ bdm::BM::\_\-copy\_\- ()\hspace{0.3cm}{\tt  \mbox{[}inline, virtual, inherited\mbox{]}}}}
244\label{classbdm_1_1BM_c0f027ff91d8459937c6f60ff8e553ff}
245
246
247Copy function required in vectors, Arrays of \hyperlink{classbdm_1_1BM}{BM} etc. Have to be DELETED manually! Prototype:
248
249\begin{Code}\begin{verbatim} BM* _copy_(){return new BM(*this);} 
250\end{verbatim}
251\end{Code}
252
253 
254
255Reimplemented in \hyperlink{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}{bdm::ARX}.\hypertarget{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{
256\index{bdm::EKF@{bdm::EKF}!logpred@{logpred}}
257\index{logpred@{logpred}!bdm::EKF@{bdm::EKF}}
258\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{]}}}}
259\label{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}
260
261
262Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out.
263
264Reimplemented in \hyperlink{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}{bdm::ARX}, \hyperlink{classbdm_1_1MixEF_da724da464a75e07521941e430929efa}{bdm::MixEF}, and \hyperlink{classbdm_1_1multiBM_e157b607c1e3fa91d42aeea44458e2bf}{bdm::multiBM}.
265
266Referenced by bdm::BM::logpred\_\-m().
267
268The documentation for this class was generated from the following file:\begin{CompactItemize}
269\item 
270\hyperlink{libKF_8h}{libKF.h}\end{CompactItemize}
Note: See TracBrowser for help on using the browser.