Show
Ignore:
Timestamp:
01/28/09 10:01:09 (16 years ago)
Author:
smidl
Message:

doc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/html/libKF_8h-source.html

    r234 r255  
    2525<a name="l00019"></a>00019 <span class="preprocessor">#include "../math/chmat.h"</span> 
    2626<a name="l00020"></a>00020  
    27 <a name="l00021"></a>00021 <span class="keyword">using namespace </span>itpp; 
     27<a name="l00021"></a>00021 <span class="keyword">namespace </span>bdm{ 
    2828<a name="l00022"></a>00022  
    29 <a name="l00027"></a><a class="code" href="classKalmanFull.html">00027</a> <span class="keyword">class </span><a class="code" href="classKalmanFull.html" title="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</a> { 
     29<a name="l00027"></a><a class="code" href="classbdm_1_1KalmanFull.html">00027</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1KalmanFull.html" title="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</a> { 
    3030<a name="l00028"></a>00028 <span class="keyword">protected</span>: 
    3131<a name="l00029"></a>00029         <span class="keywordtype">int</span> dimx, dimy, dimu; 
     
    3636<a name="l00034"></a>00034 <span class="keyword">public</span>: 
    3737<a name="l00035"></a>00035         <span class="comment">//posterior</span> 
    38 <a name="l00037"></a><a class="code" href="classKalmanFull.html#fb5aec635e2720cc5ac31bc01c18a68a">00037</a> <span class="comment"></span>        vec <a class="code" href="classKalmanFull.html#fb5aec635e2720cc5ac31bc01c18a68a" title="Mean value of the posterior density.">mu</a>; 
    39 <a name="l00039"></a><a class="code" href="classKalmanFull.html#b75dc059e84fa8ffc076203b30f926cc">00039</a>         mat <a class="code" href="classKalmanFull.html#b75dc059e84fa8ffc076203b30f926cc" title="Variance of the posterior density.">P</a>; 
     38<a name="l00037"></a><a class="code" href="classbdm_1_1KalmanFull.html#2defb75e58892615c5f95fd844f3a666">00037</a> <span class="comment"></span>        vec <a class="code" href="classbdm_1_1KalmanFull.html#2defb75e58892615c5f95fd844f3a666" title="Mean value of the posterior density.">mu</a>; 
     39<a name="l00039"></a><a class="code" href="classbdm_1_1KalmanFull.html#acacd228e100c3e937de575ad2d7cd9c">00039</a>         mat <a class="code" href="classbdm_1_1KalmanFull.html#acacd228e100c3e937de575ad2d7cd9c" title="Variance of the posterior density.">P</a>; 
    4040<a name="l00040"></a>00040  
    4141<a name="l00041"></a>00041         <span class="keywordtype">bool</span> evalll; 
    4242<a name="l00042"></a>00042         <span class="keywordtype">double</span> ll; 
    4343<a name="l00043"></a>00043 <span class="keyword">public</span>: 
    44 <a name="l00045"></a>00045         <a class="code" href="classKalmanFull.html#9d7cc2235b643d9662cd9c8b8469747d" title="For EKFfull;.">KalmanFull</a> ( mat A, mat B, mat C, mat D, mat R, mat Q, mat P0, vec mu0 ); 
    45 <a name="l00047"></a>00047         <span class="keywordtype">void</span> <a class="code" href="classKalmanFull.html#13a041cd98ff157703766be275a657bb" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
    46 <a name="l00049"></a>00049         <span class="keyword">friend</span> std::ostream &amp;<a class="code" href="classKalmanFull.html#86ba216243ed95bb46d80d88775d16af" title="print elements of KF">operator&lt;&lt; </a>( std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classKalmanFull.html" title="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</a> &amp;kf ); 
    47 <a name="l00051"></a><a class="code" href="classKalmanFull.html#9d7cc2235b643d9662cd9c8b8469747d">00051</a>         <a class="code" href="classKalmanFull.html#9d7cc2235b643d9662cd9c8b8469747d" title="For EKFfull;.">KalmanFull</a>(){}; 
     44<a name="l00045"></a>00045         <a class="code" href="classbdm_1_1KalmanFull.html#bdcc98c8b18c1cbdebdf218ae838fd11" title="For EKFfull;.">KalmanFull</a> ( mat A, mat B, mat C, mat D, mat R, mat Q, mat P0, vec mu0 ); 
     45<a name="l00047"></a>00047         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1KalmanFull.html#081924bc97f453f674bb982b7951d053" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
     46<a name="l00049"></a>00049         <span class="keyword">friend</span> std::ostream &amp;<a class="code" href="classbdm_1_1KalmanFull.html#86ba216243ed95bb46d80d88775d16af" title="print elements of KF">operator&lt;&lt; </a>( std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classbdm_1_1KalmanFull.html" title="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</a> &amp;kf ); 
     47<a name="l00051"></a><a class="code" href="classbdm_1_1KalmanFull.html#bdcc98c8b18c1cbdebdf218ae838fd11">00051</a>         <a class="code" href="classbdm_1_1KalmanFull.html#bdcc98c8b18c1cbdebdf218ae838fd11" title="For EKFfull;.">KalmanFull</a>(){}; 
    4848<a name="l00052"></a>00052 }; 
    4949<a name="l00053"></a>00053  
     
    5151<a name="l00062"></a>00062 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    5252<a name="l00063"></a>00063  
    53 <a name="l00064"></a><a class="code" href="classKalman.html">00064</a> <span class="keyword">class </span><a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a> : <span class="keyword">public</span> <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { 
     53<a name="l00064"></a><a class="code" href="classbdm_1_1Kalman.html">00064</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { 
    5454<a name="l00065"></a>00065 <span class="keyword">protected</span>: 
    55 <a name="l00067"></a><a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c">00067</a>         <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a>; 
    56 <a name="l00069"></a><a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498">00069</a>         <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498" title="Indetifier of exogeneous rv.">rvu</a>; 
    57 <a name="l00071"></a><a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb">00071</a>         <span class="keywordtype">int</span> <a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>; 
    58 <a name="l00073"></a><a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a">00073</a>         <span class="keywordtype">int</span> <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>; 
    59 <a name="l00075"></a><a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce">00075</a>         <span class="keywordtype">int</span> <a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a>; 
    60 <a name="l00077"></a><a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9">00077</a>         mat <a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a>; 
    61 <a name="l00079"></a><a class="code" href="classKalman.html#dc87704284a6c0bca13bf51f4345a50a">00079</a>         mat <a class="code" href="classKalman.html#dc87704284a6c0bca13bf51f4345a50a" title="Matrix B.">B</a>;  
    62 <a name="l00081"></a><a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13">00081</a>         mat <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>; 
    63 <a name="l00083"></a><a class="code" href="classKalman.html#d69f774ba3335c970c1c5b1d182f4dd1">00083</a>         mat <a class="code" href="classKalman.html#d69f774ba3335c970c1c5b1d182f4dd1" title="Matrix D.">D</a>; 
    64 <a name="l00085"></a><a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9">00085</a>         sq_T <a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9" title="Matrix Q in square-root form.">Q</a>; 
    65 <a name="l00087"></a><a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec">00087</a>         sq_T <a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a>; 
     55<a name="l00067"></a><a class="code" href="classbdm_1_1Kalman.html#3fe475a1e920b20b63bb342c0e1571f7">00067</a>         <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#3fe475a1e920b20b63bb342c0e1571f7" title="Indetifier of output rv.">rvy</a>; 
     56<a name="l00069"></a><a class="code" href="classbdm_1_1Kalman.html#149e27424fd1a7cc1c998ea088618a94">00069</a>         <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#149e27424fd1a7cc1c998ea088618a94" title="Indetifier of exogeneous rv.">rvu</a>; 
     57<a name="l00071"></a><a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa">00071</a>         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>; 
     58<a name="l00073"></a><a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f">00073</a>         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>; 
     59<a name="l00075"></a><a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b">00075</a>         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a>; 
     60<a name="l00077"></a><a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace">00077</a>         mat <a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a>; 
     61<a name="l00079"></a><a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c">00079</a>         mat <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a>;  
     62<a name="l00081"></a><a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177">00081</a>         mat <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>; 
     63<a name="l00083"></a><a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456">00083</a>         mat <a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a>; 
     64<a name="l00085"></a><a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee">00085</a>         sq_T <a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a>; 
     65<a name="l00087"></a><a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7">00087</a>         sq_T <a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a>; 
    6666<a name="l00088"></a>00088  
    67 <a name="l00090"></a><a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424">00090</a>         <a class="code" href="classenorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> <a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a>; 
    68 <a name="l00092"></a><a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f">00092</a>         <a class="code" href="classenorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> <a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f" title="preditive density on $y_t$">fy</a>; 
     67<a name="l00090"></a><a class="code" href="classbdm_1_1Kalman.html#383f329ff18bbe219254c8b3b916f40d">00090</a>         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> <a class="code" href="classbdm_1_1Kalman.html#383f329ff18bbe219254c8b3b916f40d" title="posterior density on $x_t$">est</a>; 
     68<a name="l00092"></a><a class="code" href="classbdm_1_1Kalman.html#ba555c394c429f6831c9bbabfa2c944c">00092</a>         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> <a class="code" href="classbdm_1_1Kalman.html#ba555c394c429f6831c9bbabfa2c944c" title="preditive density on $y_t$">fy</a>; 
    6969<a name="l00093"></a>00093  
    70 <a name="l00095"></a><a class="code" href="classKalman.html#d422f51467c7a06174af2476d2826132">00095</a>         mat <a class="code" href="classKalman.html#d422f51467c7a06174af2476d2826132" title="placeholder for Kalman gain">_K</a>; 
    71 <a name="l00097"></a><a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd">00097</a>         vec&amp; <a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a>; 
    72 <a name="l00099"></a><a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904">00099</a>         sq_T&amp; <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a>; 
    73 <a name="l00101"></a><a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061">00101</a>         vec&amp; <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>; 
    74 <a name="l00103"></a><a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf">00103</a>         sq_T&amp; <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>; 
     70<a name="l00095"></a><a class="code" href="classbdm_1_1Kalman.html#bd69dfb802465f22dd84d73a180d5c92">00095</a>         mat <a class="code" href="classbdm_1_1Kalman.html#bd69dfb802465f22dd84d73a180d5c92" title="placeholder for Kalman gain">_K</a>; 
     71<a name="l00097"></a><a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1">00097</a>         vec&amp; <a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1" title="cache of fy.mu">_yp</a>; 
     72<a name="l00099"></a><a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a">00099</a>         sq_T&amp; <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a>; 
     73<a name="l00101"></a><a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0">00101</a>         vec&amp; <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>; 
     74<a name="l00103"></a><a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed">00103</a>         sq_T&amp; <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>; 
    7575<a name="l00104"></a>00104  
    7676<a name="l00105"></a>00105 <span class="keyword">public</span>: 
    77 <a name="l00107"></a>00107         <a class="code" href="classKalman.html#3d56b0a97b8c1e25fdd3b10eef3c2ad3" title="Default constructor.">Kalman</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx0, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ); 
    78 <a name="l00109"></a>00109         <a class="code" href="classKalman.html#3d56b0a97b8c1e25fdd3b10eef3c2ad3" title="Default constructor.">Kalman</a> ( <span class="keyword">const</span> <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;</a> &amp;K0 ); 
    79 <a name="l00111"></a>00111         <span class="keywordtype">void</span> <a class="code" href="classKalman.html#239b28a0380946f5749b2f8d2807f93a" title="Set parameters with check of relevance.">set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0,<span class="keyword">const</span> mat &amp;B0,<span class="keyword">const</span> mat &amp;C0,<span class="keyword">const</span> mat &amp;D0,<span class="keyword">const</span> sq_T &amp;R0,<span class="keyword">const</span> sq_T &amp;Q0 ); 
    80 <a name="l00113"></a><a class="code" href="classKalman.html#80bcf29466d9a9dd2b8f74699807d0c0">00113</a>         <span class="keywordtype">void</span> <a class="code" href="classKalman.html#80bcf29466d9a9dd2b8f74699807d0c0" title="Set estimate values, used e.g. in initialization.">set_est</a> ( <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;P0 ) { 
    81 <a name="l00114"></a>00114                 sq_T pom(<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>); 
    82 <a name="l00115"></a>00115                 <a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a>.set_parameters ( mu0,P0 ); 
    83 <a name="l00116"></a>00116                 P0.mult_sym(<a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>,pom); 
    84 <a name="l00117"></a>00117                 <a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f" title="preditive density on $y_t$">fy</a>.set_parameters ( <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>*mu0, pom ); 
     77<a name="l00107"></a>00107         <a class="code" href="classbdm_1_1Kalman.html#7d8fae1d89d796e3fd40d9e088c432ab" title="Default constructor.">Kalman</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx0, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ); 
     78<a name="l00109"></a>00109         <a class="code" href="classbdm_1_1Kalman.html#7d8fae1d89d796e3fd40d9e088c432ab" title="Default constructor.">Kalman</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;</a> &amp;K0 ); 
     79<a name="l00111"></a>00111         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1Kalman.html#94eb8cc31731210089db0ba4e1a08a6c" title="Set parameters with check of relevance.">set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0,<span class="keyword">const</span> mat &amp;B0,<span class="keyword">const</span> mat &amp;C0,<span class="keyword">const</span> mat &amp;D0,<span class="keyword">const</span> sq_T &amp;R0,<span class="keyword">const</span> sq_T &amp;Q0 ); 
     80<a name="l00113"></a><a class="code" href="classbdm_1_1Kalman.html#9264fc6b173ecb803d2684b883f32c68">00113</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1Kalman.html#9264fc6b173ecb803d2684b883f32c68" title="Set estimate values, used e.g. in initialization.">set_est</a> ( <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;P0 ) { 
     81<a name="l00114"></a>00114                 sq_T pom(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>); 
     82<a name="l00115"></a>00115                 <a class="code" href="classbdm_1_1Kalman.html#383f329ff18bbe219254c8b3b916f40d" title="posterior density on $x_t$">est</a>.set_parameters ( mu0,P0 ); 
     83<a name="l00116"></a>00116                 P0.mult_sym(<a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>,pom); 
     84<a name="l00117"></a>00117                 <a class="code" href="classbdm_1_1Kalman.html#ba555c394c429f6831c9bbabfa2c944c" title="preditive density on $y_t$">fy</a>.set_parameters ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>*mu0, pom ); 
    8585<a name="l00118"></a>00118         }; 
    8686<a name="l00119"></a>00119  
    87 <a name="l00121"></a>00121         <span class="keywordtype">void</span> <a class="code" href="classKalman.html#7750ffd73f261828a32c18aaeb65c75c" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
    88 <a name="l00123"></a><a class="code" href="classKalman.html#67cccaf1c4dcdcd1df110e15ef326bfe">00123</a>         <span class="keyword">const</span> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>&amp; <a class="code" href="classKalman.html#67cccaf1c4dcdcd1df110e15ef326bfe" title="access function">_epdf</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a>;} 
    89 <a name="l00124"></a><a class="code" href="classKalman.html#11f82ef04e3dbc54bd1d3d89edb6aa07">00124</a>         <span class="keyword">const</span> <a class="code" href="classenorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a>* <a class="code" href="classKalman.html#11f82ef04e3dbc54bd1d3d89edb6aa07" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_e</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> &amp;<a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a>;} 
    90 <a name="l00126"></a><a class="code" href="classKalman.html#980fcd41c6c548c5da7b8b67c8e6da79">00126</a>         mat&amp; <a class="code" href="classKalman.html#980fcd41c6c548c5da7b8b67c8e6da79" title="access function">__K</a>() {<span class="keywordflow">return</span> <a class="code" href="classKalman.html#d422f51467c7a06174af2476d2826132" title="placeholder for Kalman gain">_K</a>;} 
    91 <a name="l00128"></a><a class="code" href="classKalman.html#ac9540f3850b74d89a5fe4db6fc358ce">00128</a>         vec <a class="code" href="classKalman.html#ac9540f3850b74d89a5fe4db6fc358ce" title="access function">_dP</a>() {<span class="keywordflow">return</span> <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>-&gt;getD();} 
     87<a name="l00121"></a>00121         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1Kalman.html#4a39330c14eff8d13179e868a1d1aa8c" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
     88<a name="l00123"></a><a class="code" href="classbdm_1_1Kalman.html#93b5936ba397f13c05f52885c545f42d">00123</a>         <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>&amp; <a class="code" href="classbdm_1_1Kalman.html#93b5936ba397f13c05f52885c545f42d" title="access function">_epdf</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1Kalman.html#383f329ff18bbe219254c8b3b916f40d" title="posterior density on $x_t$">est</a>;} 
     89<a name="l00124"></a><a class="code" href="classbdm_1_1Kalman.html#c34989b1e53c7d4ecdaea63a95ddbd77">00124</a>         <span class="keyword">const</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a>* <a class="code" href="classbdm_1_1Kalman.html#c34989b1e53c7d4ecdaea63a95ddbd77" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_e</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> &amp;<a class="code" href="classbdm_1_1Kalman.html#383f329ff18bbe219254c8b3b916f40d" title="posterior density on $x_t$">est</a>;} 
     90<a name="l00126"></a><a class="code" href="classbdm_1_1Kalman.html#c788ec6e6c6f5f5861ae8a56d8ede277">00126</a>         mat&amp; <a class="code" href="classbdm_1_1Kalman.html#c788ec6e6c6f5f5861ae8a56d8ede277" title="access function">__K</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1Kalman.html#bd69dfb802465f22dd84d73a180d5c92" title="placeholder for Kalman gain">_K</a>;} 
     91<a name="l00128"></a><a class="code" href="classbdm_1_1Kalman.html#a250d1dbe7bba861dba2a324520cfa48">00128</a>         vec <a class="code" href="classbdm_1_1Kalman.html#a250d1dbe7bba861dba2a324520cfa48" title="access function">_dP</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>-&gt;getD();} 
    9292<a name="l00129"></a>00129 }; 
    9393<a name="l00130"></a>00130  
    94 <a name="l00133"></a><a class="code" href="classKalmanCh.html">00133</a> <span class="keyword">class </span><a class="code" href="classKalmanCh.html" title="Kalman filter in square root form.">KalmanCh</a> : <span class="keyword">public</span> <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;chmat&gt;{ 
     94<a name="l00133"></a><a class="code" href="classbdm_1_1KalmanCh.html">00133</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1KalmanCh.html" title="Kalman filter in square root form.">KalmanCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;chmat&gt;{ 
    9595<a name="l00134"></a>00134 <span class="keyword">protected</span>: 
    96 <a name="l00136"></a><a class="code" href="classKalmanCh.html#94ee9da75b0e0f632e4a354988ca3798">00136</a> mat <a class="code" href="classKalmanCh.html#94ee9da75b0e0f632e4a354988ca3798" title="pre array (triangular matrix)">preA</a>; 
    97 <a name="l00138"></a><a class="code" href="classKalmanCh.html#0d31a26dc72b5846cfe5af3ccb63ac87">00138</a> mat <a class="code" href="classKalmanCh.html#0d31a26dc72b5846cfe5af3ccb63ac87" title="post array (triangular matrix)">postA</a>; 
     96<a name="l00136"></a><a class="code" href="classbdm_1_1KalmanCh.html#48611c8582706cfa62e832be0972e75d">00136</a> mat <a class="code" href="classbdm_1_1KalmanCh.html#48611c8582706cfa62e832be0972e75d" title="pre array (triangular matrix)">preA</a>; 
     97<a name="l00138"></a><a class="code" href="classbdm_1_1KalmanCh.html#bcbd68f51d4b57246e7784ca5900171f">00138</a> mat <a class="code" href="classbdm_1_1KalmanCh.html#bcbd68f51d4b57246e7784ca5900171f" title="post array (triangular matrix)">postA</a>; 
    9898<a name="l00139"></a>00139  
    9999<a name="l00140"></a>00140 <span class="keyword">public</span>: 
    100 <a name="l00142"></a><a class="code" href="classKalmanCh.html#d11f110cccaa66177514632d37b086bb">00142</a>         <a class="code" href="classKalmanCh.html#d11f110cccaa66177514632d37b086bb" title="Default constructor.">KalmanCh</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx0, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ):<a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;<a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&gt;(rvx0,rvy0,rvu0),<a class="code" href="classKalmanCh.html#94ee9da75b0e0f632e4a354988ca3798" title="pre array (triangular matrix)">preA</a>(<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>+<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>,<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>),<a class="code" href="classKalmanCh.html#0d31a26dc72b5846cfe5af3ccb63ac87" title="post array (triangular matrix)">postA</a>(<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>,<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>){}; 
    101 <a name="l00144"></a>00144         <span class="keywordtype">void</span> <a class="code" href="classKalmanCh.html#92fb227287af05c9f0078d523c7c9793" title="Set parameters with check of relevance.">set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0,<span class="keyword">const</span> mat &amp;B0,<span class="keyword">const</span> mat &amp;C0,<span class="keyword">const</span> mat &amp;D0,<span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;R0,<span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;Q0 ); 
    102 <a name="l00145"></a><a class="code" href="classKalmanCh.html#b261b20f6210d4c85131d33302df0adc">00145</a>         <span class="keywordtype">void</span> <a class="code" href="classKalmanCh.html#b261b20f6210d4c85131d33302df0adc" title="Set estimate values, used e.g. in initialization.">set_est</a> ( <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;P0 ) { 
    103 <a name="l00146"></a>00146                 <a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a>.<a class="code" href="classenorm.html#1394a65caa6e00d42e00cc99b12227af" title="Set mean value mu and covariance R.">set_parameters</a> ( mu0,P0 ); 
     100<a name="l00142"></a><a class="code" href="classbdm_1_1KalmanCh.html#5c50fb48d2c7fb6d31e2061f32ecc230">00142</a>         <a class="code" href="classbdm_1_1KalmanCh.html#5c50fb48d2c7fb6d31e2061f32ecc230" title="Default constructor.">KalmanCh</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx0, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ):<a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;<a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&gt;(rvx0,rvy0,rvu0),<a class="code" href="classbdm_1_1KalmanCh.html#48611c8582706cfa62e832be0972e75d" title="pre array (triangular matrix)">preA</a>(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>+<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>),<a class="code" href="classbdm_1_1KalmanCh.html#bcbd68f51d4b57246e7784ca5900171f" title="post array (triangular matrix)">postA</a>(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>){}; 
     101<a name="l00144"></a>00144         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1KalmanCh.html#ab3a87ba1831e53f193a9dfbaf56a879" title="Set parameters with check of relevance.">set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0,<span class="keyword">const</span> mat &amp;B0,<span class="keyword">const</span> mat &amp;C0,<span class="keyword">const</span> mat &amp;D0,<span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;R0,<span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;Q0 ); 
     102<a name="l00145"></a><a class="code" href="classbdm_1_1KalmanCh.html#f559387dd38bd6002be490cc62987290">00145</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1KalmanCh.html#f559387dd38bd6002be490cc62987290" title="Set estimate values, used e.g. in initialization.">set_est</a> ( <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;P0 ) { 
     103<a name="l00146"></a>00146                 <a class="code" href="classbdm_1_1Kalman.html#383f329ff18bbe219254c8b3b916f40d" title="posterior density on $x_t$">est</a>.<a class="code" href="classbdm_1_1enorm.html#b8322f2c11560871dd922c660f4771bb" title="Set mean value mu and covariance R.">set_parameters</a> ( mu0,P0 ); 
    104104<a name="l00147"></a>00147         }; 
    105105<a name="l00148"></a>00148          
    106106<a name="l00149"></a>00149          
    107 <a name="l00163"></a>00163         <span class="keywordtype">void</span> <a class="code" href="classKalmanCh.html#cca758192846940409822b9bd778d4e1" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
     107<a name="l00163"></a>00163         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1KalmanCh.html#b41fe5540548100b08e1684c3be767b6" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
    108108<a name="l00164"></a>00164 }; 
    109109<a name="l00165"></a>00165  
    110 <a name="l00171"></a><a class="code" href="classEKFfull.html">00171</a> <span class="keyword">class </span><a class="code" href="classEKFfull.html" title="Extended Kalman Filter in full matrices.">EKFfull</a> : <span class="keyword">public</span> <a class="code" href="classKalmanFull.html" title="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</a>, <span class="keyword">public</span> <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { 
     110<a name="l00171"></a><a class="code" href="classbdm_1_1EKFfull.html">00171</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1EKFfull.html" title="Extended Kalman Filter in full matrices.">EKFfull</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1KalmanFull.html" title="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</a>, <span class="keyword">public</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { 
    111111<a name="l00172"></a>00172  
    112 <a name="l00174"></a>00174         <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu; 
    113 <a name="l00176"></a>00176         <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu; 
     112<a name="l00174"></a>00174         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu; 
     113<a name="l00176"></a>00176         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu; 
    114114<a name="l00177"></a>00177          
    115 <a name="l00178"></a>00178         <a class="code" href="classenorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;fsqmat&gt;</a> E;  
     115<a name="l00178"></a>00178         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;fsqmat&gt;</a> E;  
    116116<a name="l00179"></a>00179 <span class="keyword">public</span>: 
    117 <a name="l00181"></a>00181         <a class="code" href="classEKFfull.html#67ac4de96fd025197da767fe0472c7f7" title="Default constructor.">EKFfull</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvy, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvu ); 
    118 <a name="l00183"></a>00183         <span class="keywordtype">void</span> <a class="code" href="classEKFfull.html#fc753106e0d4cf68e4f2160fd54458c0" title="Set nonlinear functions for mean values and covariance matrices.">set_parameters</a> ( <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu, <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu, <span class="keyword">const</span> mat Q0, <span class="keyword">const</span> mat R0 ); 
    119 <a name="l00185"></a>00185         <span class="keywordtype">void</span> <a class="code" href="classEKFfull.html#8ca46f177e395fa714bbd8bd29ea43e0" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
    120 <a name="l00187"></a><a class="code" href="classEKFfull.html#7bb76ea74c144ea0b36db99f94750b7b">00187</a>         <span class="keywordtype">void</span> <a class="code" href="classEKFfull.html#7bb76ea74c144ea0b36db99f94750b7b" title="set estimates">set_est</a> (vec mu0, mat P0){<a class="code" href="classKalmanFull.html#fb5aec635e2720cc5ac31bc01c18a68a" title="Mean value of the posterior density.">mu</a>=mu0;<a class="code" href="classKalmanFull.html#b75dc059e84fa8ffc076203b30f926cc" title="Variance of the posterior density.">P</a>=P0;}; 
    121 <a name="l00189"></a><a class="code" href="classEKFfull.html#170a748ad944bdebb0b3073463876abe">00189</a>         <span class="keyword">const</span> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>&amp; <a class="code" href="classEKFfull.html#170a748ad944bdebb0b3073463876abe" title="dummy!">_epdf</a>()<span class="keyword">const</span>{<span class="keywordflow">return</span> E;}; 
    122 <a name="l00190"></a><a class="code" href="classEKFfull.html#820987401e922a03c7d36013e42d8c48">00190</a>         <span class="keyword">const</span> <a class="code" href="classenorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;fsqmat&gt;</a>* <a class="code" href="classEKFfull.html#820987401e922a03c7d36013e42d8c48" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_e</a>()<span class="keyword">const</span>{<span class="keywordflow">return</span> &amp;E;}; 
    123 <a name="l00191"></a>00191         <span class="keyword">const</span> mat _R(){<span class="keywordflow">return</span> <a class="code" href="classKalmanFull.html#b75dc059e84fa8ffc076203b30f926cc" title="Variance of the posterior density.">P</a>;} 
     117<a name="l00181"></a>00181         <a class="code" href="classbdm_1_1EKFfull.html#38c0465c9edac6cedfe611373b0cce01" title="Default constructor.">EKFfull</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvy, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvu ); 
     118<a name="l00183"></a>00183         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKFfull.html#78748da361ba61fef162b0d8956d1743" title="Set nonlinear functions for mean values and covariance matrices.">set_parameters</a> ( <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu, <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu, <span class="keyword">const</span> mat Q0, <span class="keyword">const</span> mat R0 ); 
     119<a name="l00185"></a>00185         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKFfull.html#f149ae8e9ce14d9931a7bb2850736699" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
     120<a name="l00187"></a><a class="code" href="classbdm_1_1EKFfull.html#7562b3d3c17241dab3baf70258742eb2">00187</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKFfull.html#7562b3d3c17241dab3baf70258742eb2" title="set estimates">set_est</a> (vec mu0, mat P0){<a class="code" href="classbdm_1_1KalmanFull.html#2defb75e58892615c5f95fd844f3a666" title="Mean value of the posterior density.">mu</a>=mu0;<a class="code" href="classbdm_1_1KalmanFull.html#acacd228e100c3e937de575ad2d7cd9c" title="Variance of the posterior density.">P</a>=P0;}; 
     121<a name="l00189"></a><a class="code" href="classbdm_1_1EKFfull.html#6ccc4fa7da522d1c2257156f72291a8a">00189</a>         <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>&amp; <a class="code" href="classbdm_1_1EKFfull.html#6ccc4fa7da522d1c2257156f72291a8a" title="dummy!">_epdf</a>()<span class="keyword">const</span>{<span class="keywordflow">return</span> E;}; 
     122<a name="l00190"></a><a class="code" href="classbdm_1_1EKFfull.html#3d0e427d4d2fb7ac20358ce629f5d510">00190</a>         <span class="keyword">const</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;fsqmat&gt;</a>* <a class="code" href="classbdm_1_1EKFfull.html#3d0e427d4d2fb7ac20358ce629f5d510" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_e</a>()<span class="keyword">const</span>{<span class="keywordflow">return</span> &amp;E;}; 
     123<a name="l00191"></a>00191         <span class="keyword">const</span> mat _R(){<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1KalmanFull.html#acacd228e100c3e937de575ad2d7cd9c" title="Variance of the posterior density.">P</a>;} 
    124124<a name="l00192"></a>00192 }; 
    125125<a name="l00193"></a>00193  
    126126<a name="l00199"></a>00199 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    127 <a name="l00200"></a><a class="code" href="classEKF.html">00200</a> <span class="keyword">class </span><a class="code" href="classEKF.html" title="Extended Kalman Filter.">EKF</a> : <span class="keyword">public</span> <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;fsqmat&gt; { 
    128 <a name="l00202"></a>00202         <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu; 
    129 <a name="l00204"></a>00204         <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu; 
     127<a name="l00200"></a><a class="code" href="classbdm_1_1EKF.html">00200</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1EKF.html" title="Extended Kalman Filter.">EKF</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;fsqmat&gt; { 
     128<a name="l00202"></a>00202         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu; 
     129<a name="l00204"></a>00204         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu; 
    130130<a name="l00205"></a>00205 <span class="keyword">public</span>: 
    131 <a name="l00207"></a>00207         <a class="code" href="classEKF.html#ea4f3254cacf0a92d2a820b1201d049e" title="Default constructor.">EKF</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498" title="Indetifier of exogeneous rv.">rvu</a> ); 
    132 <a name="l00209"></a>00209         <span class="keywordtype">void</span> <a class="code" href="classEKF.html#28d058ae4d24d992d2f055419a06ee66" title="Set nonlinear functions for mean values and covariance matrices.">set_parameters</a> ( <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu, <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu, <span class="keyword">const</span> sq_T Q0, <span class="keyword">const</span> sq_T R0 ); 
    133 <a name="l00211"></a>00211         <span class="keywordtype">void</span> <a class="code" href="classEKF.html#c79c62c9b3e0b56b3aaa1b6f1d9a7af7" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
     131<a name="l00207"></a>00207         <a class="code" href="classbdm_1_1EKF.html#d087a8bb408d26ac4f5c542746b81059" title="Default constructor.">EKF</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#3fe475a1e920b20b63bb342c0e1571f7" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#149e27424fd1a7cc1c998ea088618a94" title="Indetifier of exogeneous rv.">rvu</a> ); 
     132<a name="l00209"></a>00209         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKF.html#00fec1a0a6a467eb83fb36c65eba7bcb" title="Set nonlinear functions for mean values and covariance matrices.">set_parameters</a> ( <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu, <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu, <span class="keyword">const</span> sq_T Q0, <span class="keyword">const</span> sq_T R0 ); 
     133<a name="l00211"></a>00211         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKF.html#3fb182ecc29b10ca1163cecbf3bcccfa" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
    134134<a name="l00212"></a>00212 }; 
    135135<a name="l00213"></a>00213  
    136 <a name="l00220"></a><a class="code" href="classEKFCh.html">00220</a> <span class="keyword">class </span><a class="code" href="classEKFCh.html" title="Extended Kalman Filter in Square root.">EKFCh</a> : <span class="keyword">public</span> <a class="code" href="classKalmanCh.html" title="Kalman filter in square root form.">KalmanCh</a> { 
     136<a name="l00220"></a><a class="code" href="classbdm_1_1EKFCh.html">00220</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1EKFCh.html" title="Extended Kalman Filter in Square root.">EKFCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1KalmanCh.html" title="Kalman filter in square root form.">KalmanCh</a> { 
    137137<a name="l00221"></a>00221         <span class="keyword">protected</span>: 
    138 <a name="l00223"></a><a class="code" href="classEKFCh.html#f4d595c2a674f8c6831eb1909bf21757">00223</a>         <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classEKFCh.html#f4d595c2a674f8c6831eb1909bf21757" title="Internal Model f(x,u).">pfxu</a>; 
    139 <a name="l00225"></a><a class="code" href="classEKFCh.html#02503fee942fb63bfbe27354cdf8e734">00225</a>         <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classEKFCh.html#02503fee942fb63bfbe27354cdf8e734" title="Observation Model h(x,u).">phxu</a>; 
     138<a name="l00223"></a><a class="code" href="classbdm_1_1EKFCh.html#e1e895f994398a55bc425551fc275ba3">00223</a>         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classbdm_1_1EKFCh.html#e1e895f994398a55bc425551fc275ba3" title="Internal Model f(x,u).">pfxu</a>; 
     139<a name="l00225"></a><a class="code" href="classbdm_1_1EKFCh.html#6b34c69641826322467b704e8252f317">00225</a>         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classbdm_1_1EKFCh.html#6b34c69641826322467b704e8252f317" title="Observation Model h(x,u).">phxu</a>; 
    140140<a name="l00226"></a>00226 <span class="keyword">public</span>: 
    141 <a name="l00228"></a>00228         <a class="code" href="classEKFCh.html#e9e39a9204db3dda88d06e47c1e19064" title="Default constructor.">EKFCh</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498" title="Indetifier of exogeneous rv.">rvu</a> ); 
    142 <a name="l00230"></a>00230         <span class="keywordtype">void</span> <a class="code" href="classEKFCh.html#0216bed270df59fe65d0d62d41f8257c" title="Set nonlinear functions for mean values and covariance matrices.">set_parameters</a> ( <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classEKFCh.html#f4d595c2a674f8c6831eb1909bf21757" title="Internal Model f(x,u).">pfxu</a>, <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classEKFCh.html#02503fee942fb63bfbe27354cdf8e734" title="Observation Model h(x,u).">phxu</a>, <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> Q0, <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> R0 ); 
    143 <a name="l00232"></a>00232         <span class="keywordtype">void</span> <a class="code" href="classEKFCh.html#96f6edda324a0b7ef8b4e86cc7af60c1" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
     141<a name="l00228"></a>00228         <a class="code" href="classbdm_1_1EKFCh.html#7be4021e63a87dc52f7651e52ba05565" title="Default constructor.">EKFCh</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#3fe475a1e920b20b63bb342c0e1571f7" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#149e27424fd1a7cc1c998ea088618a94" title="Indetifier of exogeneous rv.">rvu</a> ); 
     142<a name="l00230"></a>00230         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKFCh.html#50f9fbffad721f35e5ccb75d0f6b842a" title="Set nonlinear functions for mean values and covariance matrices.">set_parameters</a> ( <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classbdm_1_1EKFCh.html#e1e895f994398a55bc425551fc275ba3" title="Internal Model f(x,u).">pfxu</a>, <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* <a class="code" href="classbdm_1_1EKFCh.html#6b34c69641826322467b704e8252f317" title="Observation Model h(x,u).">phxu</a>, <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> Q0, <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> R0 ); 
     143<a name="l00232"></a>00232         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKFCh.html#4c8609c37290b158f88a31dae4047225" title="Here dt = [yt;ut] of appropriate dimensions.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ); 
    144144<a name="l00233"></a>00233 }; 
    145145<a name="l00234"></a>00234  
    146 <a name="l00239"></a><a class="code" href="classKFcondQR.html">00239</a> <span class="keyword">class </span><a class="code" href="classKFcondQR.html" title="Kalman Filter with conditional diagonal matrices R and Q.">KFcondQR</a> : <span class="keyword">public</span> <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;ldmat&gt;, <span class="keyword">public</span> <a class="code" href="classBMcond.html" title="Conditional Bayesian Filter.">BMcond</a> { 
     146<a name="l00239"></a><a class="code" href="classbdm_1_1KFcondQR.html">00239</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1KFcondQR.html" title="Kalman Filter with conditional diagonal matrices R and Q.">KFcondQR</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;ldmat&gt;, <span class="keyword">public</span> <a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> { 
    147147<a name="l00240"></a>00240 <span class="comment">//protected:</span> 
    148148<a name="l00241"></a>00241 <span class="keyword">public</span>: 
    149 <a name="l00243"></a><a class="code" href="classKFcondQR.html#3f3968f92c7bbe4b0902d5e14ecc1cb4">00243</a>         <a class="code" href="classKFcondQR.html#3f3968f92c7bbe4b0902d5e14ecc1cb4" title="Default constructor.">KFcondQR</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498" title="Indetifier of exogeneous rv.">rvu</a>, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvRQ ) : <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;<a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&gt; ( rvx, rvy,rvu ),<a class="code" href="classBMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( rvRQ ) {}; 
     149<a name="l00243"></a><a class="code" href="classbdm_1_1KFcondQR.html#50e138b0be3b5c443ed02fb74c6c4fe8">00243</a>         <a class="code" href="classbdm_1_1KFcondQR.html#50e138b0be3b5c443ed02fb74c6c4fe8" title="Default constructor.">KFcondQR</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#3fe475a1e920b20b63bb342c0e1571f7" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#149e27424fd1a7cc1c998ea088618a94" title="Indetifier of exogeneous rv.">rvu</a>, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvRQ ) : <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;<a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&gt; ( rvx, rvy,rvu ),<a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( rvRQ ) {}; 
    150150<a name="l00244"></a>00244  
    151 <a name="l00245"></a>00245         <span class="keywordtype">void</span> <a class="code" href="classKFcondQR.html#c9ecf292a85327aa6309c9fd70ceb606" title="Substitute val for rvc.">condition</a> ( <span class="keyword">const</span> vec &amp;RQ ); 
     151<a name="l00245"></a>00245         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1KFcondQR.html#0288d47032757774a525f196ac3da21d" title="Substitute val for rvc.">condition</a> ( <span class="keyword">const</span> vec &amp;RQ ); 
    152152<a name="l00246"></a>00246 }; 
    153153<a name="l00247"></a>00247  
    154 <a name="l00252"></a><a class="code" href="classKFcondR.html">00252</a> <span class="keyword">class </span><a class="code" href="classKFcondR.html" title="Kalman Filter with conditional diagonal matrices R and Q.">KFcondR</a> : <span class="keyword">public</span> <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;ldmat&gt;, <span class="keyword">public</span> <a class="code" href="classBMcond.html" title="Conditional Bayesian Filter.">BMcond</a> { 
     154<a name="l00252"></a><a class="code" href="classbdm_1_1KFcondR.html">00252</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1KFcondR.html" title="Kalman Filter with conditional diagonal matrices R and Q.">KFcondR</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;ldmat&gt;, <span class="keyword">public</span> <a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> { 
    155155<a name="l00253"></a>00253 <span class="comment">//protected:</span> 
    156156<a name="l00254"></a>00254 <span class="keyword">public</span>: 
    157 <a name="l00256"></a><a class="code" href="classKFcondR.html#d2acbb8e66c7ee592b1a9da5b429a69e">00256</a>         <a class="code" href="classKFcondR.html#d2acbb8e66c7ee592b1a9da5b429a69e" title="Default constructor.">KFcondR</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498" title="Indetifier of exogeneous rv.">rvu</a>, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvR ) : <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;<a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&gt; ( rvx, rvy,rvu ),<a class="code" href="classBMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( rvR ) {}; 
     157<a name="l00256"></a><a class="code" href="classbdm_1_1KFcondR.html#51acbd4a89f63708f3c47601083906c1">00256</a>         <a class="code" href="classbdm_1_1KFcondR.html#51acbd4a89f63708f3c47601083906c1" title="Default constructor.">KFcondR</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#3fe475a1e920b20b63bb342c0e1571f7" title="Indetifier of output rv.">rvy</a>, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> <a class="code" href="classbdm_1_1Kalman.html#149e27424fd1a7cc1c998ea088618a94" title="Indetifier of exogeneous rv.">rvu</a>, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvR ) : <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;<a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&gt; ( rvx, rvy,rvu ),<a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( rvR ) {}; 
    158158<a name="l00257"></a>00257  
    159 <a name="l00258"></a>00258         <span class="keywordtype">void</span> <a class="code" href="classKFcondR.html#8c0721e47879bb8840d829db7a174a7f" title="Substitute val for rvc.">condition</a> ( <span class="keyword">const</span> vec &amp;<a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a> ); 
     159<a name="l00258"></a>00258         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1KFcondR.html#6086f02541f8f3bc8351990abf5cd538" title="Substitute val for rvc.">condition</a> ( <span class="keyword">const</span> vec &amp;<a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a> ); 
    160160<a name="l00259"></a>00259 }; 
    161161<a name="l00260"></a>00260  
    162162<a name="l00262"></a>00262  
    163163<a name="l00263"></a>00263 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    164 <a name="l00264"></a><a class="code" href="classKalman.html#ce38e31810aea4db45a83ad05eaba009">00264</a> <a class="code" href="classKalman.html#3d56b0a97b8c1e25fdd3b10eef3c2ad3" title="Default constructor.">Kalman&lt;sq_T&gt;::Kalman</a> ( <span class="keyword">const</span> <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;</a> &amp;K0 ) : <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( K0.rv ),rvy ( K0.rvy ),rvu ( K0.rvu ), 
     164<a name="l00264"></a><a class="code" href="classbdm_1_1Kalman.html#8b22c45cffa949d70b8e5ac92ed5ce25">00264</a> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;::Kalman</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;</a> &amp;K0 ) : <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( K0.rv ),rvy ( K0.rvy ),rvu ( K0.rvu ), 
    165165<a name="l00265"></a>00265                 dimx ( rv.count() ), dimy ( rvy.count() ),dimu ( rvu.count() ), 
    166166<a name="l00266"></a>00266                 A ( dimx,dimx ), B ( dimx,dimu ), C ( dimy,dimx ), D ( dimy,dimu ), 
     
    168168<a name="l00268"></a>00268                 est ( rv ), fy ( rvy ), _yp(fy._mu()),_Ry(fy._R()), _mu(est._mu()), _P(est._R()) { 
    169169<a name="l00269"></a>00269  
    170 <a name="l00270"></a>00270         this-&gt;<a class="code" href="classKalman.html#239b28a0380946f5749b2f8d2807f93a" title="Set parameters with check of relevance.">set_parameters</a> ( K0.<a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a>, K0.<a class="code" href="classKalman.html#dc87704284a6c0bca13bf51f4345a50a" title="Matrix B.">B</a>, K0.<a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>, K0.<a class="code" href="classKalman.html#d69f774ba3335c970c1c5b1d182f4dd1" title="Matrix D.">D</a>, K0.<a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a>, K0.<a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9" title="Matrix Q in square-root form.">Q</a> ); 
     170<a name="l00270"></a>00270         this-&gt;<a class="code" href="classbdm_1_1Kalman.html#94eb8cc31731210089db0ba4e1a08a6c" title="Set parameters with check of relevance.">set_parameters</a> ( K0.<a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a>, K0.<a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a>, K0.<a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>, K0.<a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a>, K0.<a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a>, K0.<a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a> ); 
    171171<a name="l00271"></a>00271  
    172172<a name="l00272"></a>00272 <span class="comment">// copy values in pointers</span> 
    173 <a name="l00273"></a>00273         <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a> = K0.<a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>; 
    174 <a name="l00274"></a>00274         <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a> = K0.<a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>; 
    175 <a name="l00275"></a>00275         <a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a> = K0.<a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a>; 
    176 <a name="l00276"></a>00276         <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a> = K0.<a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a>; 
     173<a name="l00273"></a>00273         <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a> = K0.<a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>; 
     174<a name="l00274"></a>00274         <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a> = K0.<a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>; 
     175<a name="l00275"></a>00275         <a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1" title="cache of fy.mu">_yp</a> = K0.<a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1" title="cache of fy.mu">_yp</a>; 
     176<a name="l00276"></a>00276         <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a> = K0.<a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a>; 
    177177<a name="l00277"></a>00277  
    178178<a name="l00278"></a>00278 } 
    179179<a name="l00279"></a>00279  
    180180<a name="l00280"></a>00280 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    181 <a name="l00281"></a><a class="code" href="classKalman.html#3d56b0a97b8c1e25fdd3b10eef3c2ad3">00281</a> <a class="code" href="classKalman.html#3d56b0a97b8c1e25fdd3b10eef3c2ad3" title="Default constructor.">Kalman&lt;sq_T&gt;::Kalman</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ) : <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( rvx ),<a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a> ( rvy0 ),<a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498" title="Indetifier of exogeneous rv.">rvu</a> ( rvu0 ), 
    182 <a name="l00282"></a>00282                 <a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a> ( rvx.count() ), <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a> ( <a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a>.count() ),<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ( <a class="code" href="classKalman.html#44a16ffd5ac1e6e39bae34fea9e1e498" title="Indetifier of exogeneous rv.">rvu</a>.count() ), 
    183 <a name="l00283"></a>00283                 <a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a> ( <a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>,<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a> ), <a class="code" href="classKalman.html#dc87704284a6c0bca13bf51f4345a50a" title="Matrix B.">B</a> ( <a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>,<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ), <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a> ( <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>,<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a> ), <a class="code" href="classKalman.html#d69f774ba3335c970c1c5b1d182f4dd1" title="Matrix D.">D</a> ( <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>,<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ), 
    184 <a name="l00284"></a>00284                 <a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9" title="Matrix Q in square-root form.">Q</a>(<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>), <a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a> (<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>), 
    185 <a name="l00285"></a>00285                 <a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a> ( rvx ), <a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f" title="preditive density on $y_t$">fy</a> ( <a class="code" href="classKalman.html#7501230c2fafa3655887d2da23b3184c" title="Indetifier of output rv.">rvy</a> ),  <a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a>(<a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f" title="preditive density on $y_t$">fy</a>.<a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>()),<a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a>(<a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f" title="preditive density on $y_t$">fy</a>._R()),<a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>(<a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a>.<a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>()), <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>(<a class="code" href="classKalman.html#5568c74bac67ae6d3b1061dba60c9424" title="posterior density on $x_t$">est</a>._R()) { 
     181<a name="l00281"></a><a class="code" href="classbdm_1_1Kalman.html#7d8fae1d89d796e3fd40d9e088c432ab">00281</a> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;::Kalman</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ) : <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( rvx ),rvy ( rvy0 ),rvu ( rvu0 ), 
     182<a name="l00282"></a>00282                 dimx ( rvx.count() ), dimy ( rvy.count() ),dimu ( rvu.count() ), 
     183<a name="l00283"></a>00283                 A ( dimx,dimx ), B ( dimx,dimu ), C ( dimy,dimx ), D ( dimy,dimu ), 
     184<a name="l00284"></a>00284                 Q(dimx), R (dimy), 
     185<a name="l00285"></a>00285                 est ( rvx ), fy ( rvy ),  _yp(fy._mu()),_Ry(fy._R()),_mu(est._mu()), _P(est._R()) { 
    186186<a name="l00286"></a>00286 }; 
    187187<a name="l00287"></a>00287  
    188188<a name="l00288"></a>00288 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    189 <a name="l00289"></a><a class="code" href="classKalman.html#239b28a0380946f5749b2f8d2807f93a">00289</a> <span class="keywordtype">void</span> <a class="code" href="classKalman.html#239b28a0380946f5749b2f8d2807f93a" title="Set parameters with check of relevance.">Kalman&lt;sq_T&gt;::set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0,<span class="keyword">const</span>  mat &amp;B0, <span class="keyword">const</span> mat &amp;C0, <span class="keyword">const</span> mat &amp;D0, <span class="keyword">const</span> sq_T &amp;R0, <span class="keyword">const</span> sq_T &amp;Q0 ) { 
    190 <a name="l00290"></a>00290         it_assert_debug ( A0.cols() ==<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>, <span class="stringliteral">"Kalman: A is not square"</span> ); 
    191 <a name="l00291"></a>00291         it_assert_debug ( B0.rows() ==<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>, <span class="stringliteral">"Kalman: B is not compatible"</span> ); 
    192 <a name="l00292"></a>00292         it_assert_debug ( C0.cols() ==<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a>, <span class="stringliteral">"Kalman: C is not square"</span> ); 
    193 <a name="l00293"></a>00293         it_assert_debug ( ( D0.rows() ==<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a> ) || ( D0.cols() ==<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ), <span class="stringliteral">"Kalman: D is not compatible"</span> ); 
    194 <a name="l00294"></a>00294         it_assert_debug ( ( R0.cols() ==<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a> ) || ( R0.rows() ==<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a> ), <span class="stringliteral">"Kalman: R is not compatible"</span> ); 
    195 <a name="l00295"></a>00295         it_assert_debug ( ( Q0.cols() ==<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a> ) || ( Q0.rows() ==<a class="code" href="classKalman.html#39c8c403b46fa3b8c7da77cb2e3729eb" title="cache of rv.count()">dimx</a> ), <span class="stringliteral">"Kalman: Q is not compatible"</span> ); 
     189<a name="l00289"></a><a class="code" href="classbdm_1_1Kalman.html#94eb8cc31731210089db0ba4e1a08a6c">00289</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;::set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0,<span class="keyword">const</span>  mat &amp;B0, <span class="keyword">const</span> mat &amp;C0, <span class="keyword">const</span> mat &amp;D0, <span class="keyword">const</span> sq_T &amp;R0, <span class="keyword">const</span> sq_T &amp;Q0 ) { 
     190<a name="l00290"></a>00290         it_assert_debug ( A0.cols() ==<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>, <span class="stringliteral">"Kalman: A is not square"</span> ); 
     191<a name="l00291"></a>00291         it_assert_debug ( B0.rows() ==<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>, <span class="stringliteral">"Kalman: B is not compatible"</span> ); 
     192<a name="l00292"></a>00292         it_assert_debug ( C0.cols() ==<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a>, <span class="stringliteral">"Kalman: C is not square"</span> ); 
     193<a name="l00293"></a>00293         it_assert_debug ( ( D0.rows() ==<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a> ) || ( D0.cols() ==<a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a> ), <span class="stringliteral">"Kalman: D is not compatible"</span> ); 
     194<a name="l00294"></a>00294         it_assert_debug ( ( R0.cols() ==<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a> ) || ( R0.rows() ==<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a> ), <span class="stringliteral">"Kalman: R is not compatible"</span> ); 
     195<a name="l00295"></a>00295         it_assert_debug ( ( Q0.cols() ==<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a> ) || ( Q0.rows() ==<a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a> ), <span class="stringliteral">"Kalman: Q is not compatible"</span> ); 
    196196<a name="l00296"></a>00296  
    197 <a name="l00297"></a>00297         <a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a> = A0; 
    198 <a name="l00298"></a>00298         <a class="code" href="classKalman.html#dc87704284a6c0bca13bf51f4345a50a" title="Matrix B.">B</a> = B0; 
    199 <a name="l00299"></a>00299         <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a> = C0; 
    200 <a name="l00300"></a>00300         <a class="code" href="classKalman.html#d69f774ba3335c970c1c5b1d182f4dd1" title="Matrix D.">D</a> = D0; 
    201 <a name="l00301"></a>00301         <a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a> = R0; 
    202 <a name="l00302"></a>00302         <a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9" title="Matrix Q in square-root form.">Q</a> = Q0; 
     197<a name="l00297"></a>00297         <a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a> = A0; 
     198<a name="l00298"></a>00298         <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a> = B0; 
     199<a name="l00299"></a>00299         <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a> = C0; 
     200<a name="l00300"></a>00300         <a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a> = D0; 
     201<a name="l00301"></a>00301         <a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a> = R0; 
     202<a name="l00302"></a>00302         <a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a> = Q0; 
    203203<a name="l00303"></a>00303 } 
    204204<a name="l00304"></a>00304  
    205205<a name="l00305"></a>00305 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    206 <a name="l00306"></a><a class="code" href="classKalman.html#7750ffd73f261828a32c18aaeb65c75c">00306</a> <span class="keywordtype">void</span> <a class="code" href="classKalman.html#7750ffd73f261828a32c18aaeb65c75c" title="Here dt = [yt;ut] of appropriate dimensions.">Kalman&lt;sq_T&gt;::bayes</a> ( <span class="keyword">const</span> vec &amp;dt ) { 
    207 <a name="l00307"></a>00307         it_assert_debug ( dt.length() == ( <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ),<span class="stringliteral">"KalmanFull::bayes wrong size of dt"</span> ); 
     206<a name="l00306"></a><a class="code" href="classbdm_1_1Kalman.html#4a39330c14eff8d13179e868a1d1aa8c">00306</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;::bayes</a> ( <span class="keyword">const</span> vec &amp;dt ) { 
     207<a name="l00307"></a>00307         it_assert_debug ( dt.length() == ( <a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a> ),<span class="stringliteral">"KalmanFull::bayes wrong size of dt"</span> ); 
    208208<a name="l00308"></a>00308  
    209 <a name="l00309"></a>00309         sq_T iRy(<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>); 
    210 <a name="l00310"></a>00310         vec u = dt.get ( <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>,<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a>-1 ); 
    211 <a name="l00311"></a>00311         vec y = dt.get ( 0,<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>-1 ); 
     209<a name="l00309"></a>00309         sq_T iRy(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>); 
     210<a name="l00310"></a>00310         vec u = dt.get ( <a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a>-1 ); 
     211<a name="l00311"></a>00311         vec y = dt.get ( 0,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>-1 ); 
    212212<a name="l00312"></a>00312         <span class="comment">//Time update</span> 
    213 <a name="l00313"></a>00313         <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a> = <a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a>* <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a> + <a class="code" href="classKalman.html#dc87704284a6c0bca13bf51f4345a50a" title="Matrix B.">B</a>*u; 
     213<a name="l00313"></a>00313         <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a> = <a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a>* <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a> + <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a>*u; 
    214214<a name="l00314"></a>00314         <span class="comment">//P  = A*P*A.transpose() + Q; in sq_T</span> 
    215 <a name="l00315"></a>00315         <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>.mult_sym ( <a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a> ); 
    216 <a name="l00316"></a>00316         <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>  +=<a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9" title="Matrix Q in square-root form.">Q</a>; 
     215<a name="l00315"></a>00315         <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.mult_sym ( <a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a> ); 
     216<a name="l00316"></a>00316         <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>  +=<a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a>; 
    217217<a name="l00317"></a>00317  
    218218<a name="l00318"></a>00318         <span class="comment">//Data update</span> 
    219219<a name="l00319"></a>00319         <span class="comment">//_Ry = C*P*C.transpose() + R; in sq_T</span> 
    220 <a name="l00320"></a>00320         <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>.mult_sym ( <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>, <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a> ); 
    221 <a name="l00321"></a>00321         <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a>  +=<a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a>; 
     220<a name="l00320"></a>00320         <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.mult_sym ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>, <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a> ); 
     221<a name="l00321"></a>00321         <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a>  +=<a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a>; 
    222222<a name="l00322"></a>00322  
    223 <a name="l00323"></a>00323         mat Pfull = <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>.to_mat(); 
     223<a name="l00323"></a>00323         mat Pfull = <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.to_mat(); 
    224224<a name="l00324"></a>00324  
    225 <a name="l00325"></a>00325         <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a>.inv ( iRy ); <span class="comment">// result is in _iRy;</span> 
    226 <a name="l00326"></a>00326         <a class="code" href="classKalman.html#d422f51467c7a06174af2476d2826132" title="placeholder for Kalman gain">_K</a> = Pfull*<a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>.transpose() * ( iRy.to_mat() ); 
     225<a name="l00325"></a>00325         <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a>.inv ( iRy ); <span class="comment">// result is in _iRy;</span> 
     226<a name="l00326"></a>00326         <a class="code" href="classbdm_1_1Kalman.html#bd69dfb802465f22dd84d73a180d5c92" title="placeholder for Kalman gain">_K</a> = Pfull*<a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>.transpose() * ( iRy.to_mat() ); 
    227227<a name="l00327"></a>00327  
    228228<a name="l00328"></a>00328         sq_T pom ( ( <span class="keywordtype">int</span> ) Pfull.rows() ); 
    229 <a name="l00329"></a>00329         iRy.mult_sym_t ( <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>*Pfull,pom ); 
    230 <a name="l00330"></a>00330         (<a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a> ) -= pom; <span class="comment">// P = P -PC'iRy*CP;</span> 
    231 <a name="l00331"></a>00331         (<a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a> ) = <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>* <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>  +<a class="code" href="classKalman.html#d69f774ba3335c970c1c5b1d182f4dd1" title="Matrix D.">D</a>*u; <span class="comment">//y prediction</span> 
    232 <a name="l00332"></a>00332         (<a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a> ) += <a class="code" href="classKalman.html#d422f51467c7a06174af2476d2826132" title="placeholder for Kalman gain">_K</a>* ( y- <a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a>  ); 
     229<a name="l00329"></a>00329         iRy.mult_sym_t ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>*Pfull,pom ); 
     230<a name="l00330"></a>00330         (<a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a> ) -= pom; <span class="comment">// P = P -PC'iRy*CP;</span> 
     231<a name="l00331"></a>00331         (<a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1" title="cache of fy.mu">_yp</a> ) = <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>* <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>  +<a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a>*u; <span class="comment">//y prediction</span> 
     232<a name="l00332"></a>00332         (<a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a> ) += <a class="code" href="classbdm_1_1Kalman.html#bd69dfb802465f22dd84d73a180d5c92" title="placeholder for Kalman gain">_K</a>* ( y- <a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1" title="cache of fy.mu">_yp</a>  ); 
    233233<a name="l00333"></a>00333  
    234234<a name="l00334"></a>00334  
    235 <a name="l00335"></a>00335         <span class="keywordflow">if</span> ( <a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>==<span class="keyword">true</span> ) { <span class="comment">//likelihood of observation y</span> 
    236 <a name="l00336"></a>00336                 <a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a>=<a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f" title="preditive density on $y_t$">fy</a>.evallog ( y ); 
     235<a name="l00335"></a>00335         <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>==<span class="keyword">true</span> ) { <span class="comment">//likelihood of observation y</span> 
     236<a name="l00336"></a>00336                 <a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a>=<a class="code" href="classbdm_1_1Kalman.html#ba555c394c429f6831c9bbabfa2c944c" title="preditive density on $y_t$">fy</a>.evallog ( y ); 
    237237<a name="l00337"></a>00337         } 
    238238<a name="l00338"></a>00338  
     
    246246<a name="l00346"></a>00346  
    247247<a name="l00347"></a>00347 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    248 <a name="l00348"></a><a class="code" href="classEKF.html#ea4f3254cacf0a92d2a820b1201d049e">00348</a> <a class="code" href="classEKF.html#ea4f3254cacf0a92d2a820b1201d049e" title="Default constructor.">EKF&lt;sq_T&gt;::EKF</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvx0, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ) : <a class="code" href="classKalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;sq_T&gt; ( rvx0,rvy0,rvu0 ) {} 
     248<a name="l00348"></a><a class="code" href="classbdm_1_1EKF.html#d087a8bb408d26ac4f5c542746b81059">00348</a> <a class="code" href="classbdm_1_1EKF.html" title="Extended Kalman Filter.">EKF&lt;sq_T&gt;::EKF</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx0, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvy0, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ) : <a class="code" href="classbdm_1_1Kalman.html" title="Kalman filter with covariance matrices in square root form.">Kalman</a>&lt;sq_T&gt; ( rvx0,rvy0,rvu0 ) {} 
    249249<a name="l00349"></a>00349  
    250250<a name="l00350"></a>00350 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    251 <a name="l00351"></a><a class="code" href="classEKF.html#28d058ae4d24d992d2f055419a06ee66">00351</a> <span class="keywordtype">void</span> <a class="code" href="classEKF.html#28d058ae4d24d992d2f055419a06ee66" title="Set nonlinear functions for mean values and covariance matrices.">EKF&lt;sq_T&gt;::set_parameters</a> ( <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu0,  <a class="code" href="classdiffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu0,<span class="keyword">const</span> sq_T Q0,<span class="keyword">const</span> sq_T R0 ) { 
     251<a name="l00351"></a><a class="code" href="classbdm_1_1EKF.html#00fec1a0a6a467eb83fb36c65eba7bcb">00351</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKF.html" title="Extended Kalman Filter.">EKF&lt;sq_T&gt;::set_parameters</a> ( <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu0,  <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu0,<span class="keyword">const</span> sq_T Q0,<span class="keyword">const</span> sq_T R0 ) { 
    252252<a name="l00352"></a>00352         pfxu = pfxu0; 
    253253<a name="l00353"></a>00353         phxu = phxu0; 
    254254<a name="l00354"></a>00354  
    255255<a name="l00355"></a>00355         <span class="comment">//initialize matrices A C, later, these will be only updated!</span> 
    256 <a name="l00356"></a>00356         pfxu-&gt;<a class="code" href="classdiffbifn.html#6d217a02d4fa13931258d4bebdd0feb4" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>,zeros ( <a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ),<a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a>,<span class="keyword">true</span> ); 
     256<a name="l00356"></a>00356         pfxu-&gt;<a class="code" href="classbdm_1_1diffbifn.html#651184f808a35f236dbfea21aca1b6ac" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>,zeros ( <a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a> ),<a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a>,<span class="keyword">true</span> ); 
    257257<a name="l00357"></a>00357 <span class="comment">//      pfxu-&gt;dfdu_cond ( *_mu,zeros ( dimu ),B,true );</span> 
    258 <a name="l00358"></a>00358         <a class="code" href="classKalman.html#dc87704284a6c0bca13bf51f4345a50a" title="Matrix B.">B</a>.clear(); 
    259 <a name="l00359"></a>00359         phxu-&gt;<a class="code" href="classdiffbifn.html#6d217a02d4fa13931258d4bebdd0feb4" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>,zeros ( <a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ),<a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>,<span class="keyword">true</span> ); 
     258<a name="l00358"></a>00358         <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a>.clear(); 
     259<a name="l00359"></a>00359         phxu-&gt;<a class="code" href="classbdm_1_1diffbifn.html#651184f808a35f236dbfea21aca1b6ac" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>,zeros ( <a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a> ),<a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>,<span class="keyword">true</span> ); 
    260260<a name="l00360"></a>00360 <span class="comment">//      phxu-&gt;dfdu_cond ( *_mu,zeros ( dimu ),D,true );</span> 
    261 <a name="l00361"></a>00361         <a class="code" href="classKalman.html#d69f774ba3335c970c1c5b1d182f4dd1" title="Matrix D.">D</a>.clear(); 
     261<a name="l00361"></a>00361         <a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a>.clear(); 
    262262<a name="l00362"></a>00362  
    263 <a name="l00363"></a>00363         <a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a> = R0; 
    264 <a name="l00364"></a>00364         <a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9" title="Matrix Q in square-root form.">Q</a> = Q0; 
     263<a name="l00363"></a>00363         <a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a> = R0; 
     264<a name="l00364"></a>00364         <a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a> = Q0; 
    265265<a name="l00365"></a>00365 } 
    266266<a name="l00366"></a>00366  
    267267<a name="l00367"></a>00367 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    268 <a name="l00368"></a><a class="code" href="classEKF.html#c79c62c9b3e0b56b3aaa1b6f1d9a7af7">00368</a> <span class="keywordtype">void</span> <a class="code" href="classEKF.html#c79c62c9b3e0b56b3aaa1b6f1d9a7af7" title="Here dt = [yt;ut] of appropriate dimensions.">EKF&lt;sq_T&gt;::bayes</a> ( <span class="keyword">const</span> vec &amp;dt ) { 
    269 <a name="l00369"></a>00369         it_assert_debug ( dt.length() == ( <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a> ),<span class="stringliteral">"KalmanFull::bayes wrong size of dt"</span> ); 
     268<a name="l00368"></a><a class="code" href="classbdm_1_1EKF.html#3fb182ecc29b10ca1163cecbf3bcccfa">00368</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EKF.html" title="Extended Kalman Filter.">EKF&lt;sq_T&gt;::bayes</a> ( <span class="keyword">const</span> vec &amp;dt ) { 
     269<a name="l00369"></a>00369         it_assert_debug ( dt.length() == ( <a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a> ),<span class="stringliteral">"KalmanFull::bayes wrong size of dt"</span> ); 
    270270<a name="l00370"></a>00370  
    271 <a name="l00371"></a>00371         sq_T iRy(<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>,<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>); 
    272 <a name="l00372"></a>00372         vec u = dt.get ( <a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>,<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>+<a class="code" href="classKalman.html#b0153795a1444b6968a86409c778d9ce" title="cache of rvu.count()">dimu</a>-1 ); 
    273 <a name="l00373"></a>00373         vec y = dt.get ( 0,<a class="code" href="classKalman.html#ba17b956df1e38b31fbbc299c8213b6a" title="cache of rvy.count()">dimy</a>-1 ); 
     271<a name="l00371"></a>00371         sq_T iRy(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>); 
     272<a name="l00372"></a>00372         vec u = dt.get ( <a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>+<a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a>-1 ); 
     273<a name="l00373"></a>00373         vec y = dt.get ( 0,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>-1 ); 
    274274<a name="l00374"></a>00374         <span class="comment">//Time update</span> 
    275 <a name="l00375"></a>00375         <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a> = pfxu-&gt;<a class="code" href="classdiffbifn.html#ad7673e16aa1a046b131b24c731c4632" title="Evaluates  (VS: Do we really need common eval? ).">eval</a> ( <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>, u ); 
    276 <a name="l00376"></a>00376         pfxu-&gt;<a class="code" href="classdiffbifn.html#6d217a02d4fa13931258d4bebdd0feb4" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>,u,<a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a>,<span class="keyword">false</span> ); <span class="comment">//update A by a derivative of fx</span> 
     275<a name="l00375"></a>00375         <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a> = pfxu-&gt;<a class="code" href="classbdm_1_1diffbifn.html#188f31066bd72e1bf0ddacd1eb0e6af3" title="Evaluates  (VS: Do we really need common eval? ).">eval</a> ( <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>, u ); 
     276<a name="l00376"></a>00376         pfxu-&gt;<a class="code" href="classbdm_1_1diffbifn.html#651184f808a35f236dbfea21aca1b6ac" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>,u,<a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a>,<span class="keyword">false</span> ); <span class="comment">//update A by a derivative of fx</span> 
    277277<a name="l00377"></a>00377  
    278278<a name="l00378"></a>00378         <span class="comment">//P  = A*P*A.transpose() + Q; in sq_T</span> 
    279 <a name="l00379"></a>00379         <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>.<a class="code" href="classfsqmat.html#5530d2756b5d991de755e6121c9a452e" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <a class="code" href="classKalman.html#5e02efe86ee91e9c74b93b425fe060b9" title="Matrix A.">A</a> ); 
    280 <a name="l00380"></a>00380         <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a> +=<a class="code" href="classKalman.html#9b69015c800eb93f3ee49da23a6f55d9" title="Matrix Q in square-root form.">Q</a>; 
     279<a name="l00379"></a>00379         <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.<a class="code" href="classfsqmat.html#5530d2756b5d991de755e6121c9a452e" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a> ); 
     280<a name="l00380"></a>00380         <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a> +=<a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a>; 
    281281<a name="l00381"></a>00381  
    282282<a name="l00382"></a>00382         <span class="comment">//Data update</span> 
    283 <a name="l00383"></a>00383         phxu-&gt;<a class="code" href="classdiffbifn.html#6d217a02d4fa13931258d4bebdd0feb4" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>,u,<a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>,<span class="keyword">false</span> ); <span class="comment">//update C by a derivative hx</span> 
     283<a name="l00383"></a>00383         phxu-&gt;<a class="code" href="classbdm_1_1diffbifn.html#651184f808a35f236dbfea21aca1b6ac" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>,u,<a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>,<span class="keyword">false</span> ); <span class="comment">//update C by a derivative hx</span> 
    284284<a name="l00384"></a>00384         <span class="comment">//_Ry = C*P*C.transpose() + R; in sq_T</span> 
    285 <a name="l00385"></a>00385         <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>.<a class="code" href="classfsqmat.html#5530d2756b5d991de755e6121c9a452e" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>, <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a> ); 
    286 <a name="l00386"></a>00386         ( <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a> ) +=<a class="code" href="classKalman.html#11d171dc0e0ab111c56a70f98b97b3ec" title="Matrix R in square-root form.">R</a>; 
     285<a name="l00385"></a>00385         <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.<a class="code" href="classfsqmat.html#5530d2756b5d991de755e6121c9a452e" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>, <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a> ); 
     286<a name="l00386"></a>00386         ( <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a> ) +=<a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a>; 
    287287<a name="l00387"></a>00387  
    288 <a name="l00388"></a>00388         mat Pfull = <a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a>.<a class="code" href="classfsqmat.html#f54fc955e8e3b43d15afa92124bc24b3" title="Conversion to full matrix.">to_mat</a>(); 
     288<a name="l00388"></a>00388         mat Pfull = <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.<a class="code" href="classfsqmat.html#f54fc955e8e3b43d15afa92124bc24b3" title="Conversion to full matrix.">to_mat</a>(); 
    289289<a name="l00389"></a>00389  
    290 <a name="l00390"></a>00390         <a class="code" href="classKalman.html#45c9f928d2d62e0c884900fb3380f904" title="cache of fy.R">_Ry</a>.<a class="code" href="classfsqmat.html#9fa853e1ca28f2a1a1c43377e798ecb1" title="Matrix inversion preserving the chosen form.">inv</a> ( iRy ); <span class="comment">// result is in _iRy;</span> 
    291 <a name="l00391"></a>00391         <a class="code" href="classKalman.html#d422f51467c7a06174af2476d2826132" title="placeholder for Kalman gain">_K</a> = Pfull*<a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>.transpose() * ( iRy.to_mat() ); 
     290<a name="l00390"></a>00390         <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a>.<a class="code" href="classfsqmat.html#9fa853e1ca28f2a1a1c43377e798ecb1" title="Matrix inversion preserving the chosen form.">inv</a> ( iRy ); <span class="comment">// result is in _iRy;</span> 
     291<a name="l00391"></a>00391         <a class="code" href="classbdm_1_1Kalman.html#bd69dfb802465f22dd84d73a180d5c92" title="placeholder for Kalman gain">_K</a> = Pfull*<a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>.transpose() * ( iRy.to_mat() ); 
    292292<a name="l00392"></a>00392  
    293293<a name="l00393"></a>00393         sq_T pom ( ( <span class="keywordtype">int</span> ) Pfull.rows() ); 
    294 <a name="l00394"></a>00394         iRy.mult_sym_t ( <a class="code" href="classKalman.html#86a805cd6515872d1132ad0d6eb5dc13" title="Matrix C.">C</a>*Pfull,pom ); 
    295 <a name="l00395"></a>00395         (<a class="code" href="classKalman.html#9fb808cc94a4c2652e1fb93be9bb7dcf" title="cache of est.R">_P</a> ) -= pom; <span class="comment">// P = P -PC'iRy*CP;</span> 
    296 <a name="l00396"></a>00396         <a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a> = phxu-&gt;<a class="code" href="classdiffbifn.html#ad7673e16aa1a046b131b24c731c4632" title="Evaluates  (VS: Do we really need common eval? ).">eval</a> ( <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a>,u ); <span class="comment">//y prediction</span> 
    297 <a name="l00397"></a>00397         ( <a class="code" href="classKalman.html#fe803a81d2d847b0b1db3c6b29c18061" title="cache of est.mu">_mu</a> ) += <a class="code" href="classKalman.html#d422f51467c7a06174af2476d2826132" title="placeholder for Kalman gain">_K</a>* ( y-<a class="code" href="classKalman.html#764bbc95238eda11fc81c5ebd0b1dcfd" title="cache of fy.mu">_yp</a> ); 
     294<a name="l00394"></a>00394         iRy.mult_sym_t ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>*Pfull,pom ); 
     295<a name="l00395"></a>00395         (<a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a> ) -= pom; <span class="comment">// P = P -PC'iRy*CP;</span> 
     296<a name="l00396"></a>00396         <a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1" title="cache of fy.mu">_yp</a> = phxu-&gt;<a class="code" href="classbdm_1_1diffbifn.html#188f31066bd72e1bf0ddacd1eb0e6af3" title="Evaluates  (VS: Do we really need common eval? ).">eval</a> ( <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a>,u ); <span class="comment">//y prediction</span> 
     297<a name="l00397"></a>00397         ( <a class="code" href="classbdm_1_1Kalman.html#fa172078091e45561343fa513dd573b0" title="cache of est.mu">_mu</a> ) += <a class="code" href="classbdm_1_1Kalman.html#bd69dfb802465f22dd84d73a180d5c92" title="placeholder for Kalman gain">_K</a>* ( y-<a class="code" href="classbdm_1_1Kalman.html#c249d45258c8578b13858ad3e7b729b1" title="cache of fy.mu">_yp</a> ); 
    298298<a name="l00398"></a>00398  
    299 <a name="l00399"></a>00399         <span class="keywordflow">if</span> ( <a class="code" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>==<span class="keyword">true</span> ) {<a class="code" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979" title="Logarithm of marginalized data likelihood.">ll</a>+=<a class="code" href="classKalman.html#e580ab06483952bd03f2e651763e184f" title="preditive density on $y_t$">fy</a>.<a class="code" href="classeEF.html#357512dd565e199904d367294b7dd862" title="Evaluate normalized log-probability.">evallog</a> ( y );} 
     299<a name="l00399"></a>00399         <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a>==<span class="keyword">true</span> ) {<a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a>+=<a class="code" href="classbdm_1_1Kalman.html#ba555c394c429f6831c9bbabfa2c944c" title="preditive density on $y_t$">fy</a>.<a class="code" href="classbdm_1_1eEF.html#a36d06ecdd6f4c79dc122510eaccc692" title="Evaluate normalized log-probability.">evallog</a> ( y );} 
    300300<a name="l00400"></a>00400 }; 
    301301<a name="l00401"></a>00401  
    302302<a name="l00402"></a>00402  
    303 <a name="l00403"></a>00403 <span class="preprocessor">#endif // KF_H</span> 
    304 <a name="l00404"></a>00404 <span class="preprocessor"></span> 
    305 <a name="l00405"></a>00405  
     303<a name="l00403"></a>00403 } 
     304<a name="l00404"></a>00404 <span class="preprocessor">#endif // KF_H</span> 
     305<a name="l00405"></a>00405 <span class="preprocessor"></span> 
     306<a name="l00406"></a>00406  
    306307</pre></div></div> 
    307 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 15 10:50:25 2009 for mixpp by&nbsp; 
     308<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jan 27 16:29:52 2009 for mixpp by&nbsp; 
    308309<a href="http://www.doxygen.org/index.html"> 
    309310<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>