Index: doc/html/libKF_8h-source.html
===================================================================
--- doc/html/libKF_8h-source.html (revision 270)
+++ doc/html/libKF_8h-source.html (revision 271)
@@ -6,11 +6,51 @@
 </head><body>
 <!-- Generated by Doxygen 1.5.6 -->
+<script type="text/javascript">
+<!--
+function changeDisplayState (e){
+  var num=this.id.replace(/[^[0-9]/g,'');
+  var button=this.firstChild;
+  var sectionDiv=document.getElementById('dynsection'+num);
+  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
+    sectionDiv.style.display='block';
+    button.src='open.gif';
+  }else{
+    sectionDiv.style.display='none';
+    button.src='closed.gif';
+  }
+}
+function initDynSections(){
+  var divs=document.getElementsByTagName('div');
+  var sectionCounter=1;
+  for(var i=0;i<divs.length-1;i++){
+    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
+      var header=divs[i];
+      var section=divs[i+1];
+      var button=header.firstChild;
+      if (button!='IMG'){
+        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
+        button=document.createElement('img');
+        divs[i].insertBefore(button,divs[i].firstChild);
+      }
+      header.style.cursor='pointer';
+      header.onclick=changeDisplayState;
+      header.id='dynheader'+sectionCounter;
+      button.src='closed.gif';
+      section.id='dynsection'+sectionCounter;
+      section.style.display='none';
+      section.style.marginLeft='14px';
+      sectionCounter++;
+    }
+  }
+}
+window.onload = initDynSections;
+-->
+</script>
 <div class="navigation" id="top">
   <div class="tabs">
     <ul>
-      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
+      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
       <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
       <li><a href="modules.html"><span>Modules</span></a></li>
-      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
       <li><a href="classes.html"><span>Classes</span></a></li>
       <li class="current"><a href="files.html"><span>Files</span></a></li>
@@ -78,5 +118,5 @@
 <a name="l00107"></a>00107         <a class="code" href="classbdm_1_1Kalman.html#025a0196cbcc2e6adb13311f9d3d52b4" title="Default constructor.">Kalman</a> ( );
 <a name="l00109"></a>00109         <a class="code" href="classbdm_1_1Kalman.html#025a0196cbcc2e6adb13311f9d3d52b4" 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 );
-<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 );
+<a name="l00111"></a>00111         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1Kalman.html#3c7fb87fb6b87d08deb6a5a7862da957" 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;Q0,<span class="keyword">const</span> sq_T &amp;R0 );
 <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 ) {
 <a name="l00114"></a>00114                 sq_T pom(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>);
@@ -87,5 +127,5 @@
 <a name="l00119"></a>00119 
 <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 );
-<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>;}
+<a name="l00123"></a><a class="code" href="classbdm_1_1Kalman.html#f75e487ff6c129d7012d702030f8c890">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#f75e487ff6c129d7012d702030f8c890" title="access function">posterior</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>;}
 <a name="l00124"></a>00124         <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>* _e()<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>;}
 <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>;}
@@ -93,213 +133,217 @@
 <a name="l00129"></a>00129 };
 <a name="l00130"></a>00130 
