<?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="libEF_8h" kind="file">
    <compoundname>libEF.h</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="libDC_8h" local="yes">../math/libDC.h</includes>
    <includes refid="libBM_8h" local="yes">libBM.h</includes>
    <includes refid="itpp__ext_8h" local="yes">../itpp_ext.h</includes>
    <includedby refid="arx_8h" local="yes">work/git/mixpp/bdm/estim/arx.h</includedby>
    <includedby refid="libKF_8h" local="yes">work/git/mixpp/bdm/estim/libKF.h</includedby>
    <includedby refid="libPF_8h" local="yes">work/git/mixpp/bdm/estim/libPF.h</includedby>
    <includedby refid="emix_8h" local="yes">work/git/mixpp/bdm/stat/emix.h</includedby>
    <includedby refid="libEF_8cpp" local="yes">work/git/mixpp/bdm/stat/libEF.cpp</includedby>
    <includedby refid="merger_8h" local="yes">work/git/mixpp/bdm/stat/merger.h</includedby>
    <includedby refid="merg__pred_8cpp" local="no">work/git/mixpp/mpdm/merg_pred.cpp</includedby>
    <includedby refid="arx__test_8cpp" local="no">work/git/mixpp/tests/arx_test.cpp</includedby>
    <includedby refid="merger__test_8cpp" local="no">work/git/mixpp/tests/merger_test.cpp</includedby>
    <includedby refid="testEpdf_8cpp" local="no">work/git/mixpp/tests/testEpdf.cpp</includedby>
    <includedby refid="testPF_8cpp" local="no">work/git/mixpp/tests/testPF.cpp</includedby>
    <includedby refid="testResample_8cpp" local="no">work/git/mixpp/tests/testResample.cpp</includedby>
    <includedby refid="testSmp_8cpp" local="no">work/git/mixpp/tests/testSmp.cpp</includedby>
    <incdepgraph>
      <node id="394">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="392" relation="include">
        </childnode>
      </node>
      <node id="395">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="392" relation="include">
        </childnode>
      </node>
      <node id="391">
        <label>work/git/mixpp/bdm/stat/libEF.h</label>
        <link refid="libEF.h"/>
        <childnode refid="392" relation="include">
        </childnode>
        <childnode refid="393" relation="include">
        </childnode>
        <childnode refid="394" relation="include">
        </childnode>
        <childnode refid="395" relation="include">
        </childnode>
      </node>
      <node id="392">
        <label>itpp/itbase.h</label>
      </node>
      <node id="393">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="392" relation="include">
        </childnode>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="406">
        <label>work/git/mixpp/bdm/stat/merger.h</label>
        <link refid="merger_8h"/>
      </node>
      <node id="405">
        <label>work/git/mixpp/bdm/stat/emix.h</label>
        <link refid="emix_8h"/>
        <childnode refid="406" relation="include">
        </childnode>
        <childnode refid="401" relation="include">
        </childnode>
      </node>
      <node id="400">
        <label>work/git/mixpp/bdm/estim/ekf_templ.h</label>
        <link refid="ekf__templ_8h"/>
        <childnode refid="401" relation="include">
        </childnode>
      </node>
      <node id="396">
        <label>work/git/mixpp/bdm/stat/libEF.h</label>
        <link refid="libEF.h"/>
        <childnode refid="397" relation="include">
        </childnode>
        <childnode refid="399" relation="include">
        </childnode>
        <childnode refid="404" relation="include">
        </childnode>
        <childnode refid="405" relation="include">
        </childnode>
        <childnode refid="406" relation="include">
        </childnode>
      </node>
      <node id="404">
        <label>work/git/mixpp/bdm/estim/libPF.h</label>
        <link refid="libPF_8h"/>
        <childnode refid="401" relation="include">
        </childnode>
      </node>
      <node id="397">
        <label>work/git/mixpp/bdm/estim/arx.h</label>
        <link refid="arx_8h"/>
        <childnode refid="398" relation="include">
        </childnode>
      </node>
      <node id="398">
        <label>work/git/mixpp/pmsm/sim_var_arx.cpp</label>
        <link refid="sim__var__arx_8cpp"/>
      </node>
      <node id="402">
        <label>work/git/mixpp/pmsm/sim_var.cpp</label>
        <link refid="sim__var_8cpp"/>
      </node>
      <node id="399">
        <label>work/git/mixpp/bdm/estim/libKF.h</label>
        <link refid="libKF_8h"/>
        <childnode refid="400" relation="include">
        </childnode>
        <childnode refid="402" relation="include">
        </childnode>
        <childnode refid="403" relation="include">
        </childnode>
      </node>
      <node id="403">
        <label>work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.h</label>
        <link refid="ekf__obj_8h"/>
      </node>
      <node id="401">
        <label>work/git/mixpp/pmsm/pmsm_mix.cpp</label>
        <link refid="pmsm__mix_8cpp"/>
      </node>
    </invincdepgraph>
    <innerclass refid="classeEF" prot="public">eEF</innerclass>
    <innerclass refid="classmEF" prot="public">mEF</innerclass>
    <innerclass refid="classenorm" prot="public">enorm</innerclass>
    <innerclass refid="classegiw" prot="public">egiw</innerclass>
    <innerclass refid="classegamma" prot="public">egamma</innerclass>
    <innerclass refid="classeuni" prot="public">euni</innerclass>
    <innerclass refid="classmlnorm" prot="public">mlnorm</innerclass>
    <innerclass refid="classmgamma" prot="public">mgamma</innerclass>
    <innerclass refid="classmgamma__fix" prot="public">mgamma_fix</innerclass>
    <innerclass refid="classeEmp" prot="public">eEmp</innerclass>
      <sectiondef kind="enum">
      <memberdef kind="enum" id="libEF_8h_199497a3ff630f761cf6bff7babd23212" prot="public" static="no">
        <name>RESAMPLING_METHOD</name>
        <enumvalue id="libEF_8h_199497a3ff630f761cf6bff7babd2321214208a39f9e86f55ce751ee7b5eb3e42" prot="public">
          <name>MULTINOMIAL</name>
          <initializer> 0</initializer>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="libEF_8h_199497a3ff630f761cf6bff7babd2321219c32847f57702dd84a920075b90b2d7" prot="public">
          <name>STRATIFIED</name>
          <initializer> 1</initializer>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="libEF_8h_199497a3ff630f761cf6bff7babd23212a792a4f45646dddc20d6b942ac7e7a71" prot="public">
          <name>SYSTEMATIC</name>
          <initializer> 3</initializer>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <briefdescription>
