<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
  <compounddef id="libKF_8h" kind="file">
    <compoundname>libKF.h</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="libFN_8h" local="yes">../stat/libFN.h</includes>
    <includes refid="libEF_8h" local="yes">../stat/libEF.h</includes>
    <includes refid="chmat_8h" local="yes">../math/chmat.h</includes>
    <includedby refid="ekf__templ_8h" local="yes">work/git/mixpp/bdm/estim/ekf_templ.h</includedby>
    <includedby refid="libKF_8cpp" local="yes">work/git/mixpp/bdm/estim/libKF.cpp</includedby>
    <includedby refid="pmsm__sim_8cpp" local="no">work/git/mixpp/pmsm/pmsm_sim.cpp</includedby>
    <includedby refid="pmsm__sim2_8cpp" local="no">work/git/mixpp/pmsm/pmsm_sim2.cpp</includedby>
    <includedby refid="pmsm__sim3_8cpp" local="no">work/git/mixpp/pmsm/pmsm_sim3.cpp</includedby>
    <includedby refid="pmsm__unkQ_8cpp" local="no">work/git/mixpp/pmsm/pmsm_unkQ.cpp</includedby>
    <includedby refid="pmsm__unkQpf_8cpp" local="no">work/git/mixpp/pmsm/pmsm_unkQpf.cpp</includedby>
    <includedby refid="sim__var_8cpp" local="no">work/git/mixpp/pmsm/sim_var.cpp</includedby>
    <includedby refid="ekf__obj_8cpp" local="no">work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.cpp</includedby>
    <includedby refid="ekf__obj_8h" local="no">work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.h</includedby>
    <includedby refid="testKF_8cpp" local="no">work/git/mixpp/tests/testKF.cpp</includedby>
    <includedby refid="testKF__QR_8cpp" local="no">work/git/mixpp/tests/testKF_QR.cpp</includedby>
    <includedby refid="testKF__QRexh_8cpp" local="no">work/git/mixpp/tests/testKF_QRexh.cpp</includedby>
    <incdepgraph>
      <node id="237">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="235" relation="include">
        </childnode>
      </node>
      <node id="240">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="235" relation="include">
        </childnode>
      </node>
      <node id="238">
        <label>../stat/libEF.h</label>
        <link refid="libEF_8h"/>
        <childnode refid="235" relation="include">
        </childnode>
        <childnode refid="239" relation="include">
        </childnode>
        <childnode refid="237" relation="include">
        </childnode>
        <childnode refid="240" relation="include">
        </childnode>
      </node>
      <node id="236">
        <label>../stat/libFN.h</label>
        <link refid="libFN_8h-source"/>
        <childnode refid="235" relation="include">
        </childnode>
        <childnode refid="237" relation="include">
        </childnode>
      </node>
      <node id="235">
        <label>itpp/itbase.h</label>
      </node>
      <node id="241">
        <label>../math/chmat.h</label>
        <link refid="chmat_8h"/>
        <childnode refid="235" relation="include">
        </childnode>
        <childnode refid="239" relation="include">
        </childnode>
        <childnode refid="240" relation="include">
        </childnode>
      </node>
      <node id="234">
        <label>work/git/mixpp/bdm/estim/libKF.h</label>
        <link refid="libKF.h"/>
        <childnode refid="235" relation="include">
        </childnode>
        <childnode refid="236" relation="include">
        </childnode>
        <childnode refid="238" relation="include">
        </childnode>
        <childnode refid="241" relation="include">
        </childnode>
      </node>
      <node id="239">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="235" relation="include">
        </childnode>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="243">
        <label>work/git/mixpp/bdm/estim/ekf_templ.h</label>
        <link refid="ekf__templ_8h"/>
        <childnode refid="244" relation="include">
        </childnode>
      </node>
      <node id="245">
        <label>work/git/mixpp/pmsm/sim_var.cpp</label>
        <link refid="sim__var_8cpp"/>
      </node>
      <node id="242">
        <label>work/git/mixpp/bdm/estim/libKF.h</label>
        <link refid="libKF.h"/>
        <childnode refid="243" relation="include">
        </childnode>
        <childnode refid="245" relation="include">
        </childnode>
        <childnode refid="246" relation="include">
        </childnode>
      </node>
      <node id="246">
        <label>work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.h</label>
        <link refid="ekf__obj_8h"/>
      </node>
      <node id="244">
        <label>work/git/mixpp/pmsm/pmsm_mix.cpp</label>
        <link refid="pmsm__mix_8cpp"/>
      </node>
    </invincdepgraph>
    <innerclass refid="classKalmanFull" prot="public">KalmanFull</innerclass>
    <innerclass refid="classKalman" prot="public">Kalman</innerclass>
    <innerclass refid="classKalmanCh" prot="public">KalmanCh</innerclass>
    <innerclass refid="classEKFfull" prot="public">EKFfull</innerclass>
    <innerclass refid="classEKF" prot="public">EKF</innerclass>
    <innerclass refid="classEKFCh" prot="public">EKFCh</innerclass>
    <innerclass refid="classKFcondQR" prot="public">KFcondQR</innerclass>
    <innerclass refid="classKFcondR" prot="public">KFcondR</innerclass>
    <briefdescription>
<para>Bayesian Filtering for linear Gaussian models (<ref refid="classKalman" kindref="compound">Kalman</ref> Filter) and extensions. </para>    </briefdescription>
    <detaileddescription>