-<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;{
-<a name="l00134"></a>00134 <span class="keyword">protected</span>:
-<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>;
-<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>;
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140 <span class="keyword">public</span>:
-<a name="l00142"></a><a class="code" href="classbdm_1_1KalmanCh.html#830486554e1a2c7652541dbc9dcd3fb3">00142</a>         <a class="code" href="classbdm_1_1KalmanCh.html#830486554e1a2c7652541dbc9dcd3fb3" title="Default constructor.">KalmanCh</a> ():<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;(),<a class="code" href="classbdm_1_1KalmanCh.html#48611c8582706cfa62e832be0972e75d" title="pre array (triangular matrix)">preA</a>(),<a class="code" href="classbdm_1_1KalmanCh.html#bcbd68f51d4b57246e7784ca5900171f" title="post array (triangular matrix)">postA</a>(){};
-<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 );
-<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 ) {
-<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">set_parameters</a> ( mu0,P0 );
-<a name="l00147"></a>00147         };
-<a name="l00148"></a>00148         
-<a name="l00149"></a>00149         
-<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 );
-<a name="l00164"></a>00164 };
-<a name="l00165"></a>00165 
-<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 a system, i.e. all uncertainty is modeled by probabilities.">BM</a> {
-<a name="l00172"></a>00172 
-<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;
-<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;
-<a name="l00177"></a>00177         
-<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; 
-<a name="l00179"></a>00179 <span class="keyword">public</span>:
-<a name="l00181"></a>00181         <a class="code" href="classbdm_1_1EKFfull.html#6939c345389abb8b2481457b4cfe1165" title="Default constructor.">EKFfull</a> ( );
-<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 );
-<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 );
-<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;};
-<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;};
-<a name="l00190"></a>00190         <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>* _e()<span class="keyword">const</span>{<span class="keywordflow">return</span> &amp;E;};
-<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>;}
-<a name="l00192"></a>00192 };
-<a name="l00193"></a>00193 
-<a name="l00199"></a>00199 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<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; {
-<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;
-<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;
-<a name="l00205"></a>00205 <span class="keyword">public</span>:
-<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> );
-<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 );
-<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 );
-<a name="l00212"></a>00212 };
-<a name="l00213"></a>00213 
-<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> {
-<a name="l00221"></a>00221         <span class="keyword">protected</span>:
-<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>;
-<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>;
-<a name="l00226"></a>00226 <span class="keyword">public</span>:
-<a name="l00228"></a>00228         <a class="code" href="classbdm_1_1EKFCh.html#8b3228a594532b6a0db0fdc065bc5b9f" title="Default constructor.">EKFCh</a> ();
-<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 );
-<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 );
-<a name="l00233"></a>00233 };
-<a name="l00234"></a>00234 
-<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> {
-<a name="l00240"></a>00240 <span class="comment">//protected:</span>
-<a name="l00241"></a>00241 <span class="keyword">public</span>:
-<a name="l00243"></a><a class="code" href="classbdm_1_1KFcondQR.html#b586ac962751a6af76b2e0fd7e066194">00243</a>         <a class="code" href="classbdm_1_1KFcondQR.html#b586ac962751a6af76b2e0fd7e066194" title="Default constructor.">KFcondQR</a> ( ) : <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; ( ),<a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( ) {};
-<a name="l00244"></a>00244 
-<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 );
-<a name="l00246"></a>00246 };
-<a name="l00247"></a>00247 
-<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> {
-<a name="l00253"></a>00253 <span class="comment">//protected:</span>
-<a name="l00254"></a>00254 <span class="keyword">public</span>:
-<a name="l00256"></a><a class="code" href="classbdm_1_1KFcondR.html#f11639d79f10b1e7dad16a0d8233450d">00256</a>         <a class="code" href="classbdm_1_1KFcondR.html#f11639d79f10b1e7dad16a0d8233450d" title="Default constructor.">KFcondR</a> ( ) : <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; ( ),<a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( ) {};
-<a name="l00257"></a>00257 
-<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> );
-<a name="l00259"></a>00259 };
-<a name="l00260"></a>00260 
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<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 a system, i.e. all uncertainty is modeled by probabilities.">BM</a> ( ),rvy ( K0.rvy ),rvu ( K0.rvu ),
-<a name="l00265"></a>00265                 dimx ( K0.dimx ), dimy ( K0.dimy ),dimu ( K0.dimu ),
-<a name="l00266"></a>00266                 A ( K0.A ), B ( K0.B ), C ( K0.C ), D ( K0.D ),
-<a name="l00267"></a>00267                 Q(K0.Q), R(K0.R),
-<a name="l00268"></a>00268                 est ( K0.est ), fy ( K0.fy ), _yp(fy._mu()),_Ry(fy._R()), _mu(est._mu()), _P(est._R()) {
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270 <span class="comment">// copy values in pointers</span>
-<a name="l00271"></a>00271 <span class="comment">//      _mu = K0._mu;</span>
-<a name="l00272"></a>00272 <span class="comment">//      _P = K0._P;</span>
-<a name="l00273"></a>00273 <span class="comment">//      _yp = K0._yp;</span>
-<a name="l00274"></a>00274 <span class="comment">//      _Ry = K0._Ry;</span>
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276 }
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00279"></a><a class="code" href="classbdm_1_1Kalman.html#025a0196cbcc2e6adb13311f9d3d52b4">00279</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_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a> (), est ( ), fy (),  _yp(fy._mu()), _Ry(fy._R()), _mu(est._mu()), _P(est._R()) {
-<a name="l00280"></a>00280 };
+<a name="l00137"></a><a class="code" href="classbdm_1_1KalmanCh.html">00137</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;{
+<a name="l00138"></a>00138 <span class="keyword">protected</span>:
+<a name="l00140"></a><a class="code" href="classbdm_1_1KalmanCh.html#48611c8582706cfa62e832be0972e75d">00140</a> mat <a class="code" href="classbdm_1_1KalmanCh.html#48611c8582706cfa62e832be0972e75d" title="pre array (triangular matrix)">preA</a>;
+<a name="l00142"></a><a class="code" href="classbdm_1_1KalmanCh.html#bcbd68f51d4b57246e7784ca5900171f">00142</a> mat <a class="code" href="classbdm_1_1KalmanCh.html#bcbd68f51d4b57246e7784ca5900171f" title="post array (triangular matrix)">postA</a>;
+<a name="l00143"></a>00143 
+<a name="l00144"></a>00144 <span class="keyword">public</span>:
+<a name="l00146"></a><a class="code" href="classbdm_1_1KalmanCh.html#830486554e1a2c7652541dbc9dcd3fb3">00146</a>         <a class="code" href="classbdm_1_1KalmanCh.html#830486554e1a2c7652541dbc9dcd3fb3" title="Default constructor.">KalmanCh</a> ():<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;(),<a class="code" href="classbdm_1_1KalmanCh.html#48611c8582706cfa62e832be0972e75d" title="pre array (triangular matrix)">preA</a>(),<a class="code" href="classbdm_1_1KalmanCh.html#bcbd68f51d4b57246e7784ca5900171f" title="post array (triangular matrix)">postA</a>(){};
+<a name="l00148"></a>00148         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1KalmanCh.html#20a4d4c664e8ac8a3f1bb7b0d11c6d87" 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;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> &amp;R0 );
+<a name="l00149"></a>00149         <span class="keywordtype">void</span> set_statistics ( <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 ) {
+<a name="l00150"></a>00150                 <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">set_parameters</a> ( mu0,P0 );
+<a name="l00151"></a>00151         };
+<a name="l00152"></a>00152         
+<a name="l00153"></a>00153         
+<a name="l00167"></a>00167         <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 );
+<a name="l00168"></a>00168 };
+<a name="l00169"></a>00169 
+<a name="l00175"></a><a class="code" href="classbdm_1_1EKFfull.html">00175</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 a system, i.e. all uncertainty is modeled by probabilities.">BM</a> {
+<a name="l00176"></a>00176 
+<a name="l00178"></a>00178         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu;
+<a name="l00180"></a>00180         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu;
+<a name="l00181"></a>00181         
+<a name="l00182"></a>00182         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;fsqmat&gt;</a> E; 
+<a name="l00183"></a>00183 <span class="keyword">public</span>:
+<a name="l00185"></a>00185         <a class="code" href="classbdm_1_1EKFfull.html#6939c345389abb8b2481457b4cfe1165" title="Default constructor.">EKFfull</a> ( );
+<a name="l00187"></a>00187         <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 );
+<a name="l00189"></a>00189         <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 );
+<a name="l00191"></a><a class="code" href="classbdm_1_1EKFfull.html#7562b3d3c17241dab3baf70258742eb2">00191</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;};
+<a name="l00193"></a><a class="code" href="classbdm_1_1EKFfull.html#7e9a69f36a0a0615c9abb806772ef36d">00193</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#7e9a69f36a0a0615c9abb806772ef36d" title="dummy!">posterior</a>()<span class="keyword">const</span>{<span class="keywordflow">return</span> E;};
+<a name="l00194"></a>00194         <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>* _e()<span class="keyword">const</span>{<span class="keywordflow">return</span> &amp;E;};
+<a name="l00195"></a>00195         <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>;}
+<a name="l00196"></a>00196 };
+<a name="l00197"></a>00197 
+<a name="l00203"></a>00203 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00204"></a><a class="code" href="classbdm_1_1EKF.html">00204</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; {
+<a name="l00206"></a>00206         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* pfxu;
+<a name="l00208"></a>00208         <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a>* phxu;
+<a name="l00209"></a>00209 <span class="keyword">public</span>:
+<a name="l00211"></a>00211         <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> );
+<a name="l00213"></a>00213         <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 );
+<a name="l00215"></a>00215         <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 );
+<a name="l00216"></a>00216 };
+<a name="l00217"></a>00217 
+<a name="l00224"></a><a class="code" href="classbdm_1_1EKFCh.html">00224</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> {
+<a name="l00225"></a>00225         <span class="keyword">protected</span>:
+<a name="l00227"></a><a class="code" href="classbdm_1_1EKFCh.html#e1e895f994398a55bc425551fc275ba3">00227</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 name="l00229"></a><a class="code" href="classbdm_1_1EKFCh.html#6b34c69641826322467b704e8252f317">00229</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>;
+<a name="l00230"></a>00230 <span class="keyword">public</span>:
+<a name="l00232"></a>00232         <a class="code" href="classbdm_1_1EKFCh.html#8b3228a594532b6a0db0fdc065bc5b9f" title="Default constructor.">EKFCh</a> ();
+<a name="l00234"></a>00234         <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 );
+<a name="l00236"></a>00236         <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 );
+<a name="l00237"></a>00237 };
+<a name="l00238"></a>00238 
+<a name="l00243"></a><a class="code" href="classbdm_1_1KFcondQR.html">00243</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> {
+<a name="l00244"></a>00244 <span class="comment">//protected:</span>
+<a name="l00245"></a>00245 <span class="keyword">public</span>:
+<a name="l00247"></a><a class="code" href="classbdm_1_1KFcondQR.html#b586ac962751a6af76b2e0fd7e066194">00247</a>         <a class="code" href="classbdm_1_1KFcondQR.html#b586ac962751a6af76b2e0fd7e066194" title="Default constructor.">KFcondQR</a> ( ) : <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; ( ),<a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( ) {};
+<a name="l00248"></a>00248 
+<a name="l00249"></a>00249         <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 );
+<a name="l00250"></a>00250 };
+<a name="l00251"></a>00251 
+<a name="l00256"></a><a class="code" href="classbdm_1_1KFcondR.html">00256</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> {
+<a name="l00257"></a>00257 <span class="comment">//protected:</span>
+<a name="l00258"></a>00258 <span class="keyword">public</span>:
+<a name="l00260"></a><a class="code" href="classbdm_1_1KFcondR.html#f11639d79f10b1e7dad16a0d8233450d">00260</a>         <a class="code" href="classbdm_1_1KFcondR.html#f11639d79f10b1e7dad16a0d8233450d" title="Default constructor.">KFcondR</a> ( ) : <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; ( ),<a class="code" href="classbdm_1_1BMcond.html" title="Conditional Bayesian Filter.">BMcond</a> ( ) {};
+<a name="l00261"></a>00261 
+<a name="l00262"></a>00262         <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> );
+<a name="l00263"></a>00263 };
+<a name="l00264"></a>00264 
+<a name="l00266"></a>00266 
+<a name="l00267"></a>00267 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00268"></a><a class="code" href="classbdm_1_1Kalman.html#8b22c45cffa949d70b8e5ac92ed5ce25">00268</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 a system, i.e. all uncertainty is modeled by probabilities.">BM</a> ( ),rvy ( K0.rvy ),rvu ( K0.rvu ),
+<a name="l00269"></a>00269                 dimx ( K0.dimx ), dimy ( K0.dimy ),dimu ( K0.dimu ),
+<a name="l00270"></a>00270                 A ( K0.A ), B ( K0.B ), C ( K0.C ), D ( K0.D ),
+<a name="l00271"></a>00271                 Q(K0.Q), R(K0.R),
+<a name="l00272"></a>00272                 est ( K0.est ), fy ( K0.fy ), _yp(fy._mu()),_Ry(fy._R()), _mu(est._mu()), _P(est._R()) {
+<a name="l00273"></a>00273 
+<a name="l00274"></a>00274 <span class="comment">// copy values in pointers</span>
+<a name="l00275"></a>00275 <span class="comment">//      _mu = K0._mu;</span>
+<a name="l00276"></a>00276 <span class="comment">//      _P = K0._P;</span>
+<a name="l00277"></a>00277 <span class="comment">//      _yp = K0._yp;</span>
+<a name="l00278"></a>00278 <span class="comment">//      _Ry = K0._Ry;</span>
+<a name="l00279"></a>00279 
+<a name="l00280"></a>00280 }
 <a name="l00281"></a>00281 
 <a name="l00282"></a>00282 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00283"></a><a class="code" href="classbdm_1_1Kalman.html#94eb8cc31731210089db0ba4e1a08a6c">00283</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 ) {