<para>Switch between various resampling methods. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="305" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" bodystart="305" bodyend="305"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="var">
      <memberdef kind="variable" id="libEF_8h_12ae7dcdfebede774dd1b1f16cad10dd9" prot="public" static="no" mutable="no">
        <type>Uniform_RNG</type>
        <definition>Uniform_RNG UniRNG</definition>
        <argsstring></argsstring>
        <name>UniRNG</name>
        <briefdescription>
<para>Global Uniform_RNG. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="26" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.cpp" bodystart="8" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="libEF_8h_1395c5925c8792aef3be4c360e91526c0" prot="public" static="no" mutable="no">
        <type>Normal_RNG</type>
        <definition>Normal_RNG NorRNG</definition>
        <argsstring></argsstring>
        <name>NorRNG</name>
        <briefdescription>
<para>Global Normal_RNG. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="28" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.cpp" bodystart="9" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="libEF_8h_1884a8348c92a49725b78e2b6ab0bb802" prot="public" static="no" mutable="no">
        <type><ref refid="classitpp_1_1Gamma__RNG" kindref="compound">Gamma_RNG</ref></type>
        <definition>Gamma_RNG GamRNG</definition>
        <argsstring></argsstring>
        <name>GamRNG</name>
        <briefdescription>
<para>Global Gamma_RNG. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="30" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.cpp" bodystart="10" bodyend="-1"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
<para>Probability distributions for Exponential Family models. </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/>EF_H</highlight></codeline>
<codeline lineno="14"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>EF_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;../math/libDC.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="libBM_8h" kindref="compound" tooltip="Bayesian Models (bm) that use Bayes rule to learn from observations.">libBM.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../itpp_ext.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="comment">//#include<sp/>&lt;std&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="keyword">extern</highlight><highlight class="normal"><sp/>Uniform_RNG<sp/>UniRNG;</highlight></codeline>
<codeline lineno="28"><highlight class="keyword">extern</highlight><highlight class="normal"><sp/>Normal_RNG<sp/>NorRNG;</highlight></codeline>
<codeline lineno="30"><highlight class="keyword">extern</highlight><highlight class="normal"><sp/><ref refid="classitpp_1_1Gamma__RNG" kindref="compound" tooltip="Gamma distribution.">Gamma_RNG</ref><sp/>GamRNG;</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="38" refid="classeEF" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>{</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>eEF()<sp/>:epdf()<sp/>{};</highlight></codeline>
<codeline lineno="42" refid="classeEF_17e3c63655e8375c76bf1f421245427a7" refkind="member"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeEF_17e3c63655e8375c76bf1f421245427a7" kindref="member" tooltip="default constructor">eEF</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>)<sp/>:<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">virtual</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeEF_169e5680dac10375d62520d26c672477d" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>()</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>=0;</highlight></codeline>
<codeline lineno="46" refid="classeEF_1fd88bc35550ec8fe9281d358216d0fcf" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">virtual</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classeEF_1fd88bc35550ec8fe9281d358216d0fcf" kindref="member" tooltip="TODO decide if it is really needed.">tupdate</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>phi,<sp/>mat<sp/>&amp;vbar,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nubar<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="48" refid="classeEF_15863718c3b2fb1496dece10c5b745d5c" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">virtual</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classeEF_15863718c3b2fb1496dece10c5b745d5c" kindref="member" tooltip="TODO decide if it is really needed.">dupdate</ref><sp/>(<sp/>mat<sp/>&amp;v,</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu=1.0<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="49"><highlight class="normal">};</highlight></codeline>
<codeline lineno="50"><highlight class="normal"></highlight></codeline>
<codeline lineno="57" refid="classmEF" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmpdf" kindref="compound" tooltip="Conditional probability density, e.g. modeling some dependencies.">mpdf</ref><sp/>{</highlight></codeline>
<codeline lineno="58"><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="61" refid="classmEF_18bf51fe8654d7b83c8c8afeb19409d4f" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmEF_18bf51fe8654d7b83c8c8afeb19409d4f" kindref="member" tooltip="Default constructor.">mEF</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rvc0<sp/>)<sp/>:<ref refid="classmpdf" kindref="compound" tooltip="Conditional probability density, e.g. modeling some dependencies.">mpdf</ref><sp/>(<sp/>rv0,rvc0<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="62"><highlight class="normal">};</highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight></codeline>
<codeline lineno="69"><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="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="71" refid="classenorm" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classenorm" kindref="compound" tooltip="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>{</highlight></codeline>
<codeline lineno="72"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="74" refid="classenorm_171fde0d54bba147e00f612577f95ad20" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;</highlight></codeline>
<codeline lineno="76" refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>;</highlight></codeline>
<codeline lineno="78" refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" 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="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>;</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>enorm()<sp/>:eEF()<sp/>{};</highlight></codeline>
<codeline lineno="82"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm_17b5cb487a2570e8109bfdc0df149aa06" kindref="member" tooltip="Default constructor.">enorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>);</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_11394a65caa6e00d42e00cc99b12227af" kindref="member" tooltip="Set mean value mu and covariance R.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;<ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;<ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref><sp/>);</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15b5fd142b6b17ea334597960e3fe126a" kindref="member" tooltip="tupdate in exponential form (not really handy)">tupdate</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>phi,<sp/>mat<sp/>&amp;vbar,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nubar<sp/>);</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15bf185e31e5954fceb90ada3debd2ff2" kindref="member" tooltip="dupdate in exponential form (not really handy)">dupdate</ref><sp/>(<sp/>mat<sp/>&amp;v,</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu=1.0<sp/>);</highlight></codeline>
<codeline lineno="89"><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>N<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b9e1dfd33692d7b3f1a59f17b0e61bd0" kindref="member" tooltip="Compute probability of argument val.">eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>;</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref><sp/>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="96" refid="classenorm_150fa84da7bae02f7af17a98f37566899" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classenorm_150fa84da7bae02f7af17a98f37566899" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;}</highlight></codeline>
<codeline lineno="97"><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><highlight class="normal"></highlight><highlight class="comment">//Access<sp/>methods</highlight></codeline>
<codeline lineno="100" refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" refkind="member"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&amp;<sp/><ref refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" kindref="member" tooltip="returns a pointer to the internal mean value. Use with Care!">_mu</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;}</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="103" refid="classenorm_1d892a38f03be12e572ea57d9689cef6b" 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="classenorm_1d892a38f03be12e572ea57d9689cef6b" kindref="member" tooltip="access function">set_mu</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>mu0)<sp/>{<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>=mu0;}</highlight></codeline>
<codeline lineno="104"><highlight class="normal"></highlight></codeline>
<codeline lineno="106" refid="classenorm_17a5034b25771a84450a990d10fc40ac9" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T&amp;<sp/><ref refid="classenorm_17a5034b25771a84450a990d10fc40ac9" kindref="member" tooltip="returns pointers to the internal variance and its inverse. Use with Care!">_R</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>;}</highlight></codeline>
<codeline lineno="107"><highlight class="normal"></highlight></codeline>
<codeline lineno="109" refid="classenorm_19b9f58dc86affa23511c246887420658" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classenorm_19b9f58dc86affa23511c246887420658" kindref="member" tooltip="access method">getR</ref><sp/>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.to_mat();}</highlight></codeline>
<codeline lineno="110"><highlight class="normal">};</highlight></codeline>
<codeline lineno="111"><highlight class="normal"></highlight></codeline>
<codeline lineno="117" refid="classegiw" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>{</highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="120" refid="classegiw_1f343d03ede89db820edf44a6297fa442" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/><ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>;</highlight></codeline>
<codeline lineno="122" refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" kindref="member" tooltip="Number of data records (degrees of freedom) of sufficient statistics.">nu</ref>;</highlight></codeline>
<codeline lineno="123"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="125" refid="classegiw_1c52a2173c6eb1490edce9c6c7c05d60b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classegiw_1c52a2173c6eb1490edce9c6c7c05d60b" kindref="member" tooltip="Default constructor.">egiw</ref>(<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>,<sp/>mat<sp/>V0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu0):<sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref>(rv),<sp/><ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>(V0),<sp/><ref refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" kindref="member" tooltip="Number of data records (degrees of freedom) of sufficient statistics.">nu</ref>(nu0)<sp/>{</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(rv.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()==<ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>.<ref refid="classldmat_196dfb21865db4f5bd36fa70f9b0b1163" kindref="member" tooltip="access function">rows</ref>(),</highlight><highlight class="stringliteral">&quot;Incompatible<sp/>V0.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="128"><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegiw_13d2c1f2ba0f9966781f1e0ae695e8a6f" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegiw_16deb0ff2859f41ef7cbdf6a842cabb29" kindref="member" tooltip="return expected value">mean</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegiw_1425cbc53b377274e28c6add942bab62d" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref><sp/>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="133"><highlight class="normal"></highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Access</highlight></codeline>
<codeline lineno="136" refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" refkind="member"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref>&amp;<sp/><ref refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_V</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>;}</highlight></codeline>
<codeline lineno="138" refid="classegiw_108029c481ff95d24f093df0573879afe" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal">&amp;<sp/><ref refid="classegiw_108029c481ff95d24f093df0573879afe" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_nu</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" kindref="member" tooltip="Number of data records (degrees of freedom) of sufficient statistics.">nu</ref>;}</highlight></codeline>
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
<codeline lineno="140"><highlight class="normal">};</highlight></codeline>
<codeline lineno="141"><highlight class="normal"></highlight></codeline>
<codeline lineno="151" refid="classegamma" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classegamma" kindref="compound" tooltip="Gamma posterior density.">egamma</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>{</highlight></codeline>
<codeline lineno="152"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="154" refid="classegamma_1376cebd8932546c440f21b182910b01b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref>;</highlight></codeline>
<codeline lineno="156" refid="classegamma_1cfc5f136467488a421ab22f886323790" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>;</highlight></codeline>
<codeline lineno="157"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/>:</highlight></codeline>
<codeline lineno="159" refid="classegamma_14b1d34f3b244ea51a58ec10c468788c1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classegamma_14b1d34f3b244ea51a58ec10c468788c1" kindref="member" tooltip="Default constructor.">egamma</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>)<sp/>:<ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>(<sp/>rv<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="161" refid="classegamma_18e348b89be82b70471fe8c5630f61339" 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="classegamma_18e348b89be82b70471fe8c5630f61339" kindref="member" tooltip="Sets parameters.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;a,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;b<sp/>)<sp/>{<ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref>=a,<ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>=b;};</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_18e10c0021b5dfdd9cb62c6959b5ef425" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="164"><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>sample<sp/>(<sp/>int<sp/>N<sp/>)<sp/>const;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegamma_1de84faac8f9799dfe2777ddbedf997ef" kindref="member" tooltip="TODO: is it used anywhere?">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegamma_1d6dbbdb72360f9e54d64501f80318bb6" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref><sp/>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="168" refid="classegamma_144445c56e60b91b377f207f8d5089790" 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="classegamma_144445c56e60b91b377f207f8d5089790" kindref="member" tooltip="Returns poiter to alpha and beta. Potentially dengerous: use with care!">_param</ref><sp/>(<sp/>vec*<sp/>&amp;a,<sp/>vec*<sp/>&amp;b<sp/>)<sp/>{a=&amp;<ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref>;b=&amp;<ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>;};</highlight></codeline>
<codeline lineno="169" refid="classegamma_16ab5ba56f7cdb2e5921c3e77524fa50a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_16ab5ba56f7cdb2e5921c3e77524fa50a" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{vec<sp/>pom<sp/>(<sp/><ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref><sp/>);<sp/>pom/=<ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>;<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>pom;}</highlight></codeline>
<codeline lineno="170"><highlight class="normal">};</highlight></codeline>
<codeline lineno="171"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="173"><highlight class="comment">class<sp/>emix<sp/>:<sp/>public<sp/>epdf<sp/>{</highlight></codeline>
<codeline lineno="174"><highlight class="comment">protected:</highlight></codeline>
<codeline lineno="175"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>int<sp/>n;</highlight></codeline>
<codeline lineno="176"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>&amp;w;</highlight></codeline>
<codeline lineno="177"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array&lt;epdf*&gt;<sp/>Coms;</highlight></codeline>
<codeline lineno="178"><highlight class="comment">public:</highlight></codeline>
<codeline lineno="180"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>emix<sp/>(<sp/>const<sp/>RV<sp/>&amp;rv,<sp/>vec<sp/>&amp;w0):<sp/>epdf(rv),<sp/>n(w0.length()),<sp/>w(w0),<sp/>Coms(n)<sp/>{};</highlight></codeline>
<codeline lineno="181"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>void<sp/>set_parameters(<sp/>int<sp/>&amp;i,<sp/>double<sp/>wi,<sp/>epdf*<sp/>ep){w(i)=wi;Coms(i)=ep;}</highlight></codeline>
<codeline lineno="182"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>mean(){vec<sp/>pom;<sp/>for(int<sp/>i=0;i&lt;n;i++){pom+=Coms(i)-&gt;mean()*w(i);}<sp/>return<sp/>pom;};</highlight></codeline>
<codeline lineno="183"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>sample()<sp/>{it_error<sp/>(<sp/>&quot;Not<sp/>implemented&quot;<sp/>);return<sp/>0;}</highlight></codeline>
<codeline lineno="184"><highlight class="comment">};</highlight></codeline>
<codeline lineno="185"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="186"><highlight class="normal"></highlight></codeline>
<codeline lineno="188"><highlight class="normal"></highlight></codeline>
<codeline lineno="189" refid="classeuni" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classeuni" kindref="compound" tooltip="Uniform distributed density on a rectangular support.">euni</ref>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>{</highlight></codeline>
<codeline lineno="190"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="192" refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref>;</highlight></codeline>
<codeline lineno="194" refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" kindref="member" tooltip="upper bound on support">high</ref>;</highlight></codeline>
<codeline lineno="196" refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref>;</highlight></codeline>
<codeline lineno="198" refid="classeuni_163105490e946e43372d6187ad1bafdda" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref>;</highlight></codeline>
<codeline lineno="200" refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" kindref="member" tooltip="cache of log( nk )">lnk</ref>;</highlight></codeline>
<codeline lineno="201"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="203" refid="classeuni_12537a6c239cff52e3ba814851a1116cd" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_12537a6c239cff52e3ba814851a1116cd" kindref="member" tooltip="Defualt constructor.">euni</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>)<sp/>:<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv<sp/>)<sp/>{}</highlight></codeline>
<codeline lineno="204" refid="classeuni_12723d4992900b5c5495bfa03628195ed" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_12723d4992900b5c5495bfa03628195ed" kindref="member" tooltip="Compute probability of argument val.">eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/><sp/></highlight><highlight class="normal">{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref>;}</highlight></codeline>
<codeline lineno="205" refid="classeuni_106af95d514a6623ad4688bd2ad50ad71" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_106af95d514a6623ad4688bd2ad50ad71" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/><sp/></highlight><highlight class="normal">{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" kindref="member" tooltip="cache of log( nk )">lnk</ref>;}</highlight></codeline>
<codeline lineno="206" refid="classeuni_14a0e09392be17beaee120ba98fc038cd" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_14a0e09392be17beaee120ba98fc038cd" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()<sp/>);<sp/></highlight></codeline>
<codeline lineno="208"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>#pragma<sp/>omp<sp/>critical</highlight></codeline>
<codeline lineno="209"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>UniRNG.sample_vector<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>(),smp<sp/>);</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref>+elem_mult(<ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref>,smp);</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="213" refid="classeuni_14fd7c6a05100616ad16ece405cad7bf2" 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="classeuni_14fd7c6a05100616ad16ece405cad7bf2" kindref="member" tooltip="set values of low and high ">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;low0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;high0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref><sp/>=<sp/>high0-low0;</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>min<sp/>(<sp/><ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref><sp/>)<sp/>&gt;0.0,</highlight><highlight class="stringliteral">&quot;bad<sp/>support&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref><sp/>=<sp/>low0;</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" kindref="member" tooltip="upper bound on support">high</ref><sp/>=<sp/>high0;</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref><sp/>=<sp/>prod<sp/>(<sp/>1.0/<ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref><sp/>);</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" kindref="member" tooltip="cache of log( nk )">lnk</ref><sp/>=<sp/>log<sp/>(<sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref><sp/>);</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="221" refid="classeuni_18050087e421a9cfd1b4b1f8bd33b1cc1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_18050087e421a9cfd1b4b1f8bd33b1cc1" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{vec<sp/>pom=<ref refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" kindref="member" tooltip="upper bound on support">high</ref>;<sp/>pom-=<ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref>;<sp/>pom/=2.0;<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>pom;}</highlight></codeline>
<codeline lineno="222"><highlight class="normal">};</highlight></codeline>
<codeline lineno="223"><highlight class="normal"></highlight></codeline>
<codeline lineno="224"><highlight class="normal"></highlight></codeline>
<codeline lineno="230"><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="231" refid="classmlnorm" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmlnorm" kindref="compound" tooltip="Normal distributed linear function with linear function of mean value;.">mlnorm</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>{</highlight></codeline>
<codeline lineno="233"><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="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>;</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A;</highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&amp;<sp/>_mu;<sp/></highlight><highlight class="comment">//cached<sp/>epdf.mu;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="236"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmlnorm_1f927203b3f31171c5c10ffc7caa797f5" kindref="member" tooltip="Constructor.">mlnorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>,<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classmpdf_1acb7dda792b3cd5576f39fa3129abbab" kindref="member" tooltip="random variable in condition">rvc</ref><sp/>);</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_1b6749030c5d5abcb3eb6898f74cea3c0" kindref="member" tooltip="Set A and R.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><sp/>mat<sp/>&amp;A,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;R<sp/>);</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">samplecond</ref><sp/>(<sp/>vec<sp/>&amp;cond,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>&amp;lik<sp/>);</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">samplecond</ref><sp/>(<sp/>vec<sp/>&amp;cond,<sp/>vec<sp/>&amp;lik,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>);</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">condition</ref><sp/>(<sp/>vec<sp/>&amp;cond<sp/>);</highlight></codeline>
<codeline lineno="247"><highlight class="normal">};</highlight></codeline>
<codeline lineno="248"><highlight class="normal"></highlight></codeline>
<codeline lineno="258" refid="classmgamma" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmgamma" kindref="compound" tooltip="Gamma random walk.">mgamma</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>{</highlight></codeline>
<codeline lineno="259"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="261" refid="classmgamma_1612dbf35c770a780027619aaac2c443e" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classegamma" kindref="compound" tooltip="Gamma posterior density.">egamma</ref><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>;</highlight></codeline>
<codeline lineno="263" refid="classmgamma_143f733cce0245a52363d566099add687" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref>;</highlight></codeline>
<codeline lineno="265" refid="classmgamma_15e90652837448bcc29707e7412f99691" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec*<sp/><ref refid="classmgamma_15e90652837448bcc29707e7412f99691" kindref="member" tooltip="cache of epdf.beta">_beta</ref>;</highlight></codeline>
<codeline lineno="266"><highlight class="normal"></highlight></codeline>
<codeline lineno="267"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma_1af43e61b86900c0398d5c0ffc83b94e6" kindref="member" tooltip="Constructor.">mgamma</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classmpdf_1acb7dda792b3cd5576f39fa3129abbab" kindref="member" tooltip="random variable in condition">rvc</ref><sp/>);</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmgamma_1a9d646cf758a70126dde7c48790b6e94" kindref="member" tooltip="Set value of k.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref><sp/>);</highlight></codeline>
<codeline lineno="272" refid="classmgamma_1a61094c9f7a2d64ea77b130cbc031f97" 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="classmgamma_1a61094c9f7a2d64ea77b130cbc031f97" kindref="member" tooltip="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)<sp/>{*<ref refid="classmgamma_15e90652837448bcc29707e7412f99691" kindref="member" tooltip="cache of epdf.beta">_beta</ref>=<ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref>/val;};</highlight></codeline>
<codeline lineno="273"><highlight class="normal">};</highlight></codeline>
<codeline lineno="274"><highlight class="normal"></highlight></codeline>
<codeline lineno="286" refid="classmgamma__fix" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmgamma__fix" kindref="compound" tooltip="Gamma random walk around a fixed point.">mgamma_fix</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmgamma" kindref="compound" tooltip="Gamma random walk.">mgamma</ref><sp/>{</highlight></codeline>
<codeline lineno="287"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="289" refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" kindref="member" tooltip="parameter l">l</ref>;</highlight></codeline>
<codeline lineno="291" refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref>;</highlight></codeline>
<codeline lineno="292"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="294" refid="classmgamma__fix_1b92c3d2e5fd0381033a072e5ef3bcf80" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma__fix_1b92c3d2e5fd0381033a072e5ef3bcf80" kindref="member" tooltip="Constructor.">mgamma_fix</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classmpdf_1acb7dda792b3cd5576f39fa3129abbab" kindref="member" tooltip="random variable in condition">rvc</ref><sp/>)<sp/>:<sp/><ref refid="classmgamma" kindref="compound" tooltip="Gamma random walk.">mgamma</ref><sp/>(<sp/>rv,rvc<sp/>),<ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref><sp/>(<sp/>rv.count()<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="296" refid="classmgamma__fix_1ec6f846896749e27cb7be9fa48dd1cb1" 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="classmgamma__fix_1ec6f846896749e27cb7be9fa48dd1cb1" kindref="member" tooltip="Set value of k.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>k0<sp/>,<sp/>vec<sp/>ref0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>l0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma_1a9d646cf758a70126dde7c48790b6e94" kindref="member" tooltip="Set value of k.">mgamma::set_parameters</ref><sp/>(<sp/>k0<sp/>);</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref>=pow<sp/>(<sp/>ref0,1.0-l0<sp/>);<ref refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" kindref="member" tooltip="parameter l">l</ref>=l0;</highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="300"><highlight class="normal"></highlight></codeline>
<codeline lineno="301" refid="classmgamma__fix_16ea3931eec7b7da7b693e45981052460" 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="classmgamma__fix_16ea3931eec7b7da7b693e45981052460" kindref="member" tooltip="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)<sp/>{vec<sp/>mean=elem_mult<sp/>(<sp/><ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref>,pow<sp/>(<sp/>val,<ref refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" kindref="member" tooltip="parameter l">l</ref><sp/>)<sp/>);<sp/>*<ref refid="classmgamma_15e90652837448bcc29707e7412f99691" kindref="member" tooltip="cache of epdf.beta">_beta</ref>=<ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref>/mean;};</highlight></codeline>
<codeline lineno="302"><highlight class="normal">};</highlight></codeline>
<codeline lineno="303"><highlight class="normal"></highlight></codeline>
<codeline lineno="305" refid="libEF_8h_199497a3ff630f761cf6bff7babd23212" refkind="member"><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="libEF_8h_199497a3ff630f761cf6bff7babd23212" kindref="member" tooltip="Switch between various resampling methods.">RESAMPLING_METHOD</ref><sp/>{<sp/>MULTINOMIAL<sp/>=<sp/>0,<sp/>STRATIFIED<sp/>=<sp/>1,<sp/>SYSTEMATIC<sp/>=<sp/>3<sp/>};</highlight></codeline>
<codeline lineno="311" refid="classeEmp" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classeEmp" kindref="compound" tooltip="Weighted empirical density.">eEmp</ref>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>{</highlight></codeline>
<codeline lineno="312"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/>:</highlight></codeline>
<codeline lineno="314" refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" 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="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref>;</highlight></codeline>
<codeline lineno="316" refid="classeEmp_1ae78d144404ddba843c93b171b215de8" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref>;</highlight></codeline>
<codeline lineno="318" refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array&lt;vec&gt;<sp/><ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref>;</highlight></codeline>
<codeline lineno="319"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="321" refid="classeEmp_10c04b073ecd0dae3d498e680ae27e9e4" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeEmp_10c04b073ecd0dae3d498e680ae27e9e4" kindref="member" tooltip="Default constructor.">eEmp</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv0<sp/>,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n0<sp/>)<sp/>:<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv0<sp/>),<ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref><sp/>(<sp/>n0<sp/>),<ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref><sp/>(<sp/><ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref><sp/>),<ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref><sp/>(<sp/><ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref><sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classeEmp_16606a656c1b28114f7384c25aaf80e8d" kindref="member" tooltip="Set sample.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;w0,<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>*<sp/>pdf0<sp/>);</highlight></codeline>
<codeline lineno="325" refid="classeEmp_131b2bfb73b72486a5c89f2ab850c7a9b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&amp;<sp/><ref refid="classeEmp_131b2bfb73b72486a5c89f2ab850c7a9b" kindref="member" tooltip="Potentially dangerous, use with care.">_w</ref>()<sp/><sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref>;};</highlight></codeline>
<codeline lineno="327" refid="classeEmp_131b747eca73b16f30370827ba4cc3575" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array&lt;vec&gt;&amp;<sp/><ref refid="classeEmp_131b747eca73b16f30370827ba4cc3575" kindref="member" tooltip="access function">_samples</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref>;};</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/><ref refid="classeEmp_177268292fc4465cb73ddbfb1f2932a59" kindref="member" tooltip="Function performs resampling, i.e. removal of low-weight samples and duplication...">resample</ref><sp/>(<sp/><ref refid="libEF_8h_199497a3ff630f761cf6bff7babd23212" kindref="member" tooltip="Switch between various resampling methods.">RESAMPLING_METHOD</ref><sp/>method<sp/>=<sp/>SYSTEMATIC<sp/>);</highlight></codeline>
<codeline lineno="331" refid="classeEmp_183f9283f92b805508d896479dc1ccf12" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeEmp_183f9283f92b805508d896479dc1ccf12" kindref="member" tooltip="inherited operation : NOT implemneted">sample</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{it_error<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;Not<sp/>implemented&quot;</highlight><highlight class="normal"><sp/>);</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;}</highlight></codeline>
<codeline lineno="333" refid="classeEmp_123e7358995400865ad2e278945922fb3" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeEmp_123e7358995400865ad2e278945922fb3" kindref="member" tooltip="inherited operation : NOT implemneted">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{it_error<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;Not<sp/>implemented&quot;</highlight><highlight class="normal"><sp/>);</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0.0;}</highlight></codeline>
<codeline lineno="334" refid="classeEmp_1ba055c19038cc72628d98e25197e982d" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeEmp_1ba055c19038cc72628d98e25197e982d" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>pom=zeros<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()<sp/>);</highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;i&lt;<ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref>;i++<sp/>)<sp/>{pom+=<ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref><sp/>(<sp/>i<sp/>)<sp/>*<ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref><sp/>(<sp/>i<sp/>);}</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>pom;</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><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></codeline>
<codeline lineno="343"><highlight class="normal"></highlight></codeline>
<codeline lineno="344"><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="345" refid="classenorm_17b5cb487a2570e8109bfdc0df149aa06" refkind="member"><highlight class="normal"><ref refid="classenorm_17b5cb487a2570e8109bfdc0df149aa06" kindref="member" tooltip="Default constructor.">enorm&lt;sq_T&gt;::enorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv<sp/>)<sp/>:<ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>(<sp/>rv<sp/>),<sp/>mu<sp/>(<sp/>rv.count()<sp/>),R<sp/>(<sp/>rv.count()<sp/>),dim<sp/>(<sp/>rv.count()<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="346"><highlight class="normal"></highlight></codeline>
<codeline lineno="347"><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="348" refid="classenorm_11394a65caa6e00d42e00cc99b12227af" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_11394a65caa6e00d42e00cc99b12227af" kindref="member" tooltip="Set mean value mu and covariance R.">enorm&lt;sq_T&gt;::set_parameters</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;R0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="349"><highlight class="normal"></highlight><highlight class="comment">//Fixme<sp/>test<sp/>dimensions<sp/>of<sp/>mu0<sp/>and<sp/>R0;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref><sp/>=<sp/>mu0;</highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref><sp/>=<sp/>R0;</highlight></codeline>
<codeline lineno="352"><highlight class="normal">};</highlight></codeline>
<codeline lineno="353"><highlight class="normal"></highlight></codeline>
<codeline lineno="354"><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="355" refid="classenorm_15bf185e31e5954fceb90ada3debd2ff2" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15bf185e31e5954fceb90ada3debd2ff2" kindref="member" tooltip="dupdate in exponential form (not really handy)">enorm&lt;sq_T&gt;::dupdate</ref><sp/>(<sp/>mat<sp/>&amp;v,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="357"><highlight class="normal">};</highlight></codeline>
<codeline lineno="358"><highlight class="normal"></highlight></codeline>
<codeline lineno="359"><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="360" refid="classenorm_15b5fd142b6b17ea334597960e3fe126a" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15b5fd142b6b17ea334597960e3fe126a" kindref="member" tooltip="tupdate in exponential form (not really handy)">enorm&lt;sq_T&gt;::tupdate</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>phi,<sp/>mat<sp/>&amp;vbar,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nubar<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="362"><highlight class="normal">};</highlight></codeline>
<codeline lineno="363"><highlight class="normal"></highlight></codeline>
<codeline lineno="364"><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="365" refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" refkind="member"><highlight class="normal">vec<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">enorm&lt;sq_T&gt;::sample</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>x<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref><sp/>);</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NorRNG.sample_vector<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>,x<sp/>);</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>=<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.sqrt_mult<sp/>(<sp/>x<sp/>);</highlight></codeline>
<codeline lineno="369"><highlight class="normal"></highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>smp<sp/>+=<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;</highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>smp;</highlight></codeline>
<codeline lineno="372"><highlight class="normal">};</highlight></codeline>
<codeline lineno="373"><highlight class="normal"></highlight></codeline>
<codeline lineno="374"><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="375" refid="classenorm_160f0f3bfa53d6e65843eea9532b16d36" refkind="member"><highlight class="normal">mat<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">enorm&lt;sq_T&gt;::sample</ref><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>N<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>X<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>,N<sp/>);</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>x<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref><sp/>);</highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>pom;</highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="380"><highlight class="normal"></highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;i&lt;N;i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NorRNG.sample_vector<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>,x<sp/>);</highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pom<sp/>=<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.sqrt_mult<sp/>(<sp/>x<sp/>);</highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pom<sp/>+=<ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;</highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>X.set_col<sp/>(<sp/>i,<sp/>pom<sp/>);</highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="387"><highlight class="normal"></highlight></codeline>
<codeline lineno="388"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>X;</highlight></codeline>
<codeline lineno="389"><highlight class="normal">};</highlight></codeline>
<codeline lineno="390"><highlight class="normal"></highlight></codeline>
<codeline lineno="391"><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="392" refid="classenorm_1b9e1dfd33692d7b3f1a59f17b0e61bd0" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b9e1dfd33692d7b3f1a59f17b0e61bd0" kindref="member" tooltip="Compute probability of argument val.">enorm&lt;sq_T&gt;::eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>pdfl,e;</highlight></codeline>
<codeline lineno="394"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pdfl<sp/>=<sp/><ref refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/>val<sp/>);</highlight></codeline>
<codeline lineno="395"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e<sp/>=<sp/>exp<sp/>(<sp/>pdfl<sp/>);</highlight></codeline>
<codeline lineno="396"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>e;</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="keyword">template</highlight><highlight class="normal">&lt;</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T&gt;</highlight></codeline>
<codeline lineno="400" refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" kindref="member" tooltip="Compute log-probability of argument val.">enorm&lt;sq_T&gt;::evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="401"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>1.83787706640935<sp/>=<sp/>log(2pi)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="402"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><sp/>-0.5*<sp/>(<sp/><sp/>+<ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.invqform<sp/>(<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>-val<sp/>)<sp/>)<sp/>-<sp/><ref refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>();</highlight></codeline>
<codeline lineno="403"><highlight class="normal">};</highlight></codeline>
<codeline lineno="404"><highlight class="normal"></highlight></codeline>
<codeline lineno="405"><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="406" refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" kindref="member" tooltip="logarithm of the normalizing constant, ">enorm&lt;sq_T&gt;::lognc</ref><sp/>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>1.83787706640935<sp/>=<sp/>log(2pi)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="408"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-0.5*<sp/>(<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.cols()<sp/>*<sp/>1.83787706640935<sp/>+<ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.logdet());</highlight></codeline>
<codeline lineno="409"><highlight class="normal">};</highlight></codeline>
<codeline lineno="410"><highlight class="normal"></highlight></codeline>
<codeline lineno="411"><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="412" refid="classmlnorm_1f927203b3f31171c5c10ffc7caa797f5" refkind="member"><highlight class="normal"><ref refid="classmlnorm_1f927203b3f31171c5c10ffc7caa797f5" kindref="member" tooltip="Constructor.">mlnorm&lt;sq_T&gt;::mlnorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv0,<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rvc0<sp/>)<sp/>:<ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>(<sp/>rv0,rvc0<sp/>),<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv0<sp/>),A<sp/>(<sp/>rv0.count(),rv0.count()<sp/>),<ref refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" kindref="member" tooltip="returns a pointer to the internal mean value. Use with Care!">_mu</ref>(<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.<ref refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" kindref="member" tooltip="returns a pointer to the internal mean value. Use with Care!">_mu</ref>())<sp/>{<sp/><ref refid="classmpdf_17aa894208a32f3487827df6d5054424c" kindref="member" tooltip="pointer to internal epdf">ep</ref><sp/>=&amp;<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>;</highlight></codeline>
<codeline lineno="413"><highlight class="normal">}</highlight></codeline>
<codeline lineno="414"><highlight class="normal"></highlight></codeline>
<codeline lineno="415"><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="416" refid="classmlnorm_1b6749030c5d5abcb3eb6898f74cea3c0" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_1b6749030c5d5abcb3eb6898f74cea3c0" kindref="member" tooltip="Set A and R.">mlnorm&lt;sq_T&gt;::set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;A0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&amp;R0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="417"><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>.set_parameters<sp/>(<sp/>zeros<sp/>(<sp/><ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()<sp/>),R0<sp/>);</highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>=<sp/>A0;</highlight></codeline>
<codeline lineno="419"><highlight class="normal">}</highlight></codeline>
<codeline lineno="420"><highlight class="normal"></highlight></codeline>
<codeline lineno="421"><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="422" refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" refkind="member"><highlight class="normal">vec<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">mlnorm&lt;sq_T&gt;::samplecond</ref><sp/>(<sp/>vec<sp/>&amp;cond,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>&amp;lik<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="423"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;<ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">condition</ref><sp/>(<sp/>cond<sp/>);</highlight></codeline>
<codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.sample();</highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lik<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.eval<sp/>(<sp/>smp<sp/>);</highlight></codeline>
<codeline lineno="426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>smp;</highlight></codeline>
<codeline lineno="427"><highlight class="normal">}</highlight></codeline>
<codeline lineno="428"><highlight class="normal"></highlight></codeline>
<codeline lineno="429"><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="430" refid="classmlnorm_1215fb88cc8b95d64cdefd6849abdd1e8" refkind="member"><highlight class="normal">mat<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">mlnorm&lt;sq_T&gt;::samplecond</ref><sp/>(<sp/>vec<sp/>&amp;cond,<sp/>vec<sp/>&amp;lik,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="432"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dim<sp/>=<sp/><ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>();</highlight></codeline>
<codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Smp<sp/>(<sp/>dim,n<sp/>);</highlight></codeline>
<codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>(<sp/>dim<sp/>);</highlight></codeline>
<codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;<ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">condition</ref><sp/>(<sp/>cond<sp/>);</highlight></codeline>
<codeline lineno="436"><highlight class="normal"></highlight></codeline>
<codeline lineno="437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;<sp/>i&lt;n;<sp/>i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>smp<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.sample();</highlight></codeline>
<codeline lineno="439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lik<sp/>(<sp/>i<sp/>)<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.eval<sp/>(<sp/>smp<sp/>);</highlight></codeline>
<codeline lineno="440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Smp.set_col<sp/>(<sp/>i<sp/>,smp<sp/>);</highlight></codeline>
<codeline lineno="441"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="442"><highlight class="normal"></highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>Smp;</highlight></codeline>
<codeline lineno="444"><highlight class="normal">}</highlight></codeline>
<codeline lineno="445"><highlight class="normal"></highlight></codeline>
<codeline lineno="446"><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="447" refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">mlnorm&lt;sq_T&gt;::condition</ref><sp/>(<sp/>vec<sp/>&amp;cond<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="448"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>_mu<sp/>=<sp/>A*cond;</highlight></codeline>
<codeline lineno="449"><highlight class="normal"></highlight><highlight class="comment">//R<sp/>is<sp/>already<sp/>assigned;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="450"><highlight class="normal">}</highlight></codeline>
<codeline lineno="451"><highlight class="normal"></highlight></codeline>
<codeline lineno="453"><highlight class="normal"></highlight></codeline>
<codeline lineno="454"><highlight class="normal"></highlight></codeline>
<codeline lineno="455"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/>//EF_H</highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h"/>
  </compounddef>
</doxygen>