<para><simplesect kind="author"><para>Vaclav Smidl.</para></simplesect>
----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty</para><para>Using IT++ for numerical operations ----------------------------------- </para>    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="13"><highlight class="preprocessor">#ifndef<sp/>KF_H</highlight></codeline>
<codeline lineno="14"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>KF_H</highlight></codeline>
<codeline lineno="15"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;itpp/itbase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../stat/libFN.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../stat/libEF.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../math/chmat.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="27" refid="classKalmanFull" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classKalmanFull" kindref="compound" tooltip="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</ref><sp/>{</highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dimx,<sp/>dimy,<sp/>dimu;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A,<sp/>B,<sp/>C,<sp/>D,<sp/>R,<sp/>Q;</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//cache</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>_Pp,<sp/>_Ry,<sp/>_iRy,<sp/>_K;</highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//posterior</highlight></codeline>
<codeline lineno="37" refid="classKalmanFull_1fb5aec635e2720cc5ac31bc01c18a68a" refkind="member"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classKalmanFull_1fb5aec635e2720cc5ac31bc01c18a68a" kindref="member" tooltip="Mean value of the posterior density.">mu</ref>;</highlight></codeline>
<codeline lineno="39" refid="classKalmanFull_1b75dc059e84fa8ffc076203b30f926cc" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classKalmanFull_1b75dc059e84fa8ffc076203b30f926cc" kindref="member" tooltip="Variance of the posterior density.">P</ref>;</highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>evalll;</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ll;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalmanFull_19d7cc2235b643d9662cd9c8b8469747d" kindref="member" tooltip="For EKFfull;.">KalmanFull</ref><sp/>(<sp/>mat<sp/>A,<sp/>mat<sp/>B,<sp/>mat<sp/>C,<sp/>mat<sp/>D,<sp/>mat<sp/>R,<sp/>mat<sp/>Q,<sp/>mat<sp/>P0,<sp/>vec<sp/>mu0<sp/>);</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalmanFull_113a041cd98ff157703766be275a657bb" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>);</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">friend</highlight><highlight class="normal"><sp/>std::ostream<sp/>&amp;<ref refid="classKalmanFull_186ba216243ed95bb46d80d88775d16af" kindref="member" tooltip="print elements of KF">operator&lt;&lt; </ref>(<sp/>std::ostream<sp/>&amp;os,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classKalmanFull" kindref="compound" tooltip="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</ref><sp/>&amp;kf<sp/>);</highlight></codeline>
<codeline lineno="51" refid="classKalmanFull_19d7cc2235b643d9662cd9c8b8469747d" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalmanFull_19d7cc2235b643d9662cd9c8b8469747d" kindref="member" tooltip="For EKFfull;.">KalmanFull</ref>(){};</highlight></codeline>
<codeline lineno="52"><highlight class="normal">};</highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight></codeline>
<codeline lineno="64" refid="classKalman" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classBM" kindref="compound" tooltip="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</ref><sp/>{</highlight></codeline>
<codeline lineno="65"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="67" refid="classKalman_17501230c2fafa3655887d2da23b3184c" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref>;</highlight></codeline>
<codeline lineno="69" refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" kindref="member" tooltip="Indetifier of exogeneous rv.">rvu</ref>;</highlight></codeline>
<codeline lineno="71" refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>;</highlight></codeline>
<codeline lineno="73" refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>;</highlight></codeline>
<codeline lineno="75" refid="classKalman_1b0153795a1444b6968a86409c778d9ce" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref>;</highlight></codeline>
<codeline lineno="77" refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref>;</highlight></codeline>
<codeline lineno="79" refid="classKalman_1dc87704284a6c0bca13bf51f4345a50a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classKalman_1dc87704284a6c0bca13bf51f4345a50a" kindref="member" tooltip="Matrix B.">B</ref>;<sp/></highlight></codeline>
<codeline lineno="81" refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>;</highlight></codeline>
<codeline lineno="83" refid="classKalman_1d69f774ba3335c970c1c5b1d182f4dd1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classKalman_1d69f774ba3335c970c1c5b1d182f4dd1" kindref="member" tooltip="Matrix D.">D</ref>;</highlight></codeline>
<codeline lineno="85" refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/><ref refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" kindref="member" tooltip="Matrix Q in square-root form.">Q</ref>;</highlight></codeline>
<codeline lineno="87" refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/><ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref>;</highlight></codeline>
<codeline lineno="88"><highlight class="normal"></highlight></codeline>
<codeline lineno="90" refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm" kindref="compound" tooltip="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</ref><sp/><ref refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" kindref="member" tooltip="posterior density on $x_t$">est</ref>;</highlight></codeline>
<codeline lineno="92" refid="classKalman_1e580ab06483952bd03f2e651763e184f" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm" kindref="compound" tooltip="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</ref><sp/><ref refid="classKalman_1e580ab06483952bd03f2e651763e184f" kindref="member" tooltip="preditive density on $y_t$">fy</ref>;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"></highlight></codeline>
<codeline lineno="95" refid="classKalman_1d422f51467c7a06174af2476d2826132" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classKalman_1d422f51467c7a06174af2476d2826132" kindref="member" tooltip="placeholder for Kalman gain">_K</ref>;</highlight></codeline>
<codeline lineno="97" refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&amp;<sp/><ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref>;</highlight></codeline>
<codeline lineno="99" refid="classKalman_145c9f928d2d62e0c884900fb3380f904" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T&amp;<sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref>;</highlight></codeline>
<codeline lineno="101" refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&amp;<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>;</highlight></codeline>
<codeline lineno="103" refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T&amp;<sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>;</highlight></codeline>
<codeline lineno="104"><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_13d56b0a97b8c1e25fdd3b10eef3c2ad3" kindref="member" tooltip="Default constructor.">Kalman</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx0,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvy0,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvu0<sp/>);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_13d56b0a97b8c1e25fdd3b10eef3c2ad3" kindref="member" tooltip="Default constructor.">Kalman</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;</ref><sp/>&amp;K0<sp/>);</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalman_1239b28a0380946f5749b2f8d2807f93a" kindref="member" tooltip="Set parameters with check of relevance.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;A0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;B0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;D0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;R0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;Q0<sp/>);</highlight></codeline>
<codeline lineno="113" refid="classKalman_180bcf29466d9a9dd2b8f74699807d0c0" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalman_180bcf29466d9a9dd2b8f74699807d0c0" kindref="member" tooltip="Set estimate values, used e.g. in initialization.">set_est</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;mu0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;P0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/>pom(<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>);</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" kindref="member" tooltip="posterior density on $x_t$">est</ref>.set_parameters<sp/>(<sp/>mu0,P0<sp/>);</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>P0.mult_sym(<ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>,pom);</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1e580ab06483952bd03f2e651763e184f" kindref="member" tooltip="preditive density on $y_t$">fy</ref>.set_parameters<sp/>(<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>*mu0,<sp/>pom<sp/>);</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="119"><highlight class="normal"></highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalman_17750ffd73f261828a32c18aaeb65c75c" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>);</highlight></codeline>
<codeline lineno="123" refid="classKalman_1a213c57aef55b2645e550bed81cfc0d4" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>&amp;<sp/><ref refid="classKalman_1a213c57aef55b2645e550bed81cfc0d4" kindref="member" tooltip="access function">_epdf</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" kindref="member" tooltip="posterior density on $x_t$">est</ref>;}</highlight></codeline>
<codeline lineno="125" refid="classKalman_1980fcd41c6c548c5da7b8b67c8e6da79" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat&amp;<sp/><ref refid="classKalman_1980fcd41c6c548c5da7b8b67c8e6da79" kindref="member" tooltip="access function">__K</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classKalman_1d422f51467c7a06174af2476d2826132" kindref="member" tooltip="placeholder for Kalman gain">_K</ref>;}</highlight></codeline>
<codeline lineno="127" refid="classKalman_1ac9540f3850b74d89a5fe4db6fc358ce" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classKalman_1ac9540f3850b74d89a5fe4db6fc358ce" kindref="member" tooltip="access function">_dP</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>-&gt;getD();}</highlight></codeline>
<codeline lineno="128"><highlight class="normal">};</highlight></codeline>
<codeline lineno="129"><highlight class="normal"></highlight></codeline>
<codeline lineno="132" refid="classKalmanCh" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classKalmanCh" kindref="compound" tooltip="Kalman filter in square root form.">KalmanCh</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;chmat&gt;{</highlight></codeline>
<codeline lineno="133"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="135" refid="classKalmanCh_194ee9da75b0e0f632e4a354988ca3798" refkind="member"><highlight class="normal">mat<sp/><ref refid="classKalmanCh_194ee9da75b0e0f632e4a354988ca3798" kindref="member" tooltip="pre array (triangular matrix)">preA</ref>;</highlight></codeline>
<codeline lineno="137" refid="classKalmanCh_10d31a26dc72b5846cfe5af3ccb63ac87" refkind="member"><highlight class="normal">mat<sp/><ref refid="classKalmanCh_10d31a26dc72b5846cfe5af3ccb63ac87" kindref="member" tooltip="post array (triangular matrix)">postA</ref>;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"></highlight></codeline>
<codeline lineno="139"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="141" refid="classKalmanCh_1d11f110cccaa66177514632d37b086bb" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalmanCh_1d11f110cccaa66177514632d37b086bb" kindref="member" tooltip="Default constructor.">KalmanCh</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx0,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvy0,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvu0<sp/>):<ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;<ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref>&gt;(rvx0,rvy0,rvu0),<ref refid="classKalmanCh_194ee9da75b0e0f632e4a354988ca3798" kindref="member" tooltip="pre array (triangular matrix)">preA</ref>(<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>+<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>,<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>),<ref refid="classKalmanCh_10d31a26dc72b5846cfe5af3ccb63ac87" kindref="member" tooltip="post array (triangular matrix)">postA</ref>(<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>,<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>){};</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalmanCh_192fb227287af05c9f0078d523c7c9793" kindref="member" tooltip="Set parameters with check of relevance.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;A0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;B0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;D0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>&amp;R0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>&amp;Q0<sp/>);</highlight></codeline>
<codeline lineno="144" refid="classKalmanCh_1b261b20f6210d4c85131d33302df0adc" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalmanCh_1b261b20f6210d4c85131d33302df0adc" kindref="member" tooltip="Set estimate values, used e.g. in initialization.">set_est</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;mu0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>&amp;P0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" kindref="member" tooltip="posterior density on $x_t$">est</ref>.<ref refid="classenorm_11394a65caa6e00d42e00cc99b12227af" kindref="member" tooltip="Set mean value mu and covariance R.">set_parameters</ref><sp/>(<sp/>mu0,P0<sp/>);</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalmanCh_1cca758192846940409822b9bd778d4e1" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>);</highlight></codeline>
<codeline lineno="163"><highlight class="normal">};</highlight></codeline>
<codeline lineno="164"><highlight class="normal"></highlight></codeline>
<codeline lineno="170" refid="classEKFfull" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classEKFfull" kindref="compound" tooltip="Extended Kalman Filter in full matrices.">EKFfull</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classKalmanFull" kindref="compound" tooltip="Basic Kalman filter with full matrices (education purpose only)! Will be deleted...">KalmanFull</ref>,<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classBM" kindref="compound" tooltip="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</ref><sp/>{</highlight></codeline>
<codeline lineno="171"><highlight class="normal"></highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>pfxu;</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>phxu;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm" kindref="compound" tooltip="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;fsqmat&gt;</ref><sp/>E;<sp/></highlight></codeline>
<codeline lineno="178"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKFfull_167ac4de96fd025197da767fe0472c7f7" kindref="member" tooltip="Default constructor.">EKFfull</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvy,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvu<sp/>);</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKFfull_1fc753106e0d4cf68e4f2160fd54458c0" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>pfxu,<sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>phxu,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>Q0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>R0<sp/>);</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKFfull_18ca46f177e395fa714bbd8bd29ea43e0" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>);</highlight></codeline>
<codeline lineno="186" refid="classEKFfull_17bb76ea74c144ea0b36db99f94750b7b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKFfull_17bb76ea74c144ea0b36db99f94750b7b" kindref="member" tooltip="set estimates">set_est</ref><sp/>(vec<sp/>mu0,<sp/>mat<sp/>P0){<ref refid="classKalmanFull_1fb5aec635e2720cc5ac31bc01c18a68a" kindref="member" tooltip="Mean value of the posterior density.">mu</ref>=mu0;<ref refid="classKalmanFull_1b75dc059e84fa8ffc076203b30f926cc" kindref="member" tooltip="Variance of the posterior density.">P</ref>=P0;};</highlight></codeline>
<codeline lineno="188" refid="classEKFfull_14080d68f79dade36ccf547d57e64bdc2" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>&amp;<sp/><ref refid="classEKFfull_14080d68f79dade36ccf547d57e64bdc2" kindref="member" tooltip="dummy!">_epdf</ref>(){</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>E;};</highlight></codeline>
<codeline lineno="189"><highlight class="normal">};</highlight></codeline>
<codeline lineno="190"><highlight class="normal"></highlight></codeline>
<codeline lineno="196"><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="197" refid="classEKF" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classEKF" kindref="compound" tooltip="Extended Kalman Filter.">EKF</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;fsqmat&gt;<sp/>{</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>pfxu;</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>phxu;</highlight></codeline>
<codeline lineno="202"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKF_1ea4f3254cacf0a92d2a820b1201d049e" kindref="member" tooltip="Default constructor.">EKF</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref>,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" kindref="member" tooltip="Indetifier of exogeneous rv.">rvu</ref><sp/>);</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKF_128d058ae4d24d992d2f055419a06ee66" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>pfxu,<sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>phxu,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>Q0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>R0<sp/>);</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKF_1c79c62c9b3e0b56b3aaa1b6f1d9a7af7" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>);</highlight></codeline>
<codeline lineno="209"><highlight class="normal">};</highlight></codeline>
<codeline lineno="210"><highlight class="normal"></highlight></codeline>
<codeline lineno="217" refid="classEKFCh" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classEKFCh" kindref="compound" tooltip="Extended Kalman Filter in Square root.">EKFCh</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classKalmanCh" kindref="compound" tooltip="Kalman filter in square root form.">KalmanCh</ref><sp/>{</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>pfxu;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>phxu;</highlight></codeline>
<codeline lineno="222"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKFCh_1e9e39a9204db3dda88d06e47c1e19064" kindref="member" tooltip="Default constructor.">EKFCh</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref>,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" kindref="member" tooltip="Indetifier of exogeneous rv.">rvu</ref><sp/>);</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKFCh_10216bed270df59fe65d0d62d41f8257c" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>pfxu,<sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>phxu,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>Q0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>R0<sp/>);</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKFCh_196f6edda324a0b7ef8b4e86cc7af60c1" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>);</highlight></codeline>
<codeline lineno="229"><highlight class="normal">};</highlight></codeline>
<codeline lineno="230"><highlight class="normal"></highlight></codeline>
<codeline lineno="235" refid="classKFcondQR" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classKFcondQR" kindref="compound" tooltip="Kalman Filter with conditional diagonal matrices R and Q.">KFcondQR</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;ldmat&gt;,<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classBMcond" kindref="compound" tooltip="Conditional Bayesian Filter.">BMcond</ref><sp/>{</highlight></codeline>
<codeline lineno="236"><highlight class="normal"></highlight><highlight class="comment">//protected:</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="237"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="239" refid="classKFcondQR_13f3968f92c7bbe4b0902d5e14ecc1cb4" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKFcondQR_13f3968f92c7bbe4b0902d5e14ecc1cb4" kindref="member" tooltip="Default constructor.">KFcondQR</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref>,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" kindref="member" tooltip="Indetifier of exogeneous rv.">rvu</ref>,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvRQ<sp/>)<sp/>:<sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;<ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref>&gt;<sp/>(<sp/>rvx,<sp/>rvy,rvu<sp/>),<ref refid="classBMcond" kindref="compound" tooltip="Conditional Bayesian Filter.">BMcond</ref><sp/>(<sp/>rvRQ<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="240"><highlight class="normal"></highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKFcondQR_1c9ecf292a85327aa6309c9fd70ceb606" kindref="member" tooltip="Substitute val for rvc.">condition</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;RQ<sp/>);</highlight></codeline>
<codeline lineno="242"><highlight class="normal">};</highlight></codeline>
<codeline lineno="243"><highlight class="normal"></highlight></codeline>
<codeline lineno="248" refid="classKFcondR" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classKFcondR" kindref="compound" tooltip="Kalman Filter with conditional diagonal matrices R and Q.">KFcondR</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;ldmat&gt;,<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classBMcond" kindref="compound" tooltip="Conditional Bayesian Filter.">BMcond</ref><sp/>{</highlight></codeline>
<codeline lineno="249"><highlight class="normal"></highlight><highlight class="comment">//protected:</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="250"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="252" refid="classKFcondR_1d2acbb8e66c7ee592b1a9da5b429a69e" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKFcondR_1d2acbb8e66c7ee592b1a9da5b429a69e" kindref="member" tooltip="Default constructor.">KFcondR</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref>,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" kindref="member" tooltip="Indetifier of exogeneous rv.">rvu</ref>,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvR<sp/>)<sp/>:<sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;<ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref>&gt;<sp/>(<sp/>rvx,<sp/>rvy,rvu<sp/>),<ref refid="classBMcond" kindref="compound" tooltip="Conditional Bayesian Filter.">BMcond</ref><sp/>(<sp/>rvR<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="253"><highlight class="normal"></highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKFcondR_18c0721e47879bb8840d829db7a174a7f" kindref="member" tooltip="Substitute val for rvc.">condition</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;<ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref><sp/>);</highlight></codeline>
<codeline lineno="255"><highlight class="normal">};</highlight></codeline>
<codeline lineno="256"><highlight class="normal"></highlight></codeline>
<codeline lineno="258"><highlight class="normal"></highlight></codeline>
<codeline lineno="259"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="260" refid="classKalman_1ce38e31810aea4db45a83ad05eaba009" refkind="member"><highlight class="normal"><ref refid="classKalman_13d56b0a97b8c1e25fdd3b10eef3c2ad3" kindref="member" tooltip="Default constructor.">Kalman&lt;sq_T&gt;::Kalman</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman&lt;sq_T&gt;</ref><sp/>&amp;K0<sp/>)<sp/>:<sp/><ref refid="classBM" kindref="compound" tooltip="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</ref><sp/>(<sp/>K0.rv<sp/>),rvy<sp/>(<sp/>K0.rvy<sp/>),rvu<sp/>(<sp/>K0.rvu<sp/>),</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dimx<sp/>(<sp/>rv.count()<sp/>),<sp/>dimy<sp/>(<sp/>rvy.count()<sp/>),dimu<sp/>(<sp/>rvu.count()<sp/>),</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>dimx,dimx<sp/>),<sp/>B<sp/>(<sp/>dimx,dimu<sp/>),<sp/>C<sp/>(<sp/>dimy,dimx<sp/>),<sp/>D<sp/>(<sp/>dimy,dimu<sp/>),</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Q(dimx),<sp/>R(dimy),</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>est<sp/>(<sp/>rv<sp/>),<sp/>fy<sp/>(<sp/>rvy<sp/>),<sp/>_yp(fy._mu()),_Ry(fy._R()),<sp/>_mu(est._mu()),<sp/>_P(est._R())<sp/>{</highlight></codeline>
<codeline lineno="265"><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;<ref refid="classKalman_1239b28a0380946f5749b2f8d2807f93a" kindref="member" tooltip="Set parameters with check of relevance.">set_parameters</ref><sp/>(<sp/>K0.<ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref>,<sp/>K0.<ref refid="classKalman_1dc87704284a6c0bca13bf51f4345a50a" kindref="member" tooltip="Matrix B.">B</ref>,<sp/>K0.<ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>,<sp/>K0.<ref refid="classKalman_1d69f774ba3335c970c1c5b1d182f4dd1" kindref="member" tooltip="Matrix D.">D</ref>,<sp/>K0.<ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref>,<sp/>K0.<ref refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" kindref="member" tooltip="Matrix Q in square-root form.">Q</ref><sp/>);</highlight></codeline>
<codeline lineno="267"><highlight class="normal"></highlight></codeline>
<codeline lineno="268"><highlight class="normal"></highlight><highlight class="comment">//<sp/>copy<sp/>values<sp/>in<sp/>pointers</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref><sp/>=<sp/>K0.<ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>;</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref><sp/>=<sp/>K0.<ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>;</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref><sp/>=<sp/>K0.<ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref>;</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref><sp/>=<sp/>K0.<ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref>;</highlight></codeline>
<codeline lineno="273"><highlight class="normal"></highlight></codeline>
<codeline lineno="274"><highlight class="normal">}</highlight></codeline>
<codeline lineno="275"><highlight class="normal"></highlight></codeline>
<codeline lineno="276"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="277" refid="classKalman_13d56b0a97b8c1e25fdd3b10eef3c2ad3" refkind="member"><highlight class="normal"><ref refid="classKalman_13d56b0a97b8c1e25fdd3b10eef3c2ad3" kindref="member" tooltip="Default constructor.">Kalman&lt;sq_T&gt;::Kalman</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvy0,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvu0<sp/>)<sp/>:<sp/><ref refid="classBM" kindref="compound" tooltip="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</ref><sp/>(<sp/>rvx<sp/>),<ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref><sp/>(<sp/>rvy0<sp/>),<ref refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" kindref="member" tooltip="Indetifier of exogeneous rv.">rvu</ref><sp/>(<sp/>rvu0<sp/>),</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref><sp/>(<sp/>rvx.count()<sp/>),<sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref><sp/>(<sp/><ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref>.count()<sp/>),<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>(<sp/><ref refid="classKalman_144a16ffd5ac1e6e39bae34fea9e1e498" kindref="member" tooltip="Indetifier of exogeneous rv.">rvu</ref>.count()<sp/>),</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref><sp/>(<sp/><ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>,<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref><sp/>),<sp/><ref refid="classKalman_1dc87704284a6c0bca13bf51f4345a50a" kindref="member" tooltip="Matrix B.">B</ref><sp/>(<sp/><ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>,<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>),<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref><sp/>(<sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>,<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref><sp/>),<sp/><ref refid="classKalman_1d69f774ba3335c970c1c5b1d182f4dd1" kindref="member" tooltip="Matrix D.">D</ref><sp/>(<sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>,<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>),</highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" kindref="member" tooltip="Matrix Q in square-root form.">Q</ref>(<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>),<sp/><ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref><sp/>(<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>),</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" kindref="member" tooltip="posterior density on $x_t$">est</ref><sp/>(<sp/>rvx<sp/>),<sp/><ref refid="classKalman_1e580ab06483952bd03f2e651763e184f" kindref="member" tooltip="preditive density on $y_t$">fy</ref><sp/>(<sp/><ref refid="classKalman_17501230c2fafa3655887d2da23b3184c" kindref="member" tooltip="Indetifier of output rv.">rvy</ref><sp/>),<sp/><sp/><ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref>(<ref refid="classKalman_1e580ab06483952bd03f2e651763e184f" kindref="member" tooltip="preditive density on $y_t$">fy</ref>.<ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>()),<ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref>(<ref refid="classKalman_1e580ab06483952bd03f2e651763e184f" kindref="member" tooltip="preditive density on $y_t$">fy</ref>._R()),<ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>(<ref refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" kindref="member" tooltip="posterior density on $x_t$">est</ref>.<ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>()),<sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>(<ref refid="classKalman_15568c74bac67ae6d3b1061dba60c9424" kindref="member" tooltip="posterior density on $x_t$">est</ref>._R())<sp/>{</highlight></codeline>
<codeline lineno="282"><highlight class="normal">};</highlight></codeline>
<codeline lineno="283"><highlight class="normal"></highlight></codeline>
<codeline lineno="284"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="285" refid="classKalman_1239b28a0380946f5749b2f8d2807f93a" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalman_1239b28a0380946f5749b2f8d2807f93a" kindref="member" tooltip="Set parameters with check of relevance.">Kalman&lt;sq_T&gt;::set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;A0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><sp/>mat<sp/>&amp;B0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;D0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;R0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;Q0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>A0.cols()<sp/>==<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>,<sp/></highlight><highlight class="stringliteral">&quot;Kalman:<sp/>A<sp/>is<sp/>not<sp/>square&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>B0.rows()<sp/>==<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>,<sp/></highlight><highlight class="stringliteral">&quot;Kalman:<sp/>B<sp/>is<sp/>not<sp/>compatible&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>C0.cols()<sp/>==<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref>,<sp/></highlight><highlight class="stringliteral">&quot;Kalman:<sp/>C<sp/>is<sp/>not<sp/>square&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>(<sp/>D0.rows()<sp/>==<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref><sp/>)<sp/>||<sp/>(<sp/>D0.cols()<sp/>==<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>),<sp/></highlight><highlight class="stringliteral">&quot;Kalman:<sp/>D<sp/>is<sp/>not<sp/>compatible&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>(<sp/>R0.cols()<sp/>==<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref><sp/>)<sp/>||<sp/>(<sp/>R0.rows()<sp/>==<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref><sp/>),<sp/></highlight><highlight class="stringliteral">&quot;Kalman:<sp/>R<sp/>is<sp/>not<sp/>compatible&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>(<sp/>Q0.cols()<sp/>==<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref><sp/>)<sp/>||<sp/>(<sp/>Q0.rows()<sp/>==<ref refid="classKalman_139c8c403b46fa3b8c7da77cb2e3729eb" kindref="member" tooltip="cache of rv.count()">dimx</ref><sp/>),<sp/></highlight><highlight class="stringliteral">&quot;Kalman:<sp/>Q<sp/>is<sp/>not<sp/>compatible&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="292"><highlight class="normal"></highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref><sp/>=<sp/>A0;</highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1dc87704284a6c0bca13bf51f4345a50a" kindref="member" tooltip="Matrix B.">B</ref><sp/>=<sp/>B0;</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref><sp/>=<sp/>C0;</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1d69f774ba3335c970c1c5b1d182f4dd1" kindref="member" tooltip="Matrix D.">D</ref><sp/>=<sp/>D0;</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref><sp/>=<sp/>R0;</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" kindref="member" tooltip="Matrix Q in square-root form.">Q</ref><sp/>=<sp/>Q0;</highlight></codeline>
<codeline lineno="299"><highlight class="normal">}</highlight></codeline>
<codeline lineno="300"><highlight class="normal"></highlight></codeline>
<codeline lineno="301"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="302" refid="classKalman_17750ffd73f261828a32c18aaeb65c75c" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classKalman_17750ffd73f261828a32c18aaeb65c75c" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">Kalman&lt;sq_T&gt;::bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>dt.length()<sp/>==<sp/>(<sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>),</highlight><highlight class="stringliteral">&quot;KalmanFull::bayes<sp/>wrong<sp/>size<sp/>of<sp/>dt&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="304"><highlight class="normal"></highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/>iRy(<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>);</highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>u<sp/>=<sp/>dt.get<sp/>(<sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>,<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref>-1<sp/>);</highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>y<sp/>=<sp/>dt.get<sp/>(<sp/>0,<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>-1<sp/>);</highlight></codeline>
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Time<sp/>update</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref><sp/>=<sp/><ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref>*<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref><sp/>+<sp/><ref refid="classKalman_1dc87704284a6c0bca13bf51f4345a50a" kindref="member" tooltip="Matrix B.">B</ref>*u;</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//P<sp/><sp/>=<sp/>A*P*A.transpose()<sp/>+<sp/>Q;<sp/>in<sp/>sq_T</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>.mult_sym<sp/>(<sp/><ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref><sp/>);</highlight></codeline>
<codeline lineno="312"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref><sp/><sp/>+=<ref refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" kindref="member" tooltip="Matrix Q in square-root form.">Q</ref>;</highlight></codeline>
<codeline lineno="313"><highlight class="normal"></highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Data<sp/>update</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//_Ry<sp/>=<sp/>C*P*C.transpose()<sp/>+<sp/>R;<sp/>in<sp/>sq_T</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>.mult_sym<sp/>(<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>,<sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref><sp/>);</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref><sp/><sp/>+=<ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref>;</highlight></codeline>
<codeline lineno="318"><highlight class="normal"></highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Pfull<sp/>=<sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>.to_mat();</highlight></codeline>
<codeline lineno="320"><highlight class="normal"></highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref>.inv<sp/>(<sp/>iRy<sp/>);<sp/></highlight><highlight class="comment">//<sp/>result<sp/>is<sp/>in<sp/>_iRy;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1d422f51467c7a06174af2476d2826132" kindref="member" tooltip="placeholder for Kalman gain">_K</ref><sp/>=<sp/>Pfull*<ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>.transpose()<sp/>*<sp/>(<sp/>iRy.to_mat()<sp/>);</highlight></codeline>
<codeline lineno="323"><highlight class="normal"></highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/>pom<sp/>(<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>)<sp/>Pfull.rows()<sp/>);</highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>iRy.mult_sym_t<sp/>(<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>*Pfull,pom<sp/>);</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref><sp/>)<sp/>-=<sp/>pom;<sp/></highlight><highlight class="comment">//<sp/>P<sp/>=<sp/>P<sp/>-PC&apos;iRy*CP;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref><sp/>)<sp/>=<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>*<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref><sp/><sp/>+<ref refid="classKalman_1d69f774ba3335c970c1c5b1d182f4dd1" kindref="member" tooltip="Matrix D.">D</ref>*u;<sp/></highlight><highlight class="comment">//y<sp/>prediction</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref><sp/>)<sp/>+=<sp/><ref refid="classKalman_1d422f51467c7a06174af2476d2826132" kindref="member" tooltip="placeholder for Kalman gain">_K</ref>*<sp/>(<sp/>y-<sp/><ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref><sp/><sp/>);</highlight></codeline>
<codeline lineno="329"><highlight class="normal"></highlight></codeline>
<codeline lineno="330"><highlight class="normal"></highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/><ref refid="classBM_1bf6fb59b30141074f8ee1e2f43d03129" kindref="member" tooltip="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</ref>==</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>)<sp/>{<sp/></highlight><highlight class="comment">//likelihood<sp/>of<sp/>observation<sp/>y</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classBM_15623fef6572a08c2b53b8c87b82dc979" kindref="member" tooltip="Logarithm of marginalized data likelihood.">ll</ref>=<ref refid="classKalman_1e580ab06483952bd03f2e651763e184f" kindref="member" tooltip="preditive density on $y_t$">fy</ref>.evalpdflog<sp/>(<sp/>y<sp/>);</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="334"><highlight class="normal"></highlight></codeline>
<codeline lineno="335"><highlight class="normal"></highlight><highlight class="comment">//cout<sp/>&lt;&lt;<sp/>&quot;y:<sp/>&quot;<sp/>&lt;&lt;<sp/>y-(*_yp)<sp/>&lt;&lt;&quot;<sp/>R:<sp/>&quot;<sp/>&lt;&lt;<sp/>_Ry-&gt;to_mat()<sp/>&lt;&lt;<sp/>&quot;<sp/>iR:<sp/>&quot;<sp/>&lt;&lt;<sp/>_iRy-&gt;to_mat()<sp/>&lt;&lt;<sp/>&quot;<sp/>ll:<sp/>&quot;<sp/>&lt;&lt;<sp/>ll<sp/>&lt;&lt;endl;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="336"><highlight class="normal"></highlight></codeline>
<codeline lineno="337"><highlight class="normal">};</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/></highlight></codeline>
<codeline lineno="339"><highlight class="normal"></highlight></codeline>
<codeline lineno="340"><highlight class="normal"></highlight></codeline>
<codeline lineno="341"><highlight class="normal"></highlight><highlight class="comment">//TODO<sp/>why<sp/>not<sp/>const<sp/>pointer??</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="342"><highlight class="normal"></highlight></codeline>
<codeline lineno="343"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="344" refid="classEKF_1ea4f3254cacf0a92d2a820b1201d049e" refkind="member"><highlight class="normal"><ref refid="classEKF_1ea4f3254cacf0a92d2a820b1201d049e" kindref="member" tooltip="Default constructor.">EKF&lt;sq_T&gt;::EKF</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx0,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvy0,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvu0<sp/>)<sp/>:<sp/><ref refid="classKalman" kindref="compound" tooltip="Kalman filter with covariance matrices in square root form.">Kalman</ref>&lt;sq_T&gt;<sp/>(<sp/>rvx0,rvy0,rvu0<sp/>)<sp/>{}</highlight></codeline>
<codeline lineno="345"><highlight class="normal"></highlight></codeline>
<codeline lineno="346"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="347" refid="classEKF_128d058ae4d24d992d2f055419a06ee66" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKF_128d058ae4d24d992d2f055419a06ee66" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">EKF&lt;sq_T&gt;::set_parameters</ref><sp/>(<sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>pfxu0,<sp/><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref>*<sp/>phxu0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>Q0,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>R0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pfxu<sp/>=<sp/>pfxu0;</highlight></codeline>
<codeline lineno="349"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>phxu<sp/>=<sp/>phxu0;</highlight></codeline>
<codeline lineno="350"><highlight class="normal"></highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//initialize<sp/>matrices<sp/>A<sp/>C,<sp/>later,<sp/>these<sp/>will<sp/>be<sp/>only<sp/>updated!</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pfxu-&gt;<ref refid="classdiffbifn_16d217a02d4fa13931258d4bebdd0feb4" kindref="member" tooltip="Evaluates  and writes result into A .">dfdx_cond</ref><sp/>(<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>,zeros<sp/>(<sp/><ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>),<ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref>,</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="353"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>pfxu-&gt;dfdu_cond<sp/>(<sp/>*_mu,zeros<sp/>(<sp/>dimu<sp/>),B,true<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1dc87704284a6c0bca13bf51f4345a50a" kindref="member" tooltip="Matrix B.">B</ref>.clear();</highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>phxu-&gt;<ref refid="classdiffbifn_16d217a02d4fa13931258d4bebdd0feb4" kindref="member" tooltip="Evaluates  and writes result into A .">dfdx_cond</ref><sp/>(<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>,zeros<sp/>(<sp/><ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>),<ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>,</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="356"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>phxu-&gt;dfdu_cond<sp/>(<sp/>*_mu,zeros<sp/>(<sp/>dimu<sp/>),D,true<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1d69f774ba3335c970c1c5b1d182f4dd1" kindref="member" tooltip="Matrix D.">D</ref>.clear();</highlight></codeline>
<codeline lineno="358"><highlight class="normal"></highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref><sp/>=<sp/>R0;</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" kindref="member" tooltip="Matrix Q in square-root form.">Q</ref><sp/>=<sp/>Q0;</highlight></codeline>
<codeline lineno="361"><highlight class="normal">}</highlight></codeline>
<codeline lineno="362"><highlight class="normal"></highlight></codeline>
<codeline lineno="363"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="364" refid="classEKF_1c79c62c9b3e0b56b3aaa1b6f1d9a7af7" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKF_1c79c62c9b3e0b56b3aaa1b6f1d9a7af7" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">EKF&lt;sq_T&gt;::bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>dt.length()<sp/>==<sp/>(<sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref><sp/>),</highlight><highlight class="stringliteral">&quot;KalmanFull::bayes<sp/>wrong<sp/>size<sp/>of<sp/>dt&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="366"><highlight class="normal"></highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/>iRy(<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>,<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>);</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>u<sp/>=<sp/>dt.get<sp/>(<sp/><ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>,<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>+<ref refid="classKalman_1b0153795a1444b6968a86409c778d9ce" kindref="member" tooltip="cache of rvu.count()">dimu</ref>-1<sp/>);</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>y<sp/>=<sp/>dt.get<sp/>(<sp/>0,<ref refid="classKalman_1ba17b956df1e38b31fbbc299c8213b6a" kindref="member" tooltip="cache of rvy.count()">dimy</ref>-1<sp/>);</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Time<sp/>update</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref><sp/>=<sp/>pfxu-&gt;<ref refid="classdiffbifn_1ad7673e16aa1a046b131b24c731c4632" kindref="member" tooltip="Evaluates  (VS: Do we really need common eval? ).">eval</ref><sp/>(<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>,<sp/>u<sp/>);</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pfxu-&gt;<ref refid="classdiffbifn_16d217a02d4fa13931258d4bebdd0feb4" kindref="member" tooltip="Evaluates  and writes result into A .">dfdx_cond</ref><sp/>(<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>,u,<ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref>,</highlight><highlight class="keyword">false</highlight><highlight class="normal"><sp/>);<sp/></highlight><highlight class="comment">//update<sp/>A<sp/>by<sp/>a<sp/>derivative<sp/>of<sp/>fx</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="373"><highlight class="normal"></highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//P<sp/><sp/>=<sp/>A*P*A.transpose()<sp/>+<sp/>Q;<sp/>in<sp/>sq_T</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>.<ref refid="classfsqmat_15530d2756b5d991de755e6121c9a452e" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</ref><sp/>(<sp/><ref refid="classKalman_15e02efe86ee91e9c74b93b425fe060b9" kindref="member" tooltip="Matrix A.">A</ref><sp/>);</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref><sp/>+=<ref refid="classKalman_19b69015c800eb93f3ee49da23a6f55d9" kindref="member" tooltip="Matrix Q in square-root form.">Q</ref>;</highlight></codeline>
<codeline lineno="377"><highlight class="normal"></highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Data<sp/>update</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>phxu-&gt;<ref refid="classdiffbifn_16d217a02d4fa13931258d4bebdd0feb4" kindref="member" tooltip="Evaluates  and writes result into A .">dfdx_cond</ref><sp/>(<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>,u,<ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>,</highlight><highlight class="keyword">false</highlight><highlight class="normal"><sp/>);<sp/></highlight><highlight class="comment">//update<sp/>C<sp/>by<sp/>a<sp/>derivative<sp/>hx</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//_Ry<sp/>=<sp/>C*P*C.transpose()<sp/>+<sp/>R;<sp/>in<sp/>sq_T</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>.<ref refid="classfsqmat_15530d2756b5d991de755e6121c9a452e" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</ref><sp/>(<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>,<sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref><sp/>);</highlight></codeline>
<codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref><sp/>)<sp/>+=<ref refid="classKalman_111d171dc0e0ab111c56a70f98b97b3ec" kindref="member" tooltip="Matrix R in square-root form.">R</ref>;</highlight></codeline>
<codeline lineno="383"><highlight class="normal"></highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Pfull<sp/>=<sp/><ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref>.<ref refid="classfsqmat_1cedf4f048309056f4262c930914dfda8" kindref="member" tooltip="Conversion to full matrix.">to_mat</ref>();</highlight></codeline>
<codeline lineno="385"><highlight class="normal"></highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_145c9f928d2d62e0c884900fb3380f904" kindref="member" tooltip="cache of fy.R">_Ry</ref>.<ref refid="classfsqmat_19fa853e1ca28f2a1a1c43377e798ecb1" kindref="member" tooltip="Matrix inversion preserving the chosen form.">inv</ref><sp/>(<sp/>iRy<sp/>);<sp/></highlight><highlight class="comment">//<sp/>result<sp/>is<sp/>in<sp/>_iRy;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1d422f51467c7a06174af2476d2826132" kindref="member" tooltip="placeholder for Kalman gain">_K</ref><sp/>=<sp/>Pfull*<ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>.transpose()<sp/>*<sp/>(<sp/>iRy.to_mat()<sp/>);</highlight></codeline>
<codeline lineno="388"><highlight class="normal"></highlight></codeline>
<codeline lineno="389"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/>pom<sp/>(<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>)<sp/>Pfull.rows()<sp/>);</highlight></codeline>
<codeline lineno="390"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>iRy.mult_sym_t<sp/>(<sp/><ref refid="classKalman_186a805cd6515872d1132ad0d6eb5dc13" kindref="member" tooltip="Matrix C.">C</ref>*Pfull,pom<sp/>);</highlight></codeline>
<codeline lineno="391"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<ref refid="classKalman_19fb808cc94a4c2652e1fb93be9bb7dcf" kindref="member" tooltip="cache of est.R">_P</ref><sp/>)<sp/>-=<sp/>pom;<sp/></highlight><highlight class="comment">//<sp/>P<sp/>=<sp/>P<sp/>-PC&apos;iRy*CP;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="392"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref><sp/>=<sp/>phxu-&gt;<ref refid="classdiffbifn_1ad7673e16aa1a046b131b24c731c4632" kindref="member" tooltip="Evaluates  (VS: Do we really need common eval? ).">eval</ref><sp/>(<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref>,u<sp/>);<sp/></highlight><highlight class="comment">//y<sp/>prediction</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<sp/><ref refid="classKalman_1fe803a81d2d847b0b1db3c6b29c18061" kindref="member" tooltip="cache of est.mu">_mu</ref><sp/>)<sp/>+=<sp/><ref refid="classKalman_1d422f51467c7a06174af2476d2826132" kindref="member" tooltip="placeholder for Kalman gain">_K</ref>*<sp/>(<sp/>y-<ref refid="classKalman_1764bbc95238eda11fc81c5ebd0b1dcfd" kindref="member" tooltip="cache of fy.mu">_yp</ref><sp/>);</highlight></codeline>
<codeline lineno="394"><highlight class="normal"></highlight></codeline>
<codeline lineno="395"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/><ref refid="classBM_1bf6fb59b30141074f8ee1e2f43d03129" kindref="member" tooltip="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</ref>==</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>)<sp/>{<ref refid="classBM_15623fef6572a08c2b53b8c87b82dc979" kindref="member" tooltip="Logarithm of marginalized data likelihood.">ll</ref>+=<ref refid="classKalman_1e580ab06483952bd03f2e651763e184f" kindref="member" tooltip="preditive density on $y_t$">fy</ref>.<ref refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/>y<sp/>);}</highlight></codeline>
<codeline lineno="396"><highlight class="normal">};</highlight></codeline>
<codeline lineno="397"><highlight class="normal"></highlight></codeline>
<codeline lineno="398"><highlight class="normal"></highlight></codeline>
<codeline lineno="399"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/>//<sp/>KF_H</highlight></codeline>
<codeline lineno="400"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="401"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/bdm/estim/libKF.h"/>
  </compounddef>
</doxygen>