-<a name="l00284"></a>00284         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> );
-<a name="l00285"></a>00285         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> );
-<a name="l00286"></a>00286         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> );
-<a name="l00287"></a>00287         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> );
-<a name="l00288"></a>00288         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> );
-<a name="l00289"></a>00289         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> );
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291         <a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a> = A0;
-<a name="l00292"></a>00292         <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a> = B0;
-<a name="l00293"></a>00293         <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a> = C0;
-<a name="l00294"></a>00294         <a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a> = D0;
-<a name="l00295"></a>00295         <a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a> = R0;
-<a name="l00296"></a>00296         <a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a> = Q0;
-<a name="l00297"></a>00297 }
+<a name="l00283"></a><a class="code" href="classbdm_1_1Kalman.html#025a0196cbcc2e6adb13311f9d3d52b4">00283</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_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a> (), est ( ), fy (),  _yp(fy._mu()), _Ry(fy._R()), _mu(est._mu()), _P(est._R()) {
+<a name="l00284"></a>00284 };
+<a name="l00285"></a>00285 
+<a name="l00286"></a>00286 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00287"></a><a class="code" href="classbdm_1_1Kalman.html#3c7fb87fb6b87d08deb6a5a7862da957">00287</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;Q0, <span class="keyword">const</span> sq_T &amp;R0 ) {
+<a name="l00288"></a>00288         <a class="code" href="classbdm_1_1Kalman.html#ba7699cdb3b1382a54d3e28b9b7517fa" title="cache of rv.count()">dimx</a> = A0.rows();
+<a name="l00289"></a>00289         <a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a> = C0.rows();
+<a name="l00290"></a>00290         <a class="code" href="classbdm_1_1Kalman.html#c5136ef617f6ac0e426bea222755d92b" title="cache of rvu.count()">dimu</a> = B0.cols();
+<a name="l00291"></a>00291         
+<a name="l00292"></a>00292         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> );
+<a name="l00293"></a>00293         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> );
+<a name="l00294"></a>00294         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> );
+<a name="l00295"></a>00295         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> );
+<a name="l00296"></a>00296         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> );
+<a name="l00297"></a>00297         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> );
 <a name="l00298"></a>00298 
-<a name="l00299"></a>00299 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00300"></a><a class="code" href="classbdm_1_1Kalman.html#4a39330c14eff8d13179e868a1d1aa8c">00300</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 ) {
-<a name="l00301"></a>00301         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> );
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303         sq_T iRy(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>);
-<a name="l00304"></a>00304         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 );
-<a name="l00305"></a>00305         vec y = dt.get ( 0,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>-1 );
-<a name="l00306"></a>00306         <span class="comment">//Time update</span>
-<a name="l00307"></a>00307         <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;
-<a name="l00308"></a>00308         <span class="comment">//P  = A*P*A.transpose() + Q; in sq_T</span>
-<a name="l00309"></a>00309         <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> );
-<a name="l00310"></a>00310         <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>;
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312         <span class="comment">//Data update</span>
-<a name="l00313"></a>00313         <span class="comment">//_Ry = C*P*C.transpose() + R; in sq_T</span>
-<a name="l00314"></a>00314         <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> );
-<a name="l00315"></a>00315         <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>;
-<a name="l00316"></a>00316 
-<a name="l00317"></a>00317         mat Pfull = <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.to_mat();
-<a name="l00318"></a>00318 
-<a name="l00319"></a>00319         <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>
-<a name="l00320"></a>00320         <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() );
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322         sq_T pom ( ( <span class="keywordtype">int</span> ) Pfull.rows() );
-<a name="l00323"></a>00323         iRy.mult_sym_t ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>*Pfull,pom );
-<a name="l00324"></a>00324         (<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>
-<a name="l00325"></a>00325         (<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>
-<a name="l00326"></a>00326         (<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>  );
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329         <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>
-<a name="l00330"></a>00330                 <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 );
-<a name="l00331"></a>00331         }
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333 <span class="comment">//cout &lt;&lt; "y: " &lt;&lt; y-(*_yp) &lt;&lt;" R: " &lt;&lt; _Ry-&gt;to_mat() &lt;&lt; " iR: " &lt;&lt; _iRy-&gt;to_mat() &lt;&lt; " ll: " &lt;&lt; ll &lt;&lt;endl;</span>
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335 };
-<a name="l00336"></a>00336  
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339 <span class="comment">//TODO why not const pointer??</span>
+<a name="l00299"></a>00299         <a class="code" href="classbdm_1_1Kalman.html#0a2072e2090c10fac74ad30a023a4ace" title="Matrix A.">A</a> = A0;
+<a name="l00300"></a>00300         <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a> = B0;
+<a name="l00301"></a>00301         <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a> = C0;
+<a name="l00302"></a>00302         <a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a> = D0;
+<a name="l00303"></a>00303         <a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a> = R0;
+<a name="l00304"></a>00304         <a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a> = Q0;
+<a name="l00305"></a>00305 }
+<a name="l00306"></a>00306 
+<a name="l00307"></a>00307 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00308"></a><a class="code" href="classbdm_1_1Kalman.html#4a39330c14eff8d13179e868a1d1aa8c">00308</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 ) {
+<a name="l00309"></a>00309         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> );
+<a name="l00310"></a>00310 
+<a name="l00311"></a>00311         sq_T iRy(<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>);
+<a name="l00312"></a>00312         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 );
+<a name="l00313"></a>00313         vec y = dt.get ( 0,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>-1 );
+<a name="l00314"></a>00314         <span class="comment">//Time update</span>
+<a name="l00315"></a>00315         <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;
+<a name="l00316"></a>00316         <span class="comment">//P  = A*P*A.transpose() + Q; in sq_T</span>
+<a name="l00317"></a>00317         <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> );
+<a name="l00318"></a>00318         <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>;
+<a name="l00319"></a>00319 
+<a name="l00320"></a>00320         <span class="comment">//Data update</span>
+<a name="l00321"></a>00321         <span class="comment">//_Ry = C*P*C.transpose() + R; in sq_T</span>
+<a name="l00322"></a>00322         <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> );
+<a name="l00323"></a>00323         <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>;
+<a name="l00324"></a>00324 
+<a name="l00325"></a>00325         mat Pfull = <a class="code" href="classbdm_1_1Kalman.html#00c27b0bf324f0018497921ca23c71ed" title="cache of est.R">_P</a>.to_mat();
+<a name="l00326"></a>00326 
+<a name="l00327"></a>00327         <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>
+<a name="l00328"></a>00328         <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() );
+<a name="l00329"></a>00329 
+<a name="l00330"></a>00330         sq_T pom ( ( <span class="keywordtype">int</span> ) Pfull.rows() );
+<a name="l00331"></a>00331         iRy.mult_sym_t ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>*Pfull,pom );
+<a name="l00332"></a>00332         (<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>
+<a name="l00333"></a>00333         (<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>
+<a name="l00334"></a>00334         (<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>  );
+<a name="l00335"></a>00335 
+<a name="l00336"></a>00336 
+<a name="l00337"></a>00337         <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>
+<a name="l00338"></a>00338                 <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 );
+<a name="l00339"></a>00339         }
 <a name="l00340"></a>00340 
-<a name="l00341"></a>00341 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00342"></a><a class="code" href="classbdm_1_1EKF.html#d087a8bb408d26ac4f5c542746b81059">00342</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 ) {}
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00345"></a><a class="code" href="classbdm_1_1EKF.html#00fec1a0a6a467eb83fb36c65eba7bcb">00345</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 ) {
-<a name="l00346"></a>00346         pfxu = pfxu0;
-<a name="l00347"></a>00347         phxu = phxu0;
+<a name="l00341"></a>00341 <span class="comment">//cout &lt;&lt; "y: " &lt;&lt; y-(*_yp) &lt;&lt;" R: " &lt;&lt; _Ry-&gt;to_mat() &lt;&lt; " iR: " &lt;&lt; _iRy-&gt;to_mat() &lt;&lt; " ll: " &lt;&lt; ll &lt;&lt;endl;</span>
+<a name="l00342"></a>00342 
+<a name="l00343"></a>00343 };
+<a name="l00344"></a>00344  
+<a name="l00345"></a>00345 
+<a name="l00346"></a>00346 
+<a name="l00347"></a>00347 <span class="comment">//TODO why not const pointer??</span>
 <a name="l00348"></a>00348 
-<a name="l00349"></a>00349         <span class="comment">//initialize matrices A C, later, these will be only updated!</span>
-<a name="l00350"></a>00350         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> );
-<a name="l00351"></a>00351 <span class="comment">//      pfxu-&gt;dfdu_cond ( *_mu,zeros ( dimu ),B,true );</span>
-<a name="l00352"></a>00352         <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a>.clear();
-<a name="l00353"></a>00353         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> );
-<a name="l00354"></a>00354 <span class="comment">//      phxu-&gt;dfdu_cond ( *_mu,zeros ( dimu ),D,true );</span>
-<a name="l00355"></a>00355         <a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a>.clear();
+<a name="l00349"></a>00349 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00350"></a><a class="code" href="classbdm_1_1EKF.html#d087a8bb408d26ac4f5c542746b81059">00350</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 ) {}
+<a name="l00351"></a>00351 
+<a name="l00352"></a>00352 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00353"></a><a class="code" href="classbdm_1_1EKF.html#00fec1a0a6a467eb83fb36c65eba7bcb">00353</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 ) {
+<a name="l00354"></a>00354         pfxu = pfxu0;
+<a name="l00355"></a>00355         phxu = phxu0;
 <a name="l00356"></a>00356 
-<a name="l00357"></a>00357         <a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a> = R0;
-<a name="l00358"></a>00358         <a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a> = Q0;
-<a name="l00359"></a>00359 }
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00362"></a><a class="code" href="classbdm_1_1EKF.html#3fb182ecc29b10ca1163cecbf3bcccfa">00362</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 ) {
-<a name="l00363"></a>00363         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> );
+<a name="l00357"></a>00357         <span class="comment">//initialize matrices A C, later, these will be only updated!</span>
+<a name="l00358"></a>00358         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> );
+<a name="l00359"></a>00359 <span class="comment">//      pfxu-&gt;dfdu_cond ( *_mu,zeros ( dimu ),B,true );</span>
+<a name="l00360"></a>00360         <a class="code" href="classbdm_1_1Kalman.html#5977b2c81857948a35105f0e7840203c" title="Matrix B.">B</a>.clear();
+<a name="l00361"></a>00361         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> );
+<a name="l00362"></a>00362 <span class="comment">//      phxu-&gt;dfdu_cond ( *_mu,zeros ( dimu ),D,true );</span>
+<a name="l00363"></a>00363         <a class="code" href="classbdm_1_1Kalman.html#7b56ac423d0654b5755e4f852a870456" title="Matrix D.">D</a>.clear();
 <a name="l00364"></a>00364 
-<a name="l00365"></a>00365         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>);
-<a name="l00366"></a>00366         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 );
-<a name="l00367"></a>00367         vec y = dt.get ( 0,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>-1 );
-<a name="l00368"></a>00368         <span class="comment">//Time update</span>
-<a name="l00369"></a>00369         <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 );
-<a name="l00370"></a>00370         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>
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372         <span class="comment">//P  = A*P*A.transpose() + Q; in sq_T</span>
-<a name="l00373"></a>00373         <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> );
-<a name="l00374"></a>00374         <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>;
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376         <span class="comment">//Data update</span>
-<a name="l00377"></a>00377         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>
-<a name="l00378"></a>00378         <span class="comment">//_Ry = C*P*C.transpose() + R; in sq_T</span>
-<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#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>, <a class="code" href="classbdm_1_1Kalman.html#2dd268f2d7fbe6382cb8825a1114192a" title="cache of fy.R">_Ry</a> );
-<a name="l00380"></a>00380         ( <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>;
-<a name="l00381"></a>00381 
-<a name="l00382"></a>00382         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>();
+<a name="l00365"></a>00365         <a class="code" href="classbdm_1_1Kalman.html#475b088287cdfbba4dc60a3d027728b7" title="Matrix R in square-root form.">R</a> = R0;
+<a name="l00366"></a>00366         <a class="code" href="classbdm_1_1Kalman.html#70f8bf19e81b532c60fd3a7a152425ee" title="Matrix Q in square-root form.">Q</a> = Q0;
+<a name="l00367"></a>00367 }
+<a name="l00368"></a>00368 
+<a name="l00369"></a>00369 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00370"></a><a class="code" href="classbdm_1_1EKF.html#3fb182ecc29b10ca1163cecbf3bcccfa">00370</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 ) {
+<a name="l00371"></a>00371         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> );
+<a name="l00372"></a>00372 
+<a name="l00373"></a>00373         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>);
+<a name="l00374"></a>00374         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 );
+<a name="l00375"></a>00375         vec y = dt.get ( 0,<a class="code" href="classbdm_1_1Kalman.html#d2c36ba01760bf207b985bf321b7817f" title="cache of rvy.count()">dimy</a>-1 );
+<a name="l00376"></a>00376         <span class="comment">//Time update</span>
+<a name="l00377"></a>00377         <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 );
+<a name="l00378"></a>00378         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>
+<a name="l00379"></a>00379 
+<a name="l00380"></a>00380         <span class="comment">//P  = A*P*A.transpose() + Q; in sq_T</span>
+<a name="l00381"></a>00381         <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> );
+<a name="l00382"></a>00382         <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>;
 <a name="l00383"></a>00383 
-<a name="l00384"></a>00384         <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>
-<a name="l00385"></a>00385         <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() );
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387         sq_T pom ( ( <span class="keywordtype">int</span> ) Pfull.rows() );
-<a name="l00388"></a>00388         iRy.mult_sym_t ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>*Pfull,pom );
-<a name="l00389"></a>00389         (<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>
-<a name="l00390"></a>00390         <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>
-<a name="l00391"></a>00391         ( <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> );
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393         <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 );}
-<a name="l00394"></a>00394 };
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397 }
-<a name="l00398"></a>00398 <span class="preprocessor">#endif // KF_H</span>
-<a name="l00399"></a>00399 <span class="preprocessor"></span>
+<a name="l00384"></a>00384         <span class="comment">//Data update</span>
+<a name="l00385"></a>00385         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>
+<a name="l00386"></a>00386         <span class="comment">//_Ry = C*P*C.transpose() + R; in sq_T</span>
+<a name="l00387"></a>00387         <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> );
+<a name="l00388"></a>00388         ( <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>;
+<a name="l00389"></a>00389 
+<a name="l00390"></a>00390         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>();
+<a name="l00391"></a>00391 
+<a name="l00392"></a>00392         <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>
+<a name="l00393"></a>00393         <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() );
+<a name="l00394"></a>00394 
+<a name="l00395"></a>00395         sq_T pom ( ( <span class="keywordtype">int</span> ) Pfull.rows() );
+<a name="l00396"></a>00396         iRy.mult_sym_t ( <a class="code" href="classbdm_1_1Kalman.html#818eba63a23972786a4579ad30294177" title="Matrix C.">C</a>*Pfull,pom );
+<a name="l00397"></a>00397         (<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>
+<a name="l00398"></a>00398         <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>
+<a name="l00399"></a>00399         ( <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> );
 <a name="l00400"></a>00400 
+<a name="l00401"></a>00401         <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 );}
+<a name="l00402"></a>00402 };
+<a name="l00403"></a>00403 
+<a name="l00404"></a>00404 
+<a name="l00405"></a>00405 }
+<a name="l00406"></a>00406 <span class="preprocessor">#endif // KF_H</span>
+<a name="l00407"></a>00407 <span class="preprocessor"></span>
+<a name="l00408"></a>00408 
 </pre></div></div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 11 23:33:55 2009 for mixpp by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Sun Feb 15 23:09:23 2009 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
