Index: library/doc/html/exp__family_8h_source.html
===================================================================
--- library/doc/html/exp__family_8h_source.html (revision 608)
+++ library/doc/html/exp__family_8h_source.html (revision 614)
@@ -406,654 +406,662 @@
 <a name="l00490"></a>00490                 <span class="keywordtype">void</span> set_parameters (<span class="keyword">const</span> vec &amp;low0, <span class="keyword">const</span> vec &amp;high0) {
 <a name="l00491"></a>00491                         <a class="code" href="classbdm_1_1euni.html#ad3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> = high0 - low0;
-<a name="l00492"></a>00492                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (min (<a class="code" href="classbdm_1_1euni.html#ad3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>) &gt; 0.0, <span class="stringliteral">&quot;bad support&quot;</span>);
-<a name="l00493"></a>00493                         <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> = low0;
-<a name="l00494"></a>00494                         <a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> = high0;
-<a name="l00495"></a>00495                         <a class="code" href="classbdm_1_1euni.html#a31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a> = prod (1.0 / <a class="code" href="classbdm_1_1euni.html#ad3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>);
-<a name="l00496"></a>00496                         <a class="code" href="classbdm_1_1euni.html#a3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a> = log (<a class="code" href="classbdm_1_1euni.html#a31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>);
-<a name="l00497"></a>00497                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>.length();
-<a name="l00498"></a>00498                 }
-<a name="l00500"></a>00500 
-<a name="l00501"></a><a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81">00501</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const  </span>{
-<a name="l00502"></a>00502                         <span class="keywordflow">if</span> (any (val &lt; <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>) &amp;&amp; any (val &gt; <a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>)) {<span class="keywordflow">return</span> inf;}
-<a name="l00503"></a>00503                         <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#a3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>;
-<a name="l00504"></a>00504                 }
-<a name="l00505"></a><a class="code" href="classbdm_1_1euni.html#afc5df80359ead2918384b2004ce67194">00505</a>                 vec <a class="code" href="classbdm_1_1euni.html#afc5df80359ead2918384b2004ce67194" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{
-<a name="l00506"></a>00506                         vec smp (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l00507"></a>00507 <span class="preprocessor">#pragma omp critical</span>
-<a name="l00508"></a>00508 <span class="preprocessor"></span>                        UniRNG.sample_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> , smp);
-<a name="l00509"></a>00509                         <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> + elem_mult (<a class="code" href="classbdm_1_1euni.html#ad3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>, smp);
-<a name="l00510"></a>00510                 }
-<a name="l00512"></a><a class="code" href="classbdm_1_1euni.html#a46caa8c13aba2e6228f964208918b226">00512</a>                 vec <a class="code" href="classbdm_1_1euni.html#a46caa8c13aba2e6228f964208918b226" title="set values of low and high ">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> -<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>) / 2.0;}
-<a name="l00513"></a><a class="code" href="classbdm_1_1euni.html#a951f932155111f6053c980f672b4c22c">00513</a>                 vec <a class="code" href="classbdm_1_1euni.html#a951f932155111f6053c980f672b4c22c" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> (pow (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>, 2) + pow (<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>, 2) + elem_mult (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>, <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>)) / 3.0;}
-<a name="l00522"></a><a class="code" href="classbdm_1_1euni.html#a77f5fef1f006fe056066da23b9e5f042">00522</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1euni.html#a77f5fef1f006fe056066da23b9e5f042">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
-<a name="l00523"></a>00523                         <a class="code" href="classbdm_1_1euni.html#a77f5fef1f006fe056066da23b9e5f042">epdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">// reads rv and rvc</span>
-<a name="l00524"></a>00524 
-<a name="l00525"></a>00525                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;high&quot;</span>, UI::compulsory);
-<a name="l00526"></a>00526                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;low&quot;</span>, UI::compulsory);
-<a name="l00527"></a>00527                 }
-<a name="l00528"></a>00528 };
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530 
-<a name="l00536"></a>00536 <span class="keyword">template</span> &lt; <span class="keyword">class</span> sq_T, <span class="keyword">template</span> &lt;<span class="keyword">typename</span>&gt; <span class="keyword">class </span>TEpdf = enorm &gt;
-<a name="l00537"></a><a class="code" href="classbdm_1_1mlnorm.html">00537</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; TEpdf&lt;sq_T&gt; &gt;
-<a name="l00538"></a>00538 {
-<a name="l00539"></a>00539         <span class="keyword">protected</span>:
-<a name="l00541"></a><a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42">00541</a>                 mat <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>;
-<a name="l00543"></a><a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6">00543</a>                 vec <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;
-<a name="l00544"></a>00544 <span class="comment">//                      vec&amp; _mu; //cached epdf.mu; !!!!!! WHY NOT?</span>
-<a name="l00545"></a>00545         <span class="keyword">public</span>:
-<a name="l00548"></a>00548                 <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; TEpdf&lt;sq_T&gt; &gt;() {};
-<a name="l00549"></a>00549                 <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a> (<span class="keyword">const</span> mat &amp;<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R) : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; TEpdf&lt;sq_T&gt; &gt;() {
-<a name="l00550"></a>00550                         <a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5" title="Set A and R.">set_parameters</a> (A, mu0, R);
-<a name="l00551"></a>00551                 }
-<a name="l00552"></a>00552 
-<a name="l00554"></a><a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5">00554</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5" title="Set A and R.">set_parameters</a> (<span class="keyword">const</span>  mat &amp;A0, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R0) {
-<a name="l00555"></a>00555                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (A0.rows() == mu0.length(), <span class="stringliteral">&quot;mlnorm: A vs. mu mismatch&quot;</span>);
-<a name="l00556"></a>00556                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (A0.rows() == R0.rows(), <span class="stringliteral">&quot;mlnorm: A vs. R mismatch&quot;</span>);
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558                         this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (zeros (A0.rows()), R0);
-<a name="l00559"></a>00559                         <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> = A0;
-<a name="l00560"></a>00560                         <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a> = mu0;
-<a name="l00561"></a>00561                         this-&gt;<a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = A0.cols();
-<a name="l00562"></a>00562                 }
-<a name="l00565"></a><a class="code" href="classbdm_1_1mlnorm.html#ac2895ae549ee76d961be98d7061bd110">00565</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#ac2895ae549ee76d961be98d7061bd110">condition</a> (<span class="keyword">const</span> vec &amp;cond) {
-<a name="l00566"></a>00566                         this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> * cond + <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;
-<a name="l00567"></a>00567 <span class="comment">//R is already assigned;</span>
+<a name="l00492"></a>00492                         <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> = low0;
+<a name="l00493"></a>00493                         <a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> = high0;
+<a name="l00494"></a>00494                         <a class="code" href="classbdm_1_1euni.html#a31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a> = prod (1.0 / <a class="code" href="classbdm_1_1euni.html#ad3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>);
+<a name="l00495"></a>00495                         <a class="code" href="classbdm_1_1euni.html#a3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a> = log (<a class="code" href="classbdm_1_1euni.html#a31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>);
+<a name="l00496"></a>00496                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>.length();
+<a name="l00497"></a>00497                 }
+<a name="l00499"></a>00499 
+<a name="l00500"></a><a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81">00500</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const  </span>{
+<a name="l00501"></a>00501                         <span class="keywordflow">if</span> (any (val &lt; <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>) &amp;&amp; any (val &gt; <a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>)) {<span class="keywordflow">return</span> inf;}
+<a name="l00502"></a>00502                         <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#a3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>;
+<a name="l00503"></a>00503                 }
+<a name="l00504"></a><a class="code" href="classbdm_1_1euni.html#afc5df80359ead2918384b2004ce67194">00504</a>                 vec <a class="code" href="classbdm_1_1euni.html#afc5df80359ead2918384b2004ce67194" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{
+<a name="l00505"></a>00505                         vec smp (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l00506"></a>00506 <span class="preprocessor">#pragma omp critical</span>
+<a name="l00507"></a>00507 <span class="preprocessor"></span>                        UniRNG.sample_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> , smp);
+<a name="l00508"></a>00508                         <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> + elem_mult (<a class="code" href="classbdm_1_1euni.html#ad3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>, smp);
+<a name="l00509"></a>00509                 }
+<a name="l00511"></a><a class="code" href="classbdm_1_1euni.html#a46caa8c13aba2e6228f964208918b226">00511</a>                 vec <a class="code" href="classbdm_1_1euni.html#a46caa8c13aba2e6228f964208918b226" title="set values of low and high ">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> -<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>) / 2.0;}
+<a name="l00512"></a><a class="code" href="classbdm_1_1euni.html#a951f932155111f6053c980f672b4c22c">00512</a>                 vec <a class="code" href="classbdm_1_1euni.html#a951f932155111f6053c980f672b4c22c" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> (pow (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>, 2) + pow (<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>, 2) + elem_mult (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>, <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>)) / 3.0;}
+<a name="l00521"></a><a class="code" href="classbdm_1_1euni.html#a77f5fef1f006fe056066da23b9e5f042">00521</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1euni.html#a77f5fef1f006fe056066da23b9e5f042">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
+<a name="l00522"></a>00522                         <a class="code" href="classbdm_1_1euni.html#a77f5fef1f006fe056066da23b9e5f042">epdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">// reads rv and rvc</span>
+<a name="l00523"></a>00523 
+<a name="l00524"></a>00524                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;high&quot;</span>, UI::compulsory);
+<a name="l00525"></a>00525                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;low&quot;</span>, UI::compulsory);
+<a name="l00526"></a>00526                         set_parameters(<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>,<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>);
+<a name="l00527"></a>00527                         <a class="code" href="classbdm_1_1euni.html#a70c5a7dcf7cb0f7ea83b9165f31868e9" title="This method TODO.">validate</a>();
+<a name="l00528"></a>00528                 }
+<a name="l00529"></a><a class="code" href="classbdm_1_1euni.html#a70c5a7dcf7cb0f7ea83b9165f31868e9">00529</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1euni.html#a70c5a7dcf7cb0f7ea83b9165f31868e9" title="This method TODO.">validate</a>() {
+<a name="l00530"></a>00530                         <a class="code" href="bdmerror_8h.html#a7a3399d182b8e3065532596e76f84849" title="Throw std::runtime_exception if t is not true.">bdm_assert</a>(<a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>.length()==<a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>.length(), <span class="stringliteral">&quot;Incompatible high and low vectors&quot;</span>);
+<a name="l00531"></a>00531                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>.length();
+<a name="l00532"></a>00532                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (min (<a class="code" href="classbdm_1_1euni.html#ad3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>) &gt; 0.0, <span class="stringliteral">&quot;bad support&quot;</span>);
+<a name="l00533"></a>00533                 }
+<a name="l00534"></a>00534 };
+<a name="l00535"></a>00535 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a>(euni);
+<a name="l00536"></a>00536 
+<a name="l00542"></a>00542 <span class="keyword">template</span> &lt; <span class="keyword">class</span> sq_T, <span class="keyword">template</span> &lt;<span class="keyword">typename</span>&gt; <span class="keyword">class </span>TEpdf = enorm &gt;
+<a name="l00543"></a><a class="code" href="classbdm_1_1mlnorm.html">00543</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; TEpdf&lt;sq_T&gt; &gt;
+<a name="l00544"></a>00544 {
+<a name="l00545"></a>00545         <span class="keyword">protected</span>:
+<a name="l00547"></a><a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42">00547</a>                 mat <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>;
+<a name="l00549"></a><a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6">00549</a>                 vec <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;
+<a name="l00550"></a>00550 <span class="comment">//                      vec&amp; _mu; //cached epdf.mu; !!!!!! WHY NOT?</span>
+<a name="l00551"></a>00551         <span class="keyword">public</span>:
+<a name="l00554"></a>00554                 <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; TEpdf&lt;sq_T&gt; &gt;() {};
+<a name="l00555"></a>00555                 <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a> (<span class="keyword">const</span> mat &amp;<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R) : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; TEpdf&lt;sq_T&gt; &gt;() {
+<a name="l00556"></a>00556                         <a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5" title="Set A and R.">set_parameters</a> (A, mu0, R);
+<a name="l00557"></a>00557                 }
+<a name="l00558"></a>00558 
+<a name="l00560"></a><a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5">00560</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5" title="Set A and R.">set_parameters</a> (<span class="keyword">const</span>  mat &amp;A0, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R0) {
+<a name="l00561"></a>00561                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (A0.rows() == mu0.length(), <span class="stringliteral">&quot;mlnorm: A vs. mu mismatch&quot;</span>);
+<a name="l00562"></a>00562                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (A0.rows() == R0.rows(), <span class="stringliteral">&quot;mlnorm: A vs. R mismatch&quot;</span>);
+<a name="l00563"></a>00563                         
+<a name="l00564"></a>00564                         this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (zeros (A0.rows()), R0);
+<a name="l00565"></a>00565                         <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> = A0;
+<a name="l00566"></a>00566                         <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a> = mu0;
+<a name="l00567"></a>00567                         this-&gt;<a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = A0.cols();
 <a name="l00568"></a>00568                 }
-<a name="l00569"></a>00569 
-<a name="l00571"></a><a class="code" href="classbdm_1_1mlnorm.html#af6b0b4b0b17271525ad02660a4087cf7">00571</a>                 <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1mlnorm.html#af6b0b4b0b17271525ad02660a4087cf7" title="access function">_mu_const</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;}
-<a name="l00573"></a><a class="code" href="classbdm_1_1mlnorm.html#a55e1bd7fa70b852bd7fe50ce72fb8f23">00573</a>                 <span class="keyword">const</span> mat&amp; <a class="code" href="classbdm_1_1mlnorm.html#a55e1bd7fa70b852bd7fe50ce72fb8f23" title="access function">_A</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>;}
-<a name="l00575"></a><a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43">00575</a>                 mat <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._R().to_mat(); }
-<a name="l00576"></a>00576 
-<a name="l00578"></a>00578                 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> sq_M&gt;
-<a name="l00579"></a>00579                 <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; (std::ostream &amp;os,  mlnorm&lt;sq_M, enorm&gt; &amp;ml);
-<a name="l00580"></a>00580 
-<a name="l00581"></a><a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564">00581</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" title="Load from structure with elements:.">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
-<a name="l00582"></a>00582                         <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" title="Load from structure with elements:.">mpdf::from_setting</a> (<span class="keyword">set</span>);
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;A&quot;</span>, UI::compulsory);
-<a name="l00585"></a>00585                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;const&quot;</span>, UI::compulsory);
-<a name="l00586"></a>00586                         mat R0;
-<a name="l00587"></a>00587                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (R0, <span class="keyword">set</span>, <span class="stringliteral">&quot;R&quot;</span>, UI::compulsory);
-<a name="l00588"></a>00588                         <a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5" title="Set A and R.">set_parameters</a> (<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>, <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>, R0);
-<a name="l00589"></a>00589                 };
-<a name="l00590"></a>00590 };
-<a name="l00591"></a>00591 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mlnorm,ldmat);
-<a name="l00592"></a>00592 SHAREDPTR2 ( mlnorm, ldmat );
-<a name="l00593"></a>00593 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mlnorm,fsqmat);
-<a name="l00594"></a>00594 SHAREDPTR2 ( mlnorm, fsqmat );
-<a name="l00595"></a>00595 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mlnorm, chmat);
-<a name="l00596"></a>00596 SHAREDPTR2 ( mlnorm, chmat );
-<a name="l00597"></a>00597 
-<a name="l00599"></a>00599 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00600"></a><a class="code" href="classbdm_1_1mgnorm.html">00600</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mgnorm.html" title="Mpdf with general function for mean value.">mgnorm</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; enorm&lt; sq_T &gt; &gt;
-<a name="l00601"></a>00601 {
-<a name="l00602"></a>00602         <span class="keyword">private</span>:
-<a name="l00603"></a>00603 <span class="comment">//                      vec &amp;mu; WHY NOT?</span>
-<a name="l00604"></a>00604                 <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> g;
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606         <span class="keyword">public</span>:
-<a name="l00608"></a><a class="code" href="classbdm_1_1mgnorm.html#a1b014915d74470d3efab74e07cacb97d">00608</a>                 <a class="code" href="classbdm_1_1mgnorm.html#a1b014915d74470d3efab74e07cacb97d" title="default constructor">mgnorm</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a>&lt;sq_T&gt; &gt;() { }
-<a name="l00610"></a>00610                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339" title="set mean function">set_parameters</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> &amp;g0, <span class="keyword">const</span> sq_T &amp;R0);
-<a name="l00611"></a>00611                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;cond);
-<a name="l00612"></a>00612 
-<a name="l00613"></a>00613 
-<a name="l00641"></a><a class="code" href="classbdm_1_1mgnorm.html#ad717dacc6a9eb967f8410994dc6dc6f9">00641</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ad717dacc6a9eb967f8410994dc6dc6f9">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
-<a name="l00642"></a>00642                         <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> g = UI::build&lt;fnc&gt; (<span class="keyword">set</span>, <span class="stringliteral">&quot;g&quot;</span>, UI::compulsory);
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644                         mat R;
-<a name="l00645"></a>00645                         vec dR;
-<a name="l00646"></a>00646                         <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (dR, <span class="keyword">set</span>, <span class="stringliteral">&quot;dR&quot;</span>))
-<a name="l00647"></a>00647                                 R = diag (dR);
-<a name="l00648"></a>00648                         <span class="keywordflow">else</span>
-<a name="l00649"></a>00649                                 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (R, <span class="keyword">set</span>, <span class="stringliteral">&quot;R&quot;</span>, UI::compulsory);
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651                         <a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339" title="set mean function">set_parameters</a> (g, R);
-<a name="l00652"></a>00652                 }
-<a name="l00653"></a>00653 };
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mgnorm, chmat);
-<a name="l00656"></a>00656 SHAREDPTR2 ( mgnorm, chmat );
-<a name="l00657"></a>00657 
-<a name="l00658"></a>00658 
-<a name="l00666"></a><a class="code" href="classbdm_1_1mlstudent.html">00666</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mlstudent.html">mlstudent</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a>&lt;ldmat, enorm&gt;
-<a name="l00667"></a>00667 {
-<a name="l00668"></a>00668         <span class="keyword">protected</span>:
-<a name="l00670"></a><a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657">00670</a>                 <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>;
-<a name="l00672"></a><a class="code" href="classbdm_1_1mlstudent.html#a72e9bda4d6684e07faafc4b2192daf39">00672</a>                 <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;<a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>;
-<a name="l00674"></a><a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8">00674</a>                 <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a>;
-<a name="l00675"></a>00675         <span class="keyword">public</span>:
-<a name="l00676"></a>00676                 <a class="code" href="classbdm_1_1mlstudent.html">mlstudent</a> () : <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a>&lt;<a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>, <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a>&gt; (),
-<a name="l00677"></a>00677                                 <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a> (),      <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>()) {}
-<a name="l00679"></a><a class="code" href="classbdm_1_1mlstudent.html#a4cdf79aac1b2165c0290e73810a0e4a3">00679</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#a4cdf79aac1b2165c0290e73810a0e4a3" title="constructor function">set_parameters</a> (<span class="keyword">const</span> mat &amp;A0, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;R0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&amp; Lambda0) {
-<a name="l00680"></a>00680                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (A0.rows() == mu0.length(), <span class="stringliteral">&quot;mlstudent: A vs. mu mismatch&quot;</span>);
-<a name="l00681"></a>00681                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (R0.<a class="code" href="classbdm_1_1sqmat.html#a73e639221343dcce76c3305524d67590" title="Reimplementing common functions of mat: rows().">rows</a>() == A0.rows(), <span class="stringliteral">&quot;mlstudent: A vs. R mismatch&quot;</span>);
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (mu0, R0);<span class="comment">// was Lambda, why?</span>
-<a name="l00684"></a>00684                         <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> = A0;
-<a name="l00685"></a>00685                         <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a> = mu0;
-<a name="l00686"></a>00686                         <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a> = R0;
-<a name="l00687"></a>00687                         <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a> = Lambda0;
-<a name="l00688"></a>00688                 }
-<a name="l00689"></a><a class="code" href="classbdm_1_1mlstudent.html#aefd37560585c8613897f30d3c2f58d0d">00689</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#aefd37560585c8613897f30d3c2f58d0d">condition</a> (<span class="keyword">const</span> vec &amp;cond) {
-<a name="l00690"></a>00690                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> * cond + <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;
-<a name="l00691"></a>00691                         <span class="keywordtype">double</span> zeta;
-<a name="l00692"></a>00692                         <span class="comment">//ugly hack!</span>
-<a name="l00693"></a>00693                         <span class="keywordflow">if</span> ( (cond.length() + 1) == <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>.<a class="code" href="classbdm_1_1sqmat.html#a73e639221343dcce76c3305524d67590" title="Reimplementing common functions of mat: rows().">rows</a>()) {
-<a name="l00694"></a>00694                                 zeta = <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>.<a class="code" href="classbdm_1_1ldmat.html#af743de194aadb8515cf18226fadf365f" title="Evaluates quadratic form ;.">invqform</a> (concat (cond, vec_1 (1.0)));
-<a name="l00695"></a>00695                         } <span class="keywordflow">else</span> {
-<a name="l00696"></a>00696                                 zeta = <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>.<a class="code" href="classbdm_1_1ldmat.html#af743de194aadb8515cf18226fadf365f" title="Evaluates quadratic form ;.">invqform</a> (cond);
-<a name="l00697"></a>00697                         }
-<a name="l00698"></a>00698                         <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> = <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a>;
-<a name="l00699"></a>00699                         <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> *= (1 + zeta);<span class="comment">// / ( nu ); &lt;&lt; nu is in Re!!!!!!</span>
-<a name="l00700"></a>00700                 };
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702 };
-<a name="l00712"></a><a class="code" href="classbdm_1_1mgamma.html">00712</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mgamma.html" title="Gamma random walk.">mgamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;egamma&gt;
-<a name="l00713"></a>00713 {
-<a name="l00714"></a>00714         <span class="keyword">protected</span>:
-<a name="l00715"></a>00715 
-<a name="l00717"></a><a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09">00717</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>;
-<a name="l00718"></a>00718 
-<a name="l00720"></a><a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312">00720</a>                 vec &amp;<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a>;
-<a name="l00721"></a>00721 
-<a name="l00722"></a>00722         <span class="keyword">public</span>:
-<a name="l00724"></a><a class="code" href="classbdm_1_1mgamma.html#a1a9dc8661e5b214a8185d6e6b9956eb1">00724</a>                 <a class="code" href="classbdm_1_1mgamma.html#a1a9dc8661e5b214a8185d6e6b9956eb1" title="Constructor.">mgamma</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a>&gt;(), <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> (0),
-<a name="l00725"></a>00725                                 <a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a>()) {
-<a name="l00726"></a>00726                 }
-<a name="l00727"></a>00727 
-<a name="l00729"></a>00729                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#aa0f21c2557b233a85838b497d040ab14" title="Set value of k.">set_parameters</a> (<span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, <span class="keyword">const</span> vec &amp;beta0);
-<a name="l00730"></a>00730 
-<a name="l00731"></a><a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff">00731</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / val;};
-<a name="l00741"></a><a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">00741</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
-<a name="l00742"></a>00742                         <a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">mpdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">// reads rv and rvc</span>
-<a name="l00743"></a>00743                         vec betatmp; <span class="comment">// ugly but necessary</span>
-<a name="l00744"></a>00744                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (betatmp, <span class="keyword">set</span>, <span class="stringliteral">&quot;beta&quot;</span>, UI::compulsory);
-<a name="l00745"></a>00745                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;k&quot;</span>, UI::compulsory);
-<a name="l00746"></a>00746                         <a class="code" href="classbdm_1_1mgamma.html#aa0f21c2557b233a85838b497d040ab14" title="Set value of k.">set_parameters</a> (<a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, betatmp);
-<a name="l00747"></a>00747                 }
-<a name="l00748"></a>00748 };
-<a name="l00749"></a>00749 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> (mgamma);
-<a name="l00750"></a>00750 SHAREDPTR (mgamma);
-<a name="l00751"></a>00751 
-<a name="l00761"></a><a class="code" href="classbdm_1_1migamma.html">00761</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;eigamma&gt;
-<a name="l00762"></a>00762 {
-<a name="l00763"></a>00763         <span class="keyword">protected</span>:
-<a name="l00765"></a><a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c">00765</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>;
-<a name="l00766"></a>00766 
-<a name="l00768"></a><a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc">00768</a>                 vec &amp;<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a>;
-<a name="l00769"></a>00769 
-<a name="l00771"></a><a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5">00771</a>                 vec &amp;<a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a>;
-<a name="l00772"></a>00772 
-<a name="l00773"></a>00773         <span class="keyword">public</span>:
-<a name="l00776"></a>00776                 <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a>&gt;(),
-<a name="l00777"></a>00777                                 <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> (0),
-<a name="l00778"></a>00778                                 <a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a>()),
-<a name="l00779"></a>00779                                 <a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a>()) {
-<a name="l00780"></a>00780                 }
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782                 <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> &amp;m) : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a>&gt;(),
-<a name="l00783"></a>00783                                 <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> (0),
-<a name="l00784"></a>00784                                 <a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a>()),
-<a name="l00785"></a>00785                                 <a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a>()) {
-<a name="l00786"></a>00786                 }
-<a name="l00788"></a>00788 
-<a name="l00790"></a><a class="code" href="classbdm_1_1migamma.html#a8b10ab922e2a7bae2fb6bb3efc7b6151">00790</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#a8b10ab922e2a7bae2fb6bb3efc7b6151" title="Set value of k.">set_parameters</a> (<span class="keywordtype">int</span> len, <span class="keywordtype">double</span> k0) {
-<a name="l00791"></a>00791                         <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> = k0;
-<a name="l00792"></a>00792                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters ( (1.0 / (<a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>*<a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>) + 2.0) *ones (len) <span class="comment">/*alpha*/</span>, ones (len) <span class="comment">/*beta*/</span>);
-<a name="l00793"></a>00793                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
-<a name="l00794"></a>00794                 };
-<a name="l00795"></a><a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c">00795</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {
-<a name="l00796"></a>00796                         <a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a> = elem_mult (val, (<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a> - 1.0));
-<a name="l00797"></a>00797                 };
-<a name="l00798"></a>00798 };
-<a name="l00799"></a>00799 
-<a name="l00800"></a>00800 
-<a name="l00812"></a><a class="code" href="classbdm_1_1mgamma__fix.html">00812</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mgamma__fix.html" title="Gamma random walk around a fixed point.">mgamma_fix</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mgamma.html" title="Gamma random walk.">mgamma</a>
-<a name="l00813"></a>00813 {
-<a name="l00814"></a>00814         <span class="keyword">protected</span>:
-<a name="l00816"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa">00816</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>;
-<a name="l00818"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2">00818</a>                 vec <a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>;
-<a name="l00819"></a>00819         <span class="keyword">public</span>:
-<a name="l00821"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a9a31bc9b4b60188a18a2a6b588dc4b2d">00821</a>                 <a class="code" href="classbdm_1_1mgamma__fix.html#a9a31bc9b4b60188a18a2a6b588dc4b2d" title="Constructor.">mgamma_fix</a> () : <a class="code" href="classbdm_1_1mgamma.html" title="Gamma random walk.">mgamma</a> (), <a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a> () {};
-<a name="l00823"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1bfd30e90db9dc1fbda4a9fbb0b716b2">00823</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">set_parameters</a> (<span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0) {
-<a name="l00824"></a>00824                         <a class="code" href="classbdm_1_1mgamma__fix.html#a1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">mgamma::set_parameters</a> (k0, ref0);
-<a name="l00825"></a>00825                         <a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a> = pow (ref0, 1.0 - l0);<a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a> = l0;
-<a name="l00826"></a>00826                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
-<a name="l00827"></a>00827                 };
-<a name="l00828"></a>00828 
-<a name="l00829"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7">00829</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {vec mean = elem_mult (<a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>, pow (val, <a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>)); <a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / mean;};
-<a name="l00830"></a>00830 };
-<a name="l00831"></a>00831 
-<a name="l00832"></a>00832 
-<a name="l00845"></a><a class="code" href="classbdm_1_1migamma__ref.html">00845</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1migamma__ref.html" title="Inverse-Gamma random walk around a fixed point.">migamma_ref</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a>
-<a name="l00846"></a>00846 {
-<a name="l00847"></a>00847         <span class="keyword">protected</span>:
-<a name="l00849"></a><a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d">00849</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>;
-<a name="l00851"></a><a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6">00851</a>                 vec <a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>;
-<a name="l00852"></a>00852         <span class="keyword">public</span>:
-<a name="l00854"></a><a class="code" href="classbdm_1_1migamma__ref.html#af45b15a10f084991ba6b48295f10421f">00854</a>                 <a class="code" href="classbdm_1_1migamma__ref.html#af45b15a10f084991ba6b48295f10421f" title="Constructor.">migamma_ref</a> () : <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> (), <a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a> () {};
-<a name="l00856"></a><a class="code" href="classbdm_1_1migamma__ref.html#ab0b4eb278ef5d0831ec4954ba7bd2800">00856</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#ab0b4eb278ef5d0831ec4954ba7bd2800" title="Set value of k.">set_parameters</a> (<span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0) {
-<a name="l00857"></a>00857                         <a class="code" href="classbdm_1_1migamma__ref.html#ab0b4eb278ef5d0831ec4954ba7bd2800" title="Set value of k.">migamma::set_parameters</a> (ref0.length(), k0);
-<a name="l00858"></a>00858                         <a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a> = pow (ref0, 1.0 - l0);
-<a name="l00859"></a>00859                         <a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a> = l0;
-<a name="l00860"></a>00860                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
-<a name="l00861"></a>00861                 };
-<a name="l00862"></a>00862 
-<a name="l00863"></a><a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a">00863</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {
-<a name="l00864"></a>00864                         vec mean = elem_mult (<a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>, pow (val, <a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>));
-<a name="l00865"></a>00865                         <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">migamma::condition</a> (mean);
-<a name="l00866"></a>00866                 };
-<a name="l00867"></a>00867 
-<a name="l00888"></a>00888                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#a9e7e0f7d2aa9ecca8ec1af8cbcb5ef1d">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>);
-<a name="l00889"></a>00889 
-<a name="l00890"></a>00890                 <span class="comment">// TODO dodelat void to_setting( Setting &amp;set ) const;</span>
-<a name="l00891"></a>00891 };
-<a name="l00892"></a>00892 
-<a name="l00893"></a>00893 
-<a name="l00894"></a>00894 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> (migamma_ref);
-<a name="l00895"></a>00895 SHAREDPTR (migamma_ref);
-<a name="l00896"></a>00896 
-<a name="l00906"></a><a class="code" href="classbdm_1_1elognorm.html">00906</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1elognorm.html">elognorm</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a>&lt;ldmat&gt;
-<a name="l00907"></a>00907 {
-<a name="l00908"></a>00908         <span class="keyword">public</span>:
-<a name="l00909"></a><a class="code" href="classbdm_1_1elognorm.html#a8b948e2bce1253765a2542199913aaba">00909</a>                 vec <a class="code" href="classbdm_1_1elognorm.html#a8b948e2bce1253765a2542199913aaba" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> exp (<a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;ldmat&gt;::sample</a>());};
-<a name="l00910"></a><a class="code" href="classbdm_1_1elognorm.html#aadb41e4f4d6600dec6f8c1dbc5ed9eea">00910</a>                 vec <a class="code" href="classbdm_1_1elognorm.html#aadb41e4f4d6600dec6f8c1dbc5ed9eea" title="return expected value">mean</a>()<span class="keyword"> const </span>{vec var = <a class="code" href="classbdm_1_1enorm.html#a729c75ef0fa8abae03d58ad1f81e6773" title="return expected variance (not covariance!)">enorm&lt;ldmat&gt;::variance</a>();<span class="keywordflow">return</span> exp (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> - 0.5*var);};
-<a name="l00911"></a>00911 
-<a name="l00912"></a>00912 };
-<a name="l00913"></a>00913 
-<a name="l00925"></a><a class="code" href="classbdm_1_1mlognorm.html">00925</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mlognorm.html" title="Log-Normal random walk.">mlognorm</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;elognorm&gt;
-<a name="l00926"></a>00926 {
-<a name="l00927"></a>00927         <span class="keyword">protected</span>:
-<a name="l00929"></a><a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a">00929</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>;
-<a name="l00930"></a>00930 
-<a name="l00932"></a><a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2">00932</a>                 vec &amp;<a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a>;
-<a name="l00933"></a>00933         <span class="keyword">public</span>:
-<a name="l00935"></a><a class="code" href="classbdm_1_1mlognorm.html#aa5d6eb2688d02e0348b96c4fbd7bde41">00935</a>                 <a class="code" href="classbdm_1_1mlognorm.html#aa5d6eb2688d02e0348b96c4fbd7bde41" title="Constructor.">mlognorm</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1elognorm.html">elognorm</a>&gt;(),
-<a name="l00936"></a>00936                                 <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a> (0),
-<a name="l00937"></a>00937                                 <a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu()) {
-<a name="l00938"></a>00938                 }
-<a name="l00939"></a>00939 
-<a name="l00941"></a><a class="code" href="classbdm_1_1mlognorm.html#a604cab0e8a76f9041dc3c606043bb39f">00941</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a604cab0e8a76f9041dc3c606043bb39f" title="Set value of k.">set_parameters</a> (<span class="keywordtype">int</span> size, <span class="keywordtype">double</span> k) {
-<a name="l00942"></a>00942                         <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a> = 0.5 * log (k * k + 1);
-<a name="l00943"></a>00943                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (zeros (size), 2*<a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>*eye (size));
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = size;
-<a name="l00946"></a>00946                 };
+<a name="l00571"></a><a class="code" href="classbdm_1_1mlnorm.html#ac2895ae549ee76d961be98d7061bd110">00571</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#ac2895ae549ee76d961be98d7061bd110">condition</a> (<span class="keyword">const</span> vec &amp;cond) {
+<a name="l00572"></a>00572                         this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> * cond + <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;
+<a name="l00573"></a>00573 <span class="comment">//R is already assigned;</span>
+<a name="l00574"></a>00574                 }
+<a name="l00575"></a>00575 
+<a name="l00577"></a><a class="code" href="classbdm_1_1mlnorm.html#af6b0b4b0b17271525ad02660a4087cf7">00577</a>                 <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1mlnorm.html#af6b0b4b0b17271525ad02660a4087cf7" title="access function">_mu_const</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;}
+<a name="l00579"></a><a class="code" href="classbdm_1_1mlnorm.html#a55e1bd7fa70b852bd7fe50ce72fb8f23">00579</a>                 <span class="keyword">const</span> mat&amp; <a class="code" href="classbdm_1_1mlnorm.html#a55e1bd7fa70b852bd7fe50ce72fb8f23" title="access function">_A</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>;}
+<a name="l00581"></a><a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43">00581</a>                 mat <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._R().to_mat(); }
+<a name="l00582"></a>00582 
+<a name="l00584"></a>00584                 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> sq_M&gt;
+<a name="l00585"></a>00585                 <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; (std::ostream &amp;os,  mlnorm&lt;sq_M, enorm&gt; &amp;ml);
+<a name="l00586"></a>00586 
+<a name="l00587"></a><a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564">00587</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" title="Load from structure with elements:.">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
+<a name="l00588"></a>00588                         <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" title="Load from structure with elements:.">mpdf::from_setting</a> (<span class="keyword">set</span>);
+<a name="l00589"></a>00589 
+<a name="l00590"></a>00590                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;A&quot;</span>, UI::compulsory);
+<a name="l00591"></a>00591                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;const&quot;</span>, UI::compulsory);
+<a name="l00592"></a>00592                         mat R0;
+<a name="l00593"></a>00593                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (R0, <span class="keyword">set</span>, <span class="stringliteral">&quot;R&quot;</span>, UI::compulsory);
+<a name="l00594"></a>00594                         <a class="code" href="classbdm_1_1mlnorm.html#a04f7c6cda7b2f95161dd5fbcf15d1fd5" title="Set A and R.">set_parameters</a> (<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>, <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>, R0);
+<a name="l00595"></a>00595                 };
+<a name="l00596"></a>00596 };
+<a name="l00597"></a>00597 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mlnorm,ldmat);
+<a name="l00598"></a>00598 SHAREDPTR2 ( mlnorm, ldmat );
+<a name="l00599"></a>00599 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mlnorm,fsqmat);
+<a name="l00600"></a>00600 SHAREDPTR2 ( mlnorm, fsqmat );
+<a name="l00601"></a>00601 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mlnorm, chmat);
+<a name="l00602"></a>00602 SHAREDPTR2 ( mlnorm, chmat );
+<a name="l00603"></a>00603 
+<a name="l00605"></a>00605 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00606"></a><a class="code" href="classbdm_1_1mgnorm.html">00606</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mgnorm.html" title="Mpdf with general function for mean value.">mgnorm</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt; enorm&lt; sq_T &gt; &gt;
+<a name="l00607"></a>00607 {
+<a name="l00608"></a>00608         <span class="keyword">private</span>:
+<a name="l00609"></a>00609 <span class="comment">//                      vec &amp;mu; WHY NOT?</span>
+<a name="l00610"></a>00610                 <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> g;
+<a name="l00611"></a>00611 
+<a name="l00612"></a>00612         <span class="keyword">public</span>:
+<a name="l00614"></a><a class="code" href="classbdm_1_1mgnorm.html#a1b014915d74470d3efab74e07cacb97d">00614</a>                 <a class="code" href="classbdm_1_1mgnorm.html#a1b014915d74470d3efab74e07cacb97d" title="default constructor">mgnorm</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a>&lt;sq_T&gt; &gt;() { }
+<a name="l00616"></a>00616                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339" title="set mean function">set_parameters</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> &amp;g0, <span class="keyword">const</span> sq_T &amp;R0);
+<a name="l00617"></a>00617                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;cond);
+<a name="l00618"></a>00618 
+<a name="l00619"></a>00619 
+<a name="l00647"></a><a class="code" href="classbdm_1_1mgnorm.html#ad717dacc6a9eb967f8410994dc6dc6f9">00647</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ad717dacc6a9eb967f8410994dc6dc6f9">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
+<a name="l00648"></a>00648                         <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> g = UI::build&lt;fnc&gt; (<span class="keyword">set</span>, <span class="stringliteral">&quot;g&quot;</span>, UI::compulsory);
+<a name="l00649"></a>00649 
+<a name="l00650"></a>00650                         mat R;
+<a name="l00651"></a>00651                         vec dR;
+<a name="l00652"></a>00652                         <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (dR, <span class="keyword">set</span>, <span class="stringliteral">&quot;dR&quot;</span>))
+<a name="l00653"></a>00653                                 R = diag (dR);
+<a name="l00654"></a>00654                         <span class="keywordflow">else</span>
+<a name="l00655"></a>00655                                 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (R, <span class="keyword">set</span>, <span class="stringliteral">&quot;R&quot;</span>, UI::compulsory);
+<a name="l00656"></a>00656 
+<a name="l00657"></a>00657                         <a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339" title="set mean function">set_parameters</a> (g, R);
+<a name="l00658"></a>00658                 }
+<a name="l00659"></a>00659 };
+<a name="l00660"></a>00660 
+<a name="l00661"></a>00661 <a class="code" href="user__info_8h.html#ab06f1e7c44a8306e321f62a0099210b9" title="Variant of UIREGISTER for templated classes.">UIREGISTER2</a> (mgnorm, chmat);
+<a name="l00662"></a>00662 SHAREDPTR2 ( mgnorm, chmat );
+<a name="l00663"></a>00663 
+<a name="l00664"></a>00664 
+<a name="l00672"></a><a class="code" href="classbdm_1_1mlstudent.html">00672</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mlstudent.html">mlstudent</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a>&lt;ldmat, enorm&gt;
+<a name="l00673"></a>00673 {
+<a name="l00674"></a>00674         <span class="keyword">protected</span>:
+<a name="l00676"></a><a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657">00676</a>                 <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>;
+<a name="l00678"></a><a class="code" href="classbdm_1_1mlstudent.html#a72e9bda4d6684e07faafc4b2192daf39">00678</a>                 <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;<a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>;
+<a name="l00680"></a><a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8">00680</a>                 <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a>;
+<a name="l00681"></a>00681         <span class="keyword">public</span>:
+<a name="l00682"></a>00682                 <a class="code" href="classbdm_1_1mlstudent.html">mlstudent</a> () : <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a>&lt;<a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>, <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a>&gt; (),
+<a name="l00683"></a>00683                                 <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a> (),      <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>()) {}
+<a name="l00685"></a><a class="code" href="classbdm_1_1mlstudent.html#a4cdf79aac1b2165c0290e73810a0e4a3">00685</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#a4cdf79aac1b2165c0290e73810a0e4a3" title="constructor function">set_parameters</a> (<span class="keyword">const</span> mat &amp;A0, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;R0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&amp; Lambda0) {
+<a name="l00686"></a>00686                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (mu0, R0);<span class="comment">// was Lambda, why?</span>
+<a name="l00687"></a>00687                         <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> = A0;
+<a name="l00688"></a>00688                         <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a> = mu0;
+<a name="l00689"></a>00689                         <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a> = R0;
+<a name="l00690"></a>00690                         <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a> = Lambda0;
+<a name="l00691"></a>00691                 }
+<a name="l00692"></a><a class="code" href="classbdm_1_1mlstudent.html#aefd37560585c8613897f30d3c2f58d0d">00692</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#aefd37560585c8613897f30d3c2f58d0d">condition</a> (<span class="keyword">const</span> vec &amp;cond) {
+<a name="l00693"></a>00693                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a> * cond + <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;
+<a name="l00694"></a>00694                         <span class="keywordtype">double</span> zeta;
+<a name="l00695"></a>00695                         <span class="comment">//ugly hack!</span>
+<a name="l00696"></a>00696                         <span class="keywordflow">if</span> ( (cond.length() + 1) == <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>.<a class="code" href="classbdm_1_1sqmat.html#a73e639221343dcce76c3305524d67590" title="Reimplementing common functions of mat: rows().">rows</a>()) {
+<a name="l00697"></a>00697                                 zeta = <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>.<a class="code" href="classbdm_1_1ldmat.html#af743de194aadb8515cf18226fadf365f" title="Evaluates quadratic form ;.">invqform</a> (concat (cond, vec_1 (1.0)));
+<a name="l00698"></a>00698                         } <span class="keywordflow">else</span> {
+<a name="l00699"></a>00699                                 zeta = <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable  from theory.">Lambda</a>.<a class="code" href="classbdm_1_1ldmat.html#af743de194aadb8515cf18226fadf365f" title="Evaluates quadratic form ;.">invqform</a> (cond);
+<a name="l00700"></a>00700                         }
+<a name="l00701"></a>00701                         <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> = <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a>;
+<a name="l00702"></a>00702                         <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> *= (1 + zeta);<span class="comment">// / ( nu ); &lt;&lt; nu is in Re!!!!!!</span>
+<a name="l00703"></a>00703                 };
+<a name="l00704"></a>00704 
+<a name="l00705"></a><a class="code" href="classbdm_1_1mlstudent.html#a55869e091bca0e2af1c3667c05ba6261">00705</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#a55869e091bca0e2af1c3667c05ba6261" title="This method TODO.">validate</a>() {
+<a name="l00706"></a>00706                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>.rows() == <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>.length(), <span class="stringliteral">&quot;mlstudent: A vs. mu mismatch&quot;</span>);
+<a name="l00707"></a>00707                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (<a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>.rows() == <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>.rows(), <span class="stringliteral">&quot;mlstudent: A vs. R mismatch&quot;</span>);
+<a name="l00708"></a>00708                         
+<a name="l00709"></a>00709                 }
+<a name="l00710"></a>00710 };
+<a name="l00720"></a><a class="code" href="classbdm_1_1mgamma.html">00720</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mgamma.html" title="Gamma random walk.">mgamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;egamma&gt;
+<a name="l00721"></a>00721 {
+<a name="l00722"></a>00722         <span class="keyword">protected</span>:
+<a name="l00723"></a>00723 
+<a name="l00725"></a><a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09">00725</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>;
+<a name="l00726"></a>00726 
+<a name="l00728"></a><a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312">00728</a>                 vec &amp;<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a>;
+<a name="l00729"></a>00729 
+<a name="l00730"></a>00730         <span class="keyword">public</span>:
+<a name="l00732"></a><a class="code" href="classbdm_1_1mgamma.html#a1a9dc8661e5b214a8185d6e6b9956eb1">00732</a>                 <a class="code" href="classbdm_1_1mgamma.html#a1a9dc8661e5b214a8185d6e6b9956eb1" title="Constructor.">mgamma</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a>&gt;(), <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> (0),
+<a name="l00733"></a>00733                                 <a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a>()) {
+<a name="l00734"></a>00734                 }
+<a name="l00735"></a>00735 
+<a name="l00737"></a>00737                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#aa0f21c2557b233a85838b497d040ab14" title="Set value of k.">set_parameters</a> (<span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, <span class="keyword">const</span> vec &amp;beta0);
+<a name="l00738"></a>00738 
+<a name="l00739"></a><a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff">00739</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / val;};
+<a name="l00749"></a><a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">00749</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>) {
+<a name="l00750"></a>00750                         <a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">mpdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">// reads rv and rvc</span>
+<a name="l00751"></a>00751                         vec betatmp; <span class="comment">// ugly but necessary</span>
+<a name="l00752"></a>00752                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (betatmp, <span class="keyword">set</span>, <span class="stringliteral">&quot;beta&quot;</span>, UI::compulsory);
+<a name="l00753"></a>00753                         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;k&quot;</span>, UI::compulsory);
+<a name="l00754"></a>00754                         <a class="code" href="classbdm_1_1mgamma.html#aa0f21c2557b233a85838b497d040ab14" title="Set value of k.">set_parameters</a> (<a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, betatmp);
+<a name="l00755"></a>00755                 }
+<a name="l00756"></a>00756 };
+<a name="l00757"></a>00757 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> (mgamma);
+<a name="l00758"></a>00758 SHAREDPTR (mgamma);
+<a name="l00759"></a>00759 
+<a name="l00769"></a><a class="code" href="classbdm_1_1migamma.html">00769</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;eigamma&gt;
+<a name="l00770"></a>00770 {
+<a name="l00771"></a>00771         <span class="keyword">protected</span>:
+<a name="l00773"></a><a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c">00773</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>;
+<a name="l00774"></a>00774 
+<a name="l00776"></a><a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc">00776</a>                 vec &amp;<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a>;
+<a name="l00777"></a>00777 
+<a name="l00779"></a><a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5">00779</a>                 vec &amp;<a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a>;
+<a name="l00780"></a>00780 
+<a name="l00781"></a>00781         <span class="keyword">public</span>:
+<a name="l00784"></a>00784                 <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a>&gt;(),
+<a name="l00785"></a>00785                                 <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> (0),
+<a name="l00786"></a>00786                                 <a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a>()),
+<a name="l00787"></a>00787                                 <a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a>()) {
+<a name="l00788"></a>00788                 }
+<a name="l00789"></a>00789 
+<a name="l00790"></a>00790                 <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> &amp;m) : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a>&gt;(),
+<a name="l00791"></a>00791                                 <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> (0),
+<a name="l00792"></a>00792                                 <a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a>()),
+<a name="l00793"></a>00793                                 <a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a>()) {
+<a name="l00794"></a>00794                 }
+<a name="l00796"></a>00796 
+<a name="l00798"></a><a class="code" href="classbdm_1_1migamma.html#a8b10ab922e2a7bae2fb6bb3efc7b6151">00798</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#a8b10ab922e2a7bae2fb6bb3efc7b6151" title="Set value of k.">set_parameters</a> (<span class="keywordtype">int</span> len, <span class="keywordtype">double</span> k0) {
+<a name="l00799"></a>00799                         <a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> = k0;
+<a name="l00800"></a>00800                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters ( (1.0 / (<a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>*<a class="code" href="classbdm_1_1migamma.html#adc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>) + 2.0) *ones (len) <span class="comment">/*alpha*/</span>, ones (len) <span class="comment">/*beta*/</span>);
+<a name="l00801"></a>00801                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
+<a name="l00802"></a>00802                 };
+<a name="l00803"></a><a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c">00803</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {
+<a name="l00804"></a>00804                         <a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a> = elem_mult (val, (<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a> - 1.0));
+<a name="l00805"></a>00805                 };
+<a name="l00806"></a>00806 };
+<a name="l00807"></a>00807 
+<a name="l00808"></a>00808 
+<a name="l00820"></a><a class="code" href="classbdm_1_1mgamma__fix.html">00820</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mgamma__fix.html" title="Gamma random walk around a fixed point.">mgamma_fix</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mgamma.html" title="Gamma random walk.">mgamma</a>
+<a name="l00821"></a>00821 {
+<a name="l00822"></a>00822         <span class="keyword">protected</span>:
+<a name="l00824"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa">00824</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>;
+<a name="l00826"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2">00826</a>                 vec <a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>;
+<a name="l00827"></a>00827         <span class="keyword">public</span>:
+<a name="l00829"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a9a31bc9b4b60188a18a2a6b588dc4b2d">00829</a>                 <a class="code" href="classbdm_1_1mgamma__fix.html#a9a31bc9b4b60188a18a2a6b588dc4b2d" title="Constructor.">mgamma_fix</a> () : <a class="code" href="classbdm_1_1mgamma.html" title="Gamma random walk.">mgamma</a> (), <a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a> () {};
+<a name="l00831"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1bfd30e90db9dc1fbda4a9fbb0b716b2">00831</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">set_parameters</a> (<span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0) {
+<a name="l00832"></a>00832                         <a class="code" href="classbdm_1_1mgamma__fix.html#a1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">mgamma::set_parameters</a> (k0, ref0);
+<a name="l00833"></a>00833                         <a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a> = pow (ref0, 1.0 - l0);<a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a> = l0;
+<a name="l00834"></a>00834                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
+<a name="l00835"></a>00835                 };
+<a name="l00836"></a>00836 
+<a name="l00837"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7">00837</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {vec mean = elem_mult (<a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>, pow (val, <a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>)); <a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / mean;};
+<a name="l00838"></a>00838 };
+<a name="l00839"></a>00839 
+<a name="l00840"></a>00840 
+<a name="l00853"></a><a class="code" href="classbdm_1_1migamma__ref.html">00853</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1migamma__ref.html" title="Inverse-Gamma random walk around a fixed point.">migamma_ref</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a>
+<a name="l00854"></a>00854 {
+<a name="l00855"></a>00855         <span class="keyword">protected</span>:
+<a name="l00857"></a><a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d">00857</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>;
+<a name="l00859"></a><a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6">00859</a>                 vec <a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>;
+<a name="l00860"></a>00860         <span class="keyword">public</span>:
+<a name="l00862"></a><a class="code" href="classbdm_1_1migamma__ref.html#af45b15a10f084991ba6b48295f10421f">00862</a>                 <a class="code" href="classbdm_1_1migamma__ref.html#af45b15a10f084991ba6b48295f10421f" title="Constructor.">migamma_ref</a> () : <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> (), <a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a> () {};
+<a name="l00864"></a><a class="code" href="classbdm_1_1migamma__ref.html#ab0b4eb278ef5d0831ec4954ba7bd2800">00864</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#ab0b4eb278ef5d0831ec4954ba7bd2800" title="Set value of k.">set_parameters</a> (<span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0) {
+<a name="l00865"></a>00865                         <a class="code" href="classbdm_1_1migamma__ref.html#ab0b4eb278ef5d0831ec4954ba7bd2800" title="Set value of k.">migamma::set_parameters</a> (ref0.length(), k0);
+<a name="l00866"></a>00866                         <a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a> = pow (ref0, 1.0 - l0);
+<a name="l00867"></a>00867                         <a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a> = l0;
+<a name="l00868"></a>00868                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
+<a name="l00869"></a>00869                 };
+<a name="l00870"></a>00870 
+<a name="l00871"></a><a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a">00871</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {
+<a name="l00872"></a>00872                         vec mean = elem_mult (<a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>, pow (val, <a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>));
+<a name="l00873"></a>00873                         <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">migamma::condition</a> (mean);
+<a name="l00874"></a>00874                 };
+<a name="l00875"></a>00875 
+<a name="l00896"></a>00896                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#a9e7e0f7d2aa9ecca8ec1af8cbcb5ef1d">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>);
+<a name="l00897"></a>00897 
+<a name="l00898"></a>00898                 <span class="comment">// TODO dodelat void to_setting( Setting &amp;set ) const;</span>
+<a name="l00899"></a>00899 };
+<a name="l00900"></a>00900 
+<a name="l00901"></a>00901 
+<a name="l00902"></a>00902 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> (migamma_ref);
+<a name="l00903"></a>00903 SHAREDPTR (migamma_ref);
+<a name="l00904"></a>00904 
+<a name="l00914"></a><a class="code" href="classbdm_1_1elognorm.html">00914</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1elognorm.html">elognorm</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a>&lt;ldmat&gt;
+<a name="l00915"></a>00915 {
+<a name="l00916"></a>00916         <span class="keyword">public</span>:
+<a name="l00917"></a><a class="code" href="classbdm_1_1elognorm.html#a8b948e2bce1253765a2542199913aaba">00917</a>                 vec <a class="code" href="classbdm_1_1elognorm.html#a8b948e2bce1253765a2542199913aaba" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> exp (<a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;ldmat&gt;::sample</a>());};
+<a name="l00918"></a><a class="code" href="classbdm_1_1elognorm.html#aadb41e4f4d6600dec6f8c1dbc5ed9eea">00918</a>                 vec <a class="code" href="classbdm_1_1elognorm.html#aadb41e4f4d6600dec6f8c1dbc5ed9eea" title="return expected value">mean</a>()<span class="keyword"> const </span>{vec var = <a class="code" href="classbdm_1_1enorm.html#a729c75ef0fa8abae03d58ad1f81e6773" title="return expected variance (not covariance!)">enorm&lt;ldmat&gt;::variance</a>();<span class="keywordflow">return</span> exp (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> - 0.5*var);};
+<a name="l00919"></a>00919 
+<a name="l00920"></a>00920 };
+<a name="l00921"></a>00921 
+<a name="l00933"></a><a class="code" href="classbdm_1_1mlognorm.html">00933</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mlognorm.html" title="Log-Normal random walk.">mlognorm</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;elognorm&gt;
+<a name="l00934"></a>00934 {
+<a name="l00935"></a>00935         <span class="keyword">protected</span>:
+<a name="l00937"></a><a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a">00937</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>;
+<a name="l00938"></a>00938 
+<a name="l00940"></a><a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2">00940</a>                 vec &amp;<a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a>;
+<a name="l00941"></a>00941         <span class="keyword">public</span>:
+<a name="l00943"></a><a class="code" href="classbdm_1_1mlognorm.html#aa5d6eb2688d02e0348b96c4fbd7bde41">00943</a>                 <a class="code" href="classbdm_1_1mlognorm.html#aa5d6eb2688d02e0348b96c4fbd7bde41" title="Constructor.">mlognorm</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;<a class="code" href="classbdm_1_1elognorm.html">elognorm</a>&gt;(),
+<a name="l00944"></a>00944                                 <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a> (0),
+<a name="l00945"></a>00945                                 <a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu()) {
+<a name="l00946"></a>00946                 }
 <a name="l00947"></a>00947 
-<a name="l00948"></a><a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e">00948</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {
-<a name="l00949"></a>00949                         <a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a> = log (val) - <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>;<span class="comment">//elem_mult ( refl,pow ( val,l ) );</span>
-<a name="l00950"></a>00950                 };
-<a name="l00951"></a>00951 
-<a name="l00970"></a>00970                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a49e45ea13a869da607ef9be7a229128a">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>);
-<a name="l00971"></a>00971 
-<a name="l00972"></a>00972                 <span class="comment">// TODO dodelat void to_setting( Setting &amp;set ) const;</span>
-<a name="l00973"></a>00973 
-<a name="l00974"></a>00974 };
-<a name="l00975"></a>00975 
-<a name="l00976"></a>00976 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> (mlognorm);
-<a name="l00977"></a>00977 SHAREDPTR (mlognorm);
-<a name="l00978"></a>00978 
-<a name="l00982"></a><a class="code" href="classbdm_1_1eWishartCh.html">00982</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eWishartCh.html">eWishartCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
-<a name="l00983"></a>00983 {
-<a name="l00984"></a>00984         <span class="keyword">protected</span>:
-<a name="l00986"></a><a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490">00986</a>                 <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>;
-<a name="l00988"></a><a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f">00988</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>;
-<a name="l00990"></a><a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3">00990</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>;
-<a name="l00991"></a>00991         <span class="keyword">public</span>:
-<a name="l00993"></a><a class="code" href="classbdm_1_1eWishartCh.html#a183d961532ee97b7dc5ec81701aa59a0">00993</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#a183d961532ee97b7dc5ec81701aa59a0" title="Set internal structures.">set_parameters</a> (<span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0) {<a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a> = <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> (Y0);<a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a> = delta0; <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a> = <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1sqmat.html#a73e639221343dcce76c3305524d67590" title="Reimplementing common functions of mat: rows().">rows</a>(); <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a> * <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>; }
-<a name="l00995"></a><a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339">00995</a>                 mat <a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339" title="Sample matrix argument.">sample_mat</a>()<span class="keyword"> const </span>{
-<a name="l00996"></a>00996                         mat X = zeros (<a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>, <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>);
-<a name="l00997"></a>00997 
-<a name="l00998"></a>00998                         <span class="comment">//sample diagonal</span>
-<a name="l00999"></a>00999                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>;i++) {
-<a name="l01000"></a>01000                                 GamRNG.setup (0.5* (<a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a> - i) , 0.5);   <span class="comment">// no +1 !! index if from 0</span>
-<a name="l01001"></a>01001 <span class="preprocessor">#pragma omp critical</span>
-<a name="l01002"></a>01002 <span class="preprocessor"></span>                                X (i, i) = sqrt (GamRNG());
-<a name="l01003"></a>01003                         }
-<a name="l01004"></a>01004                         <span class="comment">//do the rest</span>
-<a name="l01005"></a>01005                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; p;i++) {
-<a name="l01006"></a>01006                                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1;j &lt; p;j++) {
-<a name="l01007"></a>01007 <span class="preprocessor">#pragma omp critical</span>
-<a name="l01008"></a>01008 <span class="preprocessor"></span>                                        X (i, j) = NorRNG.sample();
-<a name="l01009"></a>01009                                 }
-<a name="l01010"></a>01010                         }
-<a name="l01011"></a>01011                         <span class="keywordflow">return</span> X*<a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>();<span class="comment">// return upper triangular part of the decomposition</span>
-<a name="l01012"></a>01012                 }
-<a name="l01013"></a><a class="code" href="classbdm_1_1eWishartCh.html#a8f2154b8b5be8f4c5788f261b6d57b9a">01013</a>                 vec <a class="code" href="classbdm_1_1eWishartCh.html#a8f2154b8b5be8f4c5788f261b6d57b9a" title="Returns a sample,  from density .">sample</a> ()<span class="keyword"> const </span>{
-<a name="l01014"></a>01014                         <span class="keywordflow">return</span> vec (<a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339" title="Sample matrix argument.">sample_mat</a>()._data(), <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>*<a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>);
-<a name="l01015"></a>01015                 }
-<a name="l01017"></a><a class="code" href="classbdm_1_1eWishartCh.html#a4eee757c0535c2a88bb20f0767c64981">01017</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#a4eee757c0535c2a88bb20f0767c64981" title="fast access function y0 will be copied into Y.Ch.">setY</a> (<span class="keyword">const</span> mat &amp;Ch0) {copy_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, Ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>()._data());}
-<a name="l01019"></a><a class="code" href="classbdm_1_1eWishartCh.html#a7eac414ec10b85aa5536b0092c57bc4a">01019</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#a7eac414ec10b85aa5536b0092c57bc4a" title="fast access function y0 will be copied into Y.Ch.">_setY</a> (<span class="keyword">const</span> vec &amp;ch0) {copy_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>()._data()); }
-<a name="l01021"></a><a class="code" href="classbdm_1_1eWishartCh.html#a1708cacb5d8cb1b96395d35f5327cb7e">01021</a>                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classbdm_1_1eWishartCh.html#a1708cacb5d8cb1b96395d35f5327cb7e" title="access function">getY</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>;}
-<a name="l01022"></a>01022 };
-<a name="l01023"></a>01023 
-<a name="l01025"></a>01025 
-<a name="l01027"></a><a class="code" href="classbdm_1_1eiWishartCh.html">01027</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eiWishartCh.html" title="Inverse Wishart on Choleski decomposition.">eiWishartCh</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
-<a name="l01028"></a>01028 {
-<a name="l01029"></a>01029         <span class="keyword">protected</span>:
-<a name="l01031"></a><a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a">01031</a>                 <a class="code" href="classbdm_1_1eWishartCh.html">eWishartCh</a> <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>;
-<a name="l01033"></a><a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd">01033</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>;
-<a name="l01035"></a><a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464">01035</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464" title="parameter delta">delta</a>;
-<a name="l01036"></a>01036         <span class="keyword">public</span>:
-<a name="l01038"></a><a class="code" href="classbdm_1_1eiWishartCh.html#af463caed9d22d9949f3ee67614e7dcd3">01038</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eiWishartCh.html#af463caed9d22d9949f3ee67614e7dcd3" title="constructor function">set_parameters</a> (<span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0) {
-<a name="l01039"></a>01039                         <a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464" title="parameter delta">delta</a> = delta0;
-<a name="l01040"></a>01040                         <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a183d961532ee97b7dc5ec81701aa59a0" title="Set internal structures.">set_parameters</a> (inv (Y0), delta0);
-<a name="l01041"></a>01041                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1epdf.html#a7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>(); <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a> = Y0.rows();
-<a name="l01042"></a>01042                 }
-<a name="l01043"></a><a class="code" href="classbdm_1_1eiWishartCh.html#a2f668192cc9c2e3a5b7e608164685a3e">01043</a>                 vec <a class="code" href="classbdm_1_1eiWishartCh.html#a2f668192cc9c2e3a5b7e608164685a3e" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{mat iCh; iCh = inv (<a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339" title="Sample matrix argument.">sample_mat</a>()); <span class="keywordflow">return</span> vec (iCh._data(), <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);}
-<a name="l01045"></a><a class="code" href="classbdm_1_1eiWishartCh.html#ad9947933dfc94546cbd6a81f95ec5af5">01045</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eiWishartCh.html#ad9947933dfc94546cbd6a81f95ec5af5" title="access function">_setY</a> (<span class="keyword">const</span> vec &amp;y0) {
-<a name="l01046"></a>01046                         mat Ch (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>, <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>);
-<a name="l01047"></a>01047                         mat iCh (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>, <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>);
-<a name="l01048"></a>01048                         copy_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, y0._data(), Ch._data());
-<a name="l01049"></a>01049 
-<a name="l01050"></a>01050                         iCh = inv (Ch);
-<a name="l01051"></a>01051                         <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a4eee757c0535c2a88bb20f0767c64981" title="fast access function y0 will be copied into Y.Ch.">setY</a> (iCh);
-<a name="l01052"></a>01052                 }
-<a name="l01053"></a><a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb">01053</a>                 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const </span>{
-<a name="l01054"></a>01054                         <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> X (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>);
-<a name="l01055"></a>01055                         <span class="keyword">const</span> <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; Y = <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a1708cacb5d8cb1b96395d35f5327cb7e" title="access function">getY</a>();
-<a name="l01056"></a>01056 
-<a name="l01057"></a>01057                         copy_vector (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>*<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>, val._data(), X.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>()._data());
-<a name="l01058"></a>01058                         <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> iX (p);X.<a class="code" href="classbdm_1_1chmat.html#acbf3389db96dff41fb2e9532d59b13c0" title="Inversion in the same form, i.e. cholesky.">inv</a> (iX);
-<a name="l01059"></a>01059                         <span class="comment">// compute</span>
-<a name="l01060"></a>01060 <span class="comment">//                              \frac{ |\Psi|^{m/2}|X|^{-(m+p+1)/2}e^{-tr(\Psi X^{-1})/2} }{ 2^{mp/2}\Gamma_p(m/2)},</span>
-<a name="l01061"></a>01061                         mat M = Y.<a class="code" href="classbdm_1_1chmat.html#a4b4c5d4dbb8a3d585b68d936cb6df31b" title="Conversion to full matrix.">to_mat</a>() * iX.to_mat();
-<a name="l01062"></a>01062 
-<a name="l01063"></a>01063                         <span class="keywordtype">double</span> log1 = 0.5 * p * (2 * Y.<a class="code" href="classbdm_1_1chmat.html#a949ccd174ed19f9cfe36366cbd5c56a4" title="Logarithm of a determinant.">logdet</a>()) - 0.5 * (<a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464" title="parameter delta">delta</a> + p + 1) * (2 * X.<a class="code" href="classbdm_1_1chmat.html#a949ccd174ed19f9cfe36366cbd5c56a4" title="Logarithm of a determinant.">logdet</a>()) - 0.5 * trace (M);
-<a name="l01064"></a>01064                         <span class="comment">//Fixme! Multivariate gamma omitted!! it is ok for sampling, but not otherwise!!</span>
-<a name="l01065"></a>01065 
-<a name="l01066"></a>01066                         <span class="comment">/*                              if (0) {</span>
-<a name="l01067"></a>01067 <span class="comment">                                                                mat XX=X.to_mat();</span>
-<a name="l01068"></a>01068 <span class="comment">                                                                mat YY=Y.to_mat();</span>
-<a name="l01069"></a>01069 <span class="comment"></span>
-<a name="l01070"></a>01070 <span class="comment">                                                                double log2 = 0.5*p*log(det(YY))-0.5*(delta+p+1)*log(det(XX))-0.5*trace(YY*inv(XX));</span>
-<a name="l01071"></a>01071 <span class="comment">                                                                cout &lt;&lt; log1 &lt;&lt; &quot;,&quot; &lt;&lt; log2 &lt;&lt; endl;</span>
-<a name="l01072"></a>01072 <span class="comment">                                                        }*/</span>
-<a name="l01073"></a>01073                         <span class="keywordflow">return</span> log1;
-<a name="l01074"></a>01074                 };
-<a name="l01075"></a>01075 
-<a name="l01076"></a>01076 };
-<a name="l01077"></a>01077 
-<a name="l01079"></a><a class="code" href="classbdm_1_1rwiWishartCh.html">01079</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1rwiWishartCh.html" title="Random Walk on inverse Wishart.">rwiWishartCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;eiWishartCh&gt;
-<a name="l01080"></a>01080 {
-<a name="l01081"></a>01081         <span class="keyword">protected</span>:
-<a name="l01083"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb">01083</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a>;
-<a name="l01085"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a">01085</a>                 vec <a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a" title="reference point for diagonal">refl</a>;
-<a name="l01087"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861">01087</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a>;
-<a name="l01089"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663">01089</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>;
-<a name="l01090"></a>01090 
-<a name="l01091"></a>01091         <span class="keyword">public</span>:
-<a name="l01092"></a>01092                 <a class="code" href="classbdm_1_1rwiWishartCh.html" title="Random Walk on inverse Wishart.">rwiWishartCh</a>() : <a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a> (0), <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a> (0), <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> (0) {}
-<a name="l01094"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a28549ee3ce1ff8509360171ea3cf717c">01094</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a28549ee3ce1ff8509360171ea3cf717c" title="constructor function">set_parameters</a> (<span class="keywordtype">int</span> p0, <span class="keywordtype">double</span> k, vec ref0, <span class="keywordtype">double</span> l0) {
-<a name="l01095"></a>01095                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> = p0;
-<a name="l01096"></a>01096                         <span class="keywordtype">double</span> delta = 2 / (k * k) + <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> + 3;
-<a name="l01097"></a>01097                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a> = sqrt (delta - <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> - 1);
-<a name="l01098"></a>01098                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a> = l0;
-<a name="l01099"></a>01099                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a" title="reference point for diagonal">refl</a> = pow (ref0, 1 - <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a>);
-<a name="l01100"></a>01100 
-<a name="l01101"></a>01101                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1eiWishartCh.html#af463caed9d22d9949f3ee67614e7dcd3" title="constructor function">set_parameters</a> (eye (<a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>), delta);
-<a name="l01102"></a>01102                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1epdf.html#a7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>();
-<a name="l01103"></a>01103                 }
-<a name="l01104"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6">01104</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;c) {
-<a name="l01105"></a>01105                         vec z = c;
-<a name="l01106"></a>01106                         <span class="keywordtype">int</span> ri = 0;
-<a name="l01107"></a>01107                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>*<a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>;i += (p + 1)) {<span class="comment">//trace diagonal element</span>
-<a name="l01108"></a>01108                                 z (i) = pow (z (i), <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a>) * <a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a" title="reference point for diagonal">refl</a> (ri);
-<a name="l01109"></a>01109                                 ri++;
-<a name="l01110"></a>01110                         }
-<a name="l01111"></a>01111 
-<a name="l01112"></a>01112                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1eiWishartCh.html#ad9947933dfc94546cbd6a81f95ec5af5" title="access function">_setY</a> (<a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a>*z);
-<a name="l01113"></a>01113                 }
-<a name="l01114"></a>01114 };
-<a name="l01115"></a>01115 
-<a name="l01117"></a>01117 <span class="keyword">enum</span> RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 };
-<a name="l01123"></a><a class="code" href="classbdm_1_1eEmp.html">01123</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
-<a name="l01124"></a>01124 {
-<a name="l01125"></a>01125         <span class="keyword">protected</span> :
-<a name="l01127"></a><a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031">01127</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;
-<a name="l01129"></a><a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d">01129</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;
-<a name="l01131"></a><a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3">01131</a>                 Array&lt;vec&gt; <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;
-<a name="l01132"></a>01132         <span class="keyword">public</span>:
-<a name="l01135"></a>01135                 <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a> () : <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> (), <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (), <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> () {};
-<a name="l01137"></a><a class="code" href="classbdm_1_1eEmp.html#aa3daf6363455af099921715e1233c076">01137</a>                 <a class="code" href="classbdm_1_1eEmp.html#aa3daf6363455af099921715e1233c076" title="copy constructor">eEmp</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a> &amp;e) : <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> (e), <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (e.<a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>), <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (e.<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>) {};
-<a name="l01139"></a>01139 
-<a name="l01141"></a>01141                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ae7f8f98310c1de51bd5c8a1c87528f72" title="Set samples and weights.">set_statistics</a> (<span class="keyword">const</span> vec &amp;w0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> &amp;pdf0);
-<a name="l01143"></a><a class="code" href="classbdm_1_1eEmp.html#a4f7e6ba7183972e3c7ae399613861b95">01143</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#a4f7e6ba7183972e3c7ae399613861b95" title="Set samples and weights.">set_statistics</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> &amp;pdf0 , <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>) {<a class="code" href="classbdm_1_1eEmp.html#a4f7e6ba7183972e3c7ae399613861b95" title="Set samples and weights.">set_statistics</a> (ones (n) / n, pdf0);};
-<a name="l01145"></a>01145                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ab62d802b8ef39f7c4dcbeb366c90951a" title="Set sample.">set_samples</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* pdf0);
-<a name="l01147"></a><a class="code" href="classbdm_1_1eEmp.html#ac74c281d652356c19b6b079e42ca7ef1">01147</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ac74c281d652356c19b6b079e42ca7ef1" title="Set sample.">set_parameters</a> (<span class="keywordtype">int</span> n0, <span class="keywordtype">bool</span> copy = <span class="keyword">true</span>) {<a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a> = n0; <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>.set_size (n0, copy);<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>.set_size (n0, copy);};
-<a name="l01149"></a><a class="code" href="classbdm_1_1eEmp.html#a37937007a3a676cf653a7de412674481">01149</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#a37937007a3a676cf653a7de412674481" title="Set samples.">set_parameters</a> (<span class="keyword">const</span> Array&lt;vec&gt; &amp;Av) {
-<a name="l01150"></a>01150                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a>(Av.size()&gt;0,<span class="stringliteral">&quot;Empty samples&quot;</span>); 
-<a name="l01151"></a>01151                         <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a> = Av.size(); 
-<a name="l01152"></a>01152                         <a class="code" href="classbdm_1_1eEmp.html#ac74c281d652356c19b6b079e42ca7ef1" title="Set sample.">epdf::set_parameters</a>(Av(0).length());
-<a name="l01153"></a>01153                         <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>=1/n*ones(n);
-<a name="l01154"></a>01154                         <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>=Av;
-<a name="l01155"></a>01155                 };
-<a name="l01157"></a><a class="code" href="classbdm_1_1eEmp.html#ad7f83cc0415cd44ae7cc8b4bdad93aef">01157</a>                 vec&amp; <a class="code" href="classbdm_1_1eEmp.html#ad7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>()  {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
-<a name="l01159"></a><a class="code" href="classbdm_1_1eEmp.html#ab7d7106f486e3fad38590914a693d714">01159</a>                 <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1eEmp.html#ab7d7106f486e3fad38590914a693d714" title="Potentially dangerous, use with care.">_w</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
-<a name="l01161"></a><a class="code" href="classbdm_1_1eEmp.html#ac24966b0aaeb767bc8a6b4fd60931be2">01161</a>                 Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#ac24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
-<a name="l01163"></a><a class="code" href="classbdm_1_1eEmp.html#ab59af0efdb009d98ea8ebfa965e74ae2">01163</a>                 <span class="keyword">const</span> Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#ab59af0efdb009d98ea8ebfa965e74ae2" title="access function">_samples</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
-<a name="l01165"></a>01165                 ivec <a class="code" href="classbdm_1_1eEmp.html#af06ce255de5dbb2313f52ee51f82ba3d" title="Function performs resampling, i.e. removal of low-weight samples and duplication...">resample</a> (RESAMPLING_METHOD method = SYSTEMATIC);
-<a name="l01166"></a>01166 
-<a name="l01168"></a><a class="code" href="classbdm_1_1eEmp.html#a97f1e07b5ae6eebc91c7365f0f88d270">01168</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#a97f1e07b5ae6eebc91c7365f0f88d270" title="inherited operation : NOT implemented">sample</a>()<span class="keyword"> const </span>{
-<a name="l01169"></a>01169                         <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> (<span class="stringliteral">&quot;Not implemented&quot;</span>);
-<a name="l01170"></a>01170                         <span class="keywordflow">return</span> vec();
-<a name="l01171"></a>01171                 }
-<a name="l01172"></a>01172 
-<a name="l01174"></a><a class="code" href="classbdm_1_1eEmp.html#a01654c014d3aa068f8d4ecba4be86d09">01174</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eEmp.html#a01654c014d3aa068f8d4ecba4be86d09" title="inherited operation : NOT implemented">evallog</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const </span>{
-<a name="l01175"></a>01175                         <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> (<span class="stringliteral">&quot;Not implemented&quot;</span>);
-<a name="l01176"></a>01176                         <span class="keywordflow">return</span> 0.0;
-<a name="l01177"></a>01177                 }
-<a name="l01178"></a>01178 
-<a name="l01179"></a><a class="code" href="classbdm_1_1eEmp.html#abbfcb4f868c7381298c281a256d8c4b9">01179</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#abbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>()<span class="keyword"> const </span>{
-<a name="l01180"></a>01180                         vec pom = zeros (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l01181"></a>01181                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++) {pom += <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) * <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (i);}
-<a name="l01182"></a>01182                         <span class="keywordflow">return</span> pom;
-<a name="l01183"></a>01183                 }
-<a name="l01184"></a><a class="code" href="classbdm_1_1eEmp.html#a05e9ebf467ede737cb6a3621d7fd3c87">01184</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#a05e9ebf467ede737cb6a3621d7fd3c87" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
-<a name="l01185"></a>01185                         vec pom = zeros (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l01186"></a>01186                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++) {pom += pow (<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i), 2) * <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (i);}
-<a name="l01187"></a>01187                         <span class="keywordflow">return</span> pom -pow (<a class="code" href="classbdm_1_1eEmp.html#abbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>(), 2);
-<a name="l01188"></a>01188                 }
-<a name="l01190"></a><a class="code" href="classbdm_1_1eEmp.html#ab1c9df656144edf79ba2d885613f661f">01190</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ab1c9df656144edf79ba2d885613f661f" title="For this class, qbounds are minimum and maximum value of the population!">qbounds</a> (vec &amp;lb, vec &amp;ub, <span class="keywordtype">double</span> perc = 0.95)<span class="keyword"> const </span>{
-<a name="l01191"></a>01191                         <span class="comment">// lb in inf so than it will be pushed below;</span>
-<a name="l01192"></a>01192                         lb.set_size (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l01193"></a>01193                         ub.set_size (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l01194"></a>01194                         lb = std::numeric_limits&lt;double&gt;::infinity();
-<a name="l01195"></a>01195                         ub = -std::numeric_limits&lt;double&gt;::infinity();
-<a name="l01196"></a>01196                         <span class="keywordtype">int</span> j;
-<a name="l01197"></a>01197                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++) {
-<a name="l01198"></a>01198                                 <span class="keywordflow">for</span> (j = 0;j &lt; <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>; j++) {
-<a name="l01199"></a>01199                                         <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j) &lt; lb (j)) {lb (j) = <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j);}
-<a name="l01200"></a>01200                                         <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j) &gt; ub (j)) {ub (j) = <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j);}
-<a name="l01201"></a>01201                                 }
-<a name="l01202"></a>01202                         }
-<a name="l01203"></a>01203                 }
-<a name="l01204"></a>01204 };
-<a name="l01205"></a>01205 
-<a name="l01206"></a>01206 
-<a name="l01208"></a>01208 
-<a name="l01209"></a>01209 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01210"></a>01210 <span class="keywordtype">void</span> enorm&lt;sq_T&gt;::set_parameters (<span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R0)
-<a name="l01211"></a>01211 {
-<a name="l01212"></a>01212 <span class="comment">//Fixme test dimensions of mu0 and R0;</span>
-<a name="l01213"></a>01213         mu = mu0;
-<a name="l01214"></a>01214         R = R0;
-<a name="l01215"></a>01215         <a class="code" href="classbdm_1_1root.html#a1c314bd6d6dacb8ba78ea5eb88fd9516" title="This method TODO.">validate</a>();
-<a name="l01216"></a>01216 };
-<a name="l01217"></a>01217 
-<a name="l01218"></a>01218 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01219"></a><a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6">01219</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" title="Load from structure with elements:.">enorm&lt;sq_T&gt;::from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>)
-<a name="l01220"></a>01220 {
-<a name="l01221"></a>01221         <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" title="Load from structure with elements:.">epdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">//reads rv</span>
-<a name="l01222"></a>01222 
-<a name="l01223"></a>01223         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;mu&quot;</span>, UI::compulsory);
-<a name="l01224"></a>01224         mat Rtmp;<span class="comment">// necessary for conversion</span>
-<a name="l01225"></a>01225         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (Rtmp, <span class="keyword">set</span>, <span class="stringliteral">&quot;R&quot;</span>, UI::compulsory);
-<a name="l01226"></a>01226         <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a> = Rtmp; <span class="comment">// conversion</span>
-<a name="l01227"></a>01227         <a class="code" href="classbdm_1_1enorm.html#a38eb17ecb75d94a50b6782fcf735cfea" title="This method TODO.">validate</a>();
-<a name="l01228"></a>01228 }
-<a name="l01229"></a>01229 
-<a name="l01230"></a>01230 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01231"></a><a class="code" href="classbdm_1_1enorm.html#ad2e0d3a1e30ab3ab04df2d0c43ae74a2">01231</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#ad2e0d3a1e30ab3ab04df2d0c43ae74a2" title="dupdate in exponential form (not really handy)">enorm&lt;sq_T&gt;::dupdate</a> (mat &amp;v, <span class="keywordtype">double</span> nu)
-<a name="l01232"></a>01232 {
-<a name="l01233"></a>01233         <span class="comment">//</span>
-<a name="l01234"></a>01234 };
-<a name="l01235"></a>01235 
-<a name="l01236"></a>01236 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l01237"></a>01237 <span class="comment">// void enorm&lt;sq_T&gt;::tupdate ( double phi, mat &amp;vbar, double nubar ) {</span>
-<a name="l01238"></a>01238 <span class="comment">//      //</span>
-<a name="l01239"></a>01239 <span class="comment">// };</span>
-<a name="l01240"></a>01240 
-<a name="l01241"></a>01241 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01242"></a><a class="code" href="classbdm_1_1enorm.html#ae1a48f52351ec3a349bd443b713b1766">01242</a> vec <a class="code" href="classbdm_1_1enorm.html#ae1a48f52351ec3a349bd443b713b1766" title="Returns a sample,  from density .">enorm&lt;sq_T&gt;::sample</a>()<span class="keyword"> const</span>
-<a name="l01243"></a>01243 <span class="keyword"></span>{
-<a name="l01244"></a>01244         vec x (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l01245"></a>01245 <span class="preprocessor">#pragma omp critical</span>
-<a name="l01246"></a>01246 <span class="preprocessor"></span>        NorRNG.sample_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, x);
-<a name="l01247"></a>01247         vec smp = <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult (x);
+<a name="l00949"></a><a class="code" href="classbdm_1_1mlognorm.html#a604cab0e8a76f9041dc3c606043bb39f">00949</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a604cab0e8a76f9041dc3c606043bb39f" title="Set value of k.">set_parameters</a> (<span class="keywordtype">int</span> size, <span class="keywordtype">double</span> k) {
+<a name="l00950"></a>00950                         <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a> = 0.5 * log (k * k + 1);
+<a name="l00951"></a>00951                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (zeros (size), 2*<a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>*eye (size));
+<a name="l00952"></a>00952 
+<a name="l00953"></a>00953                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = size;
+<a name="l00954"></a>00954                 };
+<a name="l00955"></a>00955 
+<a name="l00956"></a><a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e">00956</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;val) {
+<a name="l00957"></a>00957                         <a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a> = log (val) - <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>;<span class="comment">//elem_mult ( refl,pow ( val,l ) );</span>
+<a name="l00958"></a>00958                 };
+<a name="l00959"></a>00959 
+<a name="l00978"></a>00978                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a49e45ea13a869da607ef9be7a229128a">from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>);
+<a name="l00979"></a>00979 
+<a name="l00980"></a>00980                 <span class="comment">// TODO dodelat void to_setting( Setting &amp;set ) const;</span>
+<a name="l00981"></a>00981 
+<a name="l00982"></a>00982 };
+<a name="l00983"></a>00983 
+<a name="l00984"></a>00984 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> (mlognorm);
+<a name="l00985"></a>00985 SHAREDPTR (mlognorm);
+<a name="l00986"></a>00986 
+<a name="l00990"></a><a class="code" href="classbdm_1_1eWishartCh.html">00990</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eWishartCh.html">eWishartCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
+<a name="l00991"></a>00991 {
+<a name="l00992"></a>00992         <span class="keyword">protected</span>:
+<a name="l00994"></a><a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490">00994</a>                 <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>;
+<a name="l00996"></a><a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f">00996</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>;
+<a name="l00998"></a><a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3">00998</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>;
+<a name="l00999"></a>00999         <span class="keyword">public</span>:
+<a name="l01001"></a><a class="code" href="classbdm_1_1eWishartCh.html#a183d961532ee97b7dc5ec81701aa59a0">01001</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#a183d961532ee97b7dc5ec81701aa59a0" title="Set internal structures.">set_parameters</a> (<span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0) {<a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a> = <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> (Y0);<a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a> = delta0; <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a> = <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1sqmat.html#a73e639221343dcce76c3305524d67590" title="Reimplementing common functions of mat: rows().">rows</a>(); <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a> * <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>; }
+<a name="l01003"></a><a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339">01003</a>                 mat <a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339" title="Sample matrix argument.">sample_mat</a>()<span class="keyword"> const </span>{
+<a name="l01004"></a>01004                         mat X = zeros (<a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>, <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>);
+<a name="l01005"></a>01005 
+<a name="l01006"></a>01006                         <span class="comment">//sample diagonal</span>
+<a name="l01007"></a>01007                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>;i++) {
+<a name="l01008"></a>01008                                 GamRNG.setup (0.5* (<a class="code" href="classbdm_1_1eWishartCh.html#a1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a> - i) , 0.5);   <span class="comment">// no +1 !! index if from 0</span>
+<a name="l01009"></a>01009 <span class="preprocessor">#pragma omp critical</span>
+<a name="l01010"></a>01010 <span class="preprocessor"></span>                                X (i, i) = sqrt (GamRNG());
+<a name="l01011"></a>01011                         }
+<a name="l01012"></a>01012                         <span class="comment">//do the rest</span>
+<a name="l01013"></a>01013                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; p;i++) {
+<a name="l01014"></a>01014                                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1;j &lt; p;j++) {
+<a name="l01015"></a>01015 <span class="preprocessor">#pragma omp critical</span>
+<a name="l01016"></a>01016 <span class="preprocessor"></span>                                        X (i, j) = NorRNG.sample();
+<a name="l01017"></a>01017                                 }
+<a name="l01018"></a>01018                         }
+<a name="l01019"></a>01019                         <span class="keywordflow">return</span> X*<a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>();<span class="comment">// return upper triangular part of the decomposition</span>
+<a name="l01020"></a>01020                 }
+<a name="l01021"></a><a class="code" href="classbdm_1_1eWishartCh.html#a8f2154b8b5be8f4c5788f261b6d57b9a">01021</a>                 vec <a class="code" href="classbdm_1_1eWishartCh.html#a8f2154b8b5be8f4c5788f261b6d57b9a" title="Returns a sample,  from density .">sample</a> ()<span class="keyword"> const </span>{
+<a name="l01022"></a>01022                         <span class="keywordflow">return</span> vec (<a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339" title="Sample matrix argument.">sample_mat</a>()._data(), <a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>*<a class="code" href="classbdm_1_1eWishartCh.html#ab745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>);
+<a name="l01023"></a>01023                 }
+<a name="l01025"></a><a class="code" href="classbdm_1_1eWishartCh.html#a4eee757c0535c2a88bb20f0767c64981">01025</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#a4eee757c0535c2a88bb20f0767c64981" title="fast access function y0 will be copied into Y.Ch.">setY</a> (<span class="keyword">const</span> mat &amp;Ch0) {copy_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, Ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>()._data());}
+<a name="l01027"></a><a class="code" href="classbdm_1_1eWishartCh.html#a7eac414ec10b85aa5536b0092c57bc4a">01027</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#a7eac414ec10b85aa5536b0092c57bc4a" title="fast access function y0 will be copied into Y.Ch.">_setY</a> (<span class="keyword">const</span> vec &amp;ch0) {copy_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>()._data()); }
+<a name="l01029"></a><a class="code" href="classbdm_1_1eWishartCh.html#a1708cacb5d8cb1b96395d35f5327cb7e">01029</a>                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classbdm_1_1eWishartCh.html#a1708cacb5d8cb1b96395d35f5327cb7e" title="access function">getY</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eWishartCh.html#a1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>;}
+<a name="l01030"></a>01030 };
+<a name="l01031"></a>01031 
+<a name="l01033"></a>01033 
+<a name="l01035"></a><a class="code" href="classbdm_1_1eiWishartCh.html">01035</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eiWishartCh.html" title="Inverse Wishart on Choleski decomposition.">eiWishartCh</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
+<a name="l01036"></a>01036 {
+<a name="l01037"></a>01037         <span class="keyword">protected</span>:
+<a name="l01039"></a><a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a">01039</a>                 <a class="code" href="classbdm_1_1eWishartCh.html">eWishartCh</a> <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>;
+<a name="l01041"></a><a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd">01041</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>;
+<a name="l01043"></a><a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464">01043</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464" title="parameter delta">delta</a>;
+<a name="l01044"></a>01044         <span class="keyword">public</span>:
+<a name="l01046"></a><a class="code" href="classbdm_1_1eiWishartCh.html#af463caed9d22d9949f3ee67614e7dcd3">01046</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eiWishartCh.html#af463caed9d22d9949f3ee67614e7dcd3" title="constructor function">set_parameters</a> (<span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0) {
+<a name="l01047"></a>01047                         <a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464" title="parameter delta">delta</a> = delta0;
+<a name="l01048"></a>01048                         <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a183d961532ee97b7dc5ec81701aa59a0" title="Set internal structures.">set_parameters</a> (inv (Y0), delta0);
+<a name="l01049"></a>01049                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1epdf.html#a7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>(); <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a> = Y0.rows();
+<a name="l01050"></a>01050                 }
+<a name="l01051"></a><a class="code" href="classbdm_1_1eiWishartCh.html#a2f668192cc9c2e3a5b7e608164685a3e">01051</a>                 vec <a class="code" href="classbdm_1_1eiWishartCh.html#a2f668192cc9c2e3a5b7e608164685a3e" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{mat iCh; iCh = inv (<a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#acc664035d70d2622bf264a29270f8339" title="Sample matrix argument.">sample_mat</a>()); <span class="keywordflow">return</span> vec (iCh._data(), <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);}
+<a name="l01053"></a><a class="code" href="classbdm_1_1eiWishartCh.html#ad9947933dfc94546cbd6a81f95ec5af5">01053</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eiWishartCh.html#ad9947933dfc94546cbd6a81f95ec5af5" title="access function">_setY</a> (<span class="keyword">const</span> vec &amp;y0) {
+<a name="l01054"></a>01054                         mat Ch (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>, <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>);
+<a name="l01055"></a>01055                         mat iCh (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>, <a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>);
+<a name="l01056"></a>01056                         copy_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, y0._data(), Ch._data());
+<a name="l01057"></a>01057 
+<a name="l01058"></a>01058                         iCh = inv (Ch);
+<a name="l01059"></a>01059                         <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a4eee757c0535c2a88bb20f0767c64981" title="fast access function y0 will be copied into Y.Ch.">setY</a> (iCh);
+<a name="l01060"></a>01060                 }
+<a name="l01061"></a><a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb">01061</a>                 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const </span>{
+<a name="l01062"></a>01062                         <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> X (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>);
+<a name="l01063"></a>01063                         <span class="keyword">const</span> <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; Y = <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a1708cacb5d8cb1b96395d35f5327cb7e" title="access function">getY</a>();
+<a name="l01064"></a>01064 
+<a name="l01065"></a>01065                         copy_vector (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>*<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>, val._data(), X.<a class="code" href="classbdm_1_1chmat.html#a17daa8c5c5914bd3194cb3053c5793a5" title="Access function.">_Ch</a>()._data());
+<a name="l01066"></a>01066                         <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> iX (p);X.<a class="code" href="classbdm_1_1chmat.html#acbf3389db96dff41fb2e9532d59b13c0" title="Inversion in the same form, i.e. cholesky.">inv</a> (iX);
+<a name="l01067"></a>01067                         <span class="comment">// compute</span>
+<a name="l01068"></a>01068 <span class="comment">//                              \frac{ |\Psi|^{m/2}|X|^{-(m+p+1)/2}e^{-tr(\Psi X^{-1})/2} }{ 2^{mp/2}\Gamma_p(m/2)},</span>
+<a name="l01069"></a>01069                         mat M = Y.<a class="code" href="classbdm_1_1chmat.html#a4b4c5d4dbb8a3d585b68d936cb6df31b" title="Conversion to full matrix.">to_mat</a>() * iX.to_mat();
+<a name="l01070"></a>01070 
+<a name="l01071"></a>01071                         <span class="keywordtype">double</span> log1 = 0.5 * p * (2 * Y.<a class="code" href="classbdm_1_1chmat.html#a949ccd174ed19f9cfe36366cbd5c56a4" title="Logarithm of a determinant.">logdet</a>()) - 0.5 * (<a class="code" href="classbdm_1_1eiWishartCh.html#aca3035f7bd5e4597cc1843cf07af8464" title="parameter delta">delta</a> + p + 1) * (2 * X.<a class="code" href="classbdm_1_1chmat.html#a949ccd174ed19f9cfe36366cbd5c56a4" title="Logarithm of a determinant.">logdet</a>()) - 0.5 * trace (M);
+<a name="l01072"></a>01072                         <span class="comment">//Fixme! Multivariate gamma omitted!! it is ok for sampling, but not otherwise!!</span>
+<a name="l01073"></a>01073 
+<a name="l01074"></a>01074                         <span class="comment">/*                              if (0) {</span>
+<a name="l01075"></a>01075 <span class="comment">                                                                mat XX=X.to_mat();</span>
+<a name="l01076"></a>01076 <span class="comment">                                                                mat YY=Y.to_mat();</span>
+<a name="l01077"></a>01077 <span class="comment"></span>
+<a name="l01078"></a>01078 <span class="comment">                                                                double log2 = 0.5*p*log(det(YY))-0.5*(delta+p+1)*log(det(XX))-0.5*trace(YY*inv(XX));</span>
+<a name="l01079"></a>01079 <span class="comment">                                                                cout &lt;&lt; log1 &lt;&lt; &quot;,&quot; &lt;&lt; log2 &lt;&lt; endl;</span>
+<a name="l01080"></a>01080 <span class="comment">                                                        }*/</span>
+<a name="l01081"></a>01081                         <span class="keywordflow">return</span> log1;
+<a name="l01082"></a>01082                 };
+<a name="l01083"></a>01083 
+<a name="l01084"></a>01084 };
+<a name="l01085"></a>01085 
+<a name="l01087"></a><a class="code" href="classbdm_1_1rwiWishartCh.html">01087</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1rwiWishartCh.html" title="Random Walk on inverse Wishart.">rwiWishartCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a>&lt;eiWishartCh&gt;
+<a name="l01088"></a>01088 {
+<a name="l01089"></a>01089         <span class="keyword">protected</span>:
+<a name="l01091"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb">01091</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a>;
+<a name="l01093"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a">01093</a>                 vec <a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a" title="reference point for diagonal">refl</a>;
+<a name="l01095"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861">01095</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a>;
+<a name="l01097"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663">01097</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>;
+<a name="l01098"></a>01098 
+<a name="l01099"></a>01099         <span class="keyword">public</span>:
+<a name="l01100"></a>01100                 <a class="code" href="classbdm_1_1rwiWishartCh.html" title="Random Walk on inverse Wishart.">rwiWishartCh</a>() : <a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a> (0), <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a> (0), <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> (0) {}
+<a name="l01102"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#a28549ee3ce1ff8509360171ea3cf717c">01102</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#a28549ee3ce1ff8509360171ea3cf717c" title="constructor function">set_parameters</a> (<span class="keywordtype">int</span> p0, <span class="keywordtype">double</span> k, vec ref0, <span class="keywordtype">double</span> l0) {
+<a name="l01103"></a>01103                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> = p0;
+<a name="l01104"></a>01104                         <span class="keywordtype">double</span> delta = 2 / (k * k) + <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> + 3;
+<a name="l01105"></a>01105                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a> = sqrt (delta - <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a> - 1);
+<a name="l01106"></a>01106                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a> = l0;
+<a name="l01107"></a>01107                         <a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a" title="reference point for diagonal">refl</a> = pow (ref0, 1 - <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a>);
+<a name="l01108"></a>01108 
+<a name="l01109"></a>01109                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1eiWishartCh.html#af463caed9d22d9949f3ee67614e7dcd3" title="constructor function">set_parameters</a> (eye (<a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>), delta);
+<a name="l01110"></a>01110                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1epdf.html#a7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>();
+<a name="l01111"></a>01111                 }
+<a name="l01112"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6">01112</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &amp;c) {
+<a name="l01113"></a>01113                         vec z = c;
+<a name="l01114"></a>01114                         <span class="keywordtype">int</span> ri = 0;
+<a name="l01115"></a>01115                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>*<a class="code" href="classbdm_1_1rwiWishartCh.html#a7ba06d431995c347d2fce30a59c20663" title="dimension">p</a>;i += (p + 1)) {<span class="comment">//trace diagonal element</span>
+<a name="l01116"></a>01116                                 z (i) = pow (z (i), <a class="code" href="classbdm_1_1rwiWishartCh.html#a758cd05efa67c60b4bf4f7554b9ba861" title="power of the reference">l</a>) * <a class="code" href="classbdm_1_1rwiWishartCh.html#a239b26c71ebcc118ba6925dfb6efc50a" title="reference point for diagonal">refl</a> (ri);
+<a name="l01117"></a>01117                                 ri++;
+<a name="l01118"></a>01118                         }
+<a name="l01119"></a>01119 
+<a name="l01120"></a>01120                         <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1eiWishartCh.html#ad9947933dfc94546cbd6a81f95ec5af5" title="access function">_setY</a> (<a class="code" href="classbdm_1_1rwiWishartCh.html#a2004675b37f712abe3913057bae97cfb" title="square root of  - needed for computation of  from conditions">sqd</a>*z);
+<a name="l01121"></a>01121                 }
+<a name="l01122"></a>01122 };
+<a name="l01123"></a>01123 
+<a name="l01125"></a>01125 <span class="keyword">enum</span> RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 };
+<a name="l01131"></a><a class="code" href="classbdm_1_1eEmp.html">01131</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
+<a name="l01132"></a>01132 {
+<a name="l01133"></a>01133         <span class="keyword">protected</span> :
+<a name="l01135"></a><a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031">01135</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;
+<a name="l01137"></a><a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d">01137</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;
+<a name="l01139"></a><a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3">01139</a>                 Array&lt;vec&gt; <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;
+<a name="l01140"></a>01140         <span class="keyword">public</span>:
+<a name="l01143"></a>01143                 <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a> () : <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> (), <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (), <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> () {};
+<a name="l01145"></a><a class="code" href="classbdm_1_1eEmp.html#aa3daf6363455af099921715e1233c076">01145</a>                 <a class="code" href="classbdm_1_1eEmp.html#aa3daf6363455af099921715e1233c076" title="copy constructor">eEmp</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a> &amp;e) : <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> (e), <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (e.<a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>), <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (e.<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>) {};
+<a name="l01147"></a>01147 
+<a name="l01149"></a>01149                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ae7f8f98310c1de51bd5c8a1c87528f72" title="Set samples and weights.">set_statistics</a> (<span class="keyword">const</span> vec &amp;w0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> &amp;pdf0);
+<a name="l01151"></a><a class="code" href="classbdm_1_1eEmp.html#a4f7e6ba7183972e3c7ae399613861b95">01151</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#a4f7e6ba7183972e3c7ae399613861b95" title="Set samples and weights.">set_statistics</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> &amp;pdf0 , <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>) {<a class="code" href="classbdm_1_1eEmp.html#a4f7e6ba7183972e3c7ae399613861b95" title="Set samples and weights.">set_statistics</a> (ones (n) / n, pdf0);};
+<a name="l01153"></a>01153                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ab62d802b8ef39f7c4dcbeb366c90951a" title="Set sample.">set_samples</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* pdf0);
+<a name="l01155"></a><a class="code" href="classbdm_1_1eEmp.html#ac74c281d652356c19b6b079e42ca7ef1">01155</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ac74c281d652356c19b6b079e42ca7ef1" title="Set sample.">set_parameters</a> (<span class="keywordtype">int</span> n0, <span class="keywordtype">bool</span> copy = <span class="keyword">true</span>) {<a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a> = n0; <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>.set_size (n0, copy);<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>.set_size (n0, copy);};
+<a name="l01157"></a><a class="code" href="classbdm_1_1eEmp.html#a37937007a3a676cf653a7de412674481">01157</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#a37937007a3a676cf653a7de412674481" title="Set samples.">set_parameters</a> (<span class="keyword">const</span> Array&lt;vec&gt; &amp;Av) {
+<a name="l01158"></a>01158                         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a>(Av.size()&gt;0,<span class="stringliteral">&quot;Empty samples&quot;</span>); 
+<a name="l01159"></a>01159                         <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a> = Av.size(); 
+<a name="l01160"></a>01160                         <a class="code" href="classbdm_1_1eEmp.html#ac74c281d652356c19b6b079e42ca7ef1" title="Set sample.">epdf::set_parameters</a>(Av(0).length());
+<a name="l01161"></a>01161                         <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>=1/n*ones(n);
+<a name="l01162"></a>01162                         <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>=Av;
+<a name="l01163"></a>01163                 };
+<a name="l01165"></a><a class="code" href="classbdm_1_1eEmp.html#ad7f83cc0415cd44ae7cc8b4bdad93aef">01165</a>                 vec&amp; <a class="code" href="classbdm_1_1eEmp.html#ad7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>()  {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
+<a name="l01167"></a><a class="code" href="classbdm_1_1eEmp.html#ab7d7106f486e3fad38590914a693d714">01167</a>                 <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1eEmp.html#ab7d7106f486e3fad38590914a693d714" title="Potentially dangerous, use with care.">_w</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
+<a name="l01169"></a><a class="code" href="classbdm_1_1eEmp.html#ac24966b0aaeb767bc8a6b4fd60931be2">01169</a>                 Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#ac24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
+<a name="l01171"></a><a class="code" href="classbdm_1_1eEmp.html#ab59af0efdb009d98ea8ebfa965e74ae2">01171</a>                 <span class="keyword">const</span> Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#ab59af0efdb009d98ea8ebfa965e74ae2" title="access function">_samples</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
+<a name="l01173"></a>01173                 ivec <a class="code" href="classbdm_1_1eEmp.html#af06ce255de5dbb2313f52ee51f82ba3d" title="Function performs resampling, i.e. removal of low-weight samples and duplication...">resample</a> (RESAMPLING_METHOD method = SYSTEMATIC);
+<a name="l01174"></a>01174 
+<a name="l01176"></a><a class="code" href="classbdm_1_1eEmp.html#a97f1e07b5ae6eebc91c7365f0f88d270">01176</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#a97f1e07b5ae6eebc91c7365f0f88d270" title="inherited operation : NOT implemented">sample</a>()<span class="keyword"> const </span>{
+<a name="l01177"></a>01177                         <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> (<span class="stringliteral">&quot;Not implemented&quot;</span>);
+<a name="l01178"></a>01178                         <span class="keywordflow">return</span> vec();
+<a name="l01179"></a>01179                 }
+<a name="l01180"></a>01180 
+<a name="l01182"></a><a class="code" href="classbdm_1_1eEmp.html#a01654c014d3aa068f8d4ecba4be86d09">01182</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eEmp.html#a01654c014d3aa068f8d4ecba4be86d09" title="inherited operation : NOT implemented">evallog</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const </span>{
+<a name="l01183"></a>01183                         <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> (<span class="stringliteral">&quot;Not implemented&quot;</span>);
+<a name="l01184"></a>01184                         <span class="keywordflow">return</span> 0.0;
+<a name="l01185"></a>01185                 }
+<a name="l01186"></a>01186 
+<a name="l01187"></a><a class="code" href="classbdm_1_1eEmp.html#abbfcb4f868c7381298c281a256d8c4b9">01187</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#abbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>()<span class="keyword"> const </span>{
+<a name="l01188"></a>01188                         vec pom = zeros (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l01189"></a>01189                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++) {pom += <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) * <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (i);}
+<a name="l01190"></a>01190                         <span class="keywordflow">return</span> pom;
+<a name="l01191"></a>01191                 }
+<a name="l01192"></a><a class="code" href="classbdm_1_1eEmp.html#a05e9ebf467ede737cb6a3621d7fd3c87">01192</a>                 vec <a class="code" href="classbdm_1_1eEmp.html#a05e9ebf467ede737cb6a3621d7fd3c87" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
+<a name="l01193"></a>01193                         vec pom = zeros (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l01194"></a>01194                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++) {pom += pow (<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i), 2) * <a class="code" href="classbdm_1_1eEmp.html#a9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (i);}
+<a name="l01195"></a>01195                         <span class="keywordflow">return</span> pom -pow (<a class="code" href="classbdm_1_1eEmp.html#abbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>(), 2);
+<a name="l01196"></a>01196                 }
+<a name="l01198"></a><a class="code" href="classbdm_1_1eEmp.html#ab1c9df656144edf79ba2d885613f661f">01198</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#ab1c9df656144edf79ba2d885613f661f" title="For this class, qbounds are minimum and maximum value of the population!">qbounds</a> (vec &amp;lb, vec &amp;ub, <span class="keywordtype">double</span> perc = 0.95)<span class="keyword"> const </span>{
+<a name="l01199"></a>01199                         <span class="comment">// lb in inf so than it will be pushed below;</span>
+<a name="l01200"></a>01200                         lb.set_size (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l01201"></a>01201                         ub.set_size (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l01202"></a>01202                         lb = std::numeric_limits&lt;double&gt;::infinity();
+<a name="l01203"></a>01203                         ub = -std::numeric_limits&lt;double&gt;::infinity();
+<a name="l01204"></a>01204                         <span class="keywordtype">int</span> j;
+<a name="l01205"></a>01205                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0;i &lt; <a class="code" href="classbdm_1_1eEmp.html#a9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++) {
+<a name="l01206"></a>01206                                 <span class="keywordflow">for</span> (j = 0;j &lt; <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>; j++) {
+<a name="l01207"></a>01207                                         <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j) &lt; lb (j)) {lb (j) = <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j);}
+<a name="l01208"></a>01208                                         <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j) &gt; ub (j)) {ub (j) = <a class="code" href="classbdm_1_1eEmp.html#a73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> (i) (j);}
+<a name="l01209"></a>01209                                 }
+<a name="l01210"></a>01210                         }
+<a name="l01211"></a>01211                 }
+<a name="l01212"></a>01212 };
+<a name="l01213"></a>01213 
+<a name="l01214"></a>01214 
+<a name="l01216"></a>01216 
+<a name="l01217"></a>01217 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01218"></a>01218 <span class="keywordtype">void</span> enorm&lt;sq_T&gt;::set_parameters (<span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R0)
+<a name="l01219"></a>01219 {
+<a name="l01220"></a>01220 <span class="comment">//Fixme test dimensions of mu0 and R0;</span>
+<a name="l01221"></a>01221         mu = mu0;
+<a name="l01222"></a>01222         R = R0;
+<a name="l01223"></a>01223         <a class="code" href="classbdm_1_1root.html#a1c314bd6d6dacb8ba78ea5eb88fd9516" title="This method TODO.">validate</a>();
+<a name="l01224"></a>01224 };
+<a name="l01225"></a>01225 
+<a name="l01226"></a>01226 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01227"></a><a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6">01227</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" title="Load from structure with elements:.">enorm&lt;sq_T&gt;::from_setting</a> (<span class="keyword">const</span> Setting &amp;<span class="keyword">set</span>)
+<a name="l01228"></a>01228 {
+<a name="l01229"></a>01229         <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" title="Load from structure with elements:.">epdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">//reads rv</span>
+<a name="l01230"></a>01230 
+<a name="l01231"></a>01231         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>, <span class="keyword">set</span>, <span class="stringliteral">&quot;mu&quot;</span>, UI::compulsory);
+<a name="l01232"></a>01232         mat Rtmp;<span class="comment">// necessary for conversion</span>
+<a name="l01233"></a>01233         <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (Rtmp, <span class="keyword">set</span>, <span class="stringliteral">&quot;R&quot;</span>, UI::compulsory);
+<a name="l01234"></a>01234         <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a> = Rtmp; <span class="comment">// conversion</span>
+<a name="l01235"></a>01235         <a class="code" href="classbdm_1_1enorm.html#a38eb17ecb75d94a50b6782fcf735cfea" title="This method TODO.">validate</a>();
+<a name="l01236"></a>01236 }
+<a name="l01237"></a>01237 
+<a name="l01238"></a>01238 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01239"></a><a class="code" href="classbdm_1_1enorm.html#ad2e0d3a1e30ab3ab04df2d0c43ae74a2">01239</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#ad2e0d3a1e30ab3ab04df2d0c43ae74a2" title="dupdate in exponential form (not really handy)">enorm&lt;sq_T&gt;::dupdate</a> (mat &amp;v, <span class="keywordtype">double</span> nu)
+<a name="l01240"></a>01240 {
+<a name="l01241"></a>01241         <span class="comment">//</span>
+<a name="l01242"></a>01242 };
+<a name="l01243"></a>01243 
+<a name="l01244"></a>01244 <span class="comment">// template&lt;class sq_T&gt;</span>
+<a name="l01245"></a>01245 <span class="comment">// void enorm&lt;sq_T&gt;::tupdate ( double phi, mat &amp;vbar, double nubar ) {</span>
+<a name="l01246"></a>01246 <span class="comment">//      //</span>
+<a name="l01247"></a>01247 <span class="comment">// };</span>
 <a name="l01248"></a>01248 
-<a name="l01249"></a>01249         smp += <a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>;
-<a name="l01250"></a>01250         <span class="keywordflow">return</span> smp;
-<a name="l01251"></a>01251 };
-<a name="l01252"></a>01252 
-<a name="l01253"></a>01253 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l01254"></a>01254 <span class="comment">// double enorm&lt;sq_T&gt;::eval ( const vec &amp;val ) const {</span>
-<a name="l01255"></a>01255 <span class="comment">//      double pdfl,e;</span>
-<a name="l01256"></a>01256 <span class="comment">//      pdfl = evallog ( val );</span>
-<a name="l01257"></a>01257 <span class="comment">//      e = exp ( pdfl );</span>
-<a name="l01258"></a>01258 <span class="comment">//      return e;</span>
-<a name="l01259"></a>01259 <span class="comment">// };</span>
+<a name="l01249"></a>01249 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01250"></a><a class="code" href="classbdm_1_1enorm.html#ae1a48f52351ec3a349bd443b713b1766">01250</a> vec <a class="code" href="classbdm_1_1enorm.html#ae1a48f52351ec3a349bd443b713b1766" title="Returns a sample,  from density .">enorm&lt;sq_T&gt;::sample</a>()<span class="keyword"> const</span>
+<a name="l01251"></a>01251 <span class="keyword"></span>{
+<a name="l01252"></a>01252         vec x (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l01253"></a>01253 <span class="preprocessor">#pragma omp critical</span>
+<a name="l01254"></a>01254 <span class="preprocessor"></span>        NorRNG.sample_vector (<a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, x);
+<a name="l01255"></a>01255         vec smp = <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult (x);
+<a name="l01256"></a>01256 
+<a name="l01257"></a>01257         smp += <a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>;
+<a name="l01258"></a>01258         <span class="keywordflow">return</span> smp;
+<a name="l01259"></a>01259 };
 <a name="l01260"></a>01260 
-<a name="l01261"></a>01261 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01262"></a><a class="code" href="classbdm_1_1enorm.html#ae13aeed5b543b2179bacdc4fa2ae47a3">01262</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#ae13aeed5b543b2179bacdc4fa2ae47a3" title="Evaluate normalized log-probability.">enorm&lt;sq_T&gt;::evallog_nn</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const</span>
-<a name="l01263"></a>01263 <span class="keyword"></span>{
-<a name="l01264"></a>01264         <span class="comment">// 1.83787706640935 = log(2pi)</span>
-<a name="l01265"></a>01265         <span class="keywordtype">double</span> tmp = -0.5 * (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.invqform (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> - val));<span class="comment">// - lognc();</span>
-<a name="l01266"></a>01266         <span class="keywordflow">return</span>  tmp;
-<a name="l01267"></a>01267 };
+<a name="l01261"></a>01261 <span class="comment">// template&lt;class sq_T&gt;</span>
+<a name="l01262"></a>01262 <span class="comment">// double enorm&lt;sq_T&gt;::eval ( const vec &amp;val ) const {</span>
+<a name="l01263"></a>01263 <span class="comment">//      double pdfl,e;</span>
+<a name="l01264"></a>01264 <span class="comment">//      pdfl = evallog ( val );</span>
+<a name="l01265"></a>01265 <span class="comment">//      e = exp ( pdfl );</span>
+<a name="l01266"></a>01266 <span class="comment">//      return e;</span>
+<a name="l01267"></a>01267 <span class="comment">// };</span>
 <a name="l01268"></a>01268 
 <a name="l01269"></a>01269 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01270"></a><a class="code" href="classbdm_1_1enorm.html#a25785343aff102cc5df1cab08ba16d32">01270</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#a25785343aff102cc5df1cab08ba16d32" title="logarithm of the normalizing constant, ">enorm&lt;sq_T&gt;::lognc</a> ()<span class="keyword"> const</span>
+<a name="l01270"></a><a class="code" href="classbdm_1_1enorm.html#ae13aeed5b543b2179bacdc4fa2ae47a3">01270</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#ae13aeed5b543b2179bacdc4fa2ae47a3" title="Evaluate normalized log-probability.">enorm&lt;sq_T&gt;::evallog_nn</a> (<span class="keyword">const</span> vec &amp;val)<span class="keyword"> const</span>
 <a name="l01271"></a>01271 <span class="keyword"></span>{
 <a name="l01272"></a>01272         <span class="comment">// 1.83787706640935 = log(2pi)</span>
-<a name="l01273"></a>01273         <span class="keywordtype">double</span> tmp = 0.5 * (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.cols() * 1.83787706640935 + <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.logdet());
-<a name="l01274"></a>01274         <span class="keywordflow">return</span> tmp;
+<a name="l01273"></a>01273         <span class="keywordtype">double</span> tmp = -0.5 * (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.invqform (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> - val));<span class="comment">// - lognc();</span>
+<a name="l01274"></a>01274         <span class="keywordflow">return</span>  tmp;
 <a name="l01275"></a>01275 };
 <a name="l01276"></a>01276 
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l01279"></a>01279 <span class="comment">// vec mlnorm&lt;sq_T&gt;::samplecond (const  vec &amp;cond, double &amp;lik ) {</span>
-<a name="l01280"></a>01280 <span class="comment">//      this-&gt;condition ( cond );</span>
-<a name="l01281"></a>01281 <span class="comment">//      vec smp = epdf.sample();</span>
-<a name="l01282"></a>01282 <span class="comment">//      lik = epdf.eval ( smp );</span>
-<a name="l01283"></a>01283 <span class="comment">//      return smp;</span>
-<a name="l01284"></a>01284 <span class="comment">// }</span>
+<a name="l01277"></a>01277 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01278"></a><a class="code" href="classbdm_1_1enorm.html#a25785343aff102cc5df1cab08ba16d32">01278</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#a25785343aff102cc5df1cab08ba16d32" title="logarithm of the normalizing constant, ">enorm&lt;sq_T&gt;::lognc</a> ()<span class="keyword"> const</span>
+<a name="l01279"></a>01279 <span class="keyword"></span>{
+<a name="l01280"></a>01280         <span class="comment">// 1.83787706640935 = log(2pi)</span>
+<a name="l01281"></a>01281         <span class="keywordtype">double</span> tmp = 0.5 * (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.cols() * 1.83787706640935 + <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.logdet());
+<a name="l01282"></a>01282         <span class="keywordflow">return</span> tmp;
+<a name="l01283"></a>01283 };
+<a name="l01284"></a>01284 
 <a name="l01285"></a>01285 
 <a name="l01286"></a>01286 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l01287"></a>01287 <span class="comment">// mat mlnorm&lt;sq_T&gt;::samplecond (const vec &amp;cond, vec &amp;lik, int n ) {</span>
-<a name="l01288"></a>01288 <span class="comment">//      int i;</span>
-<a name="l01289"></a>01289 <span class="comment">//      int dim = rv.count();</span>
-<a name="l01290"></a>01290 <span class="comment">//      mat Smp ( dim,n );</span>
-<a name="l01291"></a>01291 <span class="comment">//      vec smp ( dim );</span>
-<a name="l01292"></a>01292 <span class="comment">//      this-&gt;condition ( cond );</span>
-<a name="l01293"></a>01293 <span class="comment">//</span>
-<a name="l01294"></a>01294 <span class="comment">//      for ( i=0; i&lt;n; i++ ) {</span>
-<a name="l01295"></a>01295 <span class="comment">//              smp = epdf.sample();</span>
-<a name="l01296"></a>01296 <span class="comment">//              lik ( i ) = epdf.eval ( smp );</span>
-<a name="l01297"></a>01297 <span class="comment">//              Smp.set_col ( i ,smp );</span>
-<a name="l01298"></a>01298 <span class="comment">//      }</span>
-<a name="l01299"></a>01299 <span class="comment">//</span>
-<a name="l01300"></a>01300 <span class="comment">//      return Smp;</span>
-<a name="l01301"></a>01301 <span class="comment">// }</span>
-<a name="l01302"></a>01302 
-<a name="l01303"></a>01303 
-<a name="l01304"></a>01304 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01305"></a><a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08">01305</a> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;epdf&gt;</a> <a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">enorm&lt;sq_T&gt;::marginal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span>
-<a name="l01306"></a>01306 <span class="keyword"></span>{
-<a name="l01307"></a>01307         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> *tmp = <span class="keyword">new</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> ();
-<a name="l01308"></a>01308         <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;epdf&gt;</a> narrow(tmp);
-<a name="l01309"></a>01309         <a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">marginal</a> ( rvn, *tmp );
-<a name="l01310"></a>01310         <span class="keywordflow">return</span> narrow;
-<a name="l01311"></a>01311 }
-<a name="l01312"></a>01312 
-<a name="l01313"></a>01313 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01314"></a>01314 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">enorm&lt;sq_T&gt;::marginal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn, <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> &amp;target )<span class="keyword"> const</span>
-<a name="l01315"></a>01315 <span class="keyword"></span>{
-<a name="l01316"></a>01316         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (<a class="code" href="classbdm_1_1epdf.html#ac4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(), <span class="stringliteral">&quot;rv description is not assigned&quot;</span>);
-<a name="l01317"></a>01317         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);
-<a name="l01318"></a>01318 
-<a name="l01319"></a>01319         sq_T Rn (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>, irvn);  <span class="comment">// select rows and columns of R</span>
+<a name="l01287"></a>01287 <span class="comment">// vec mlnorm&lt;sq_T&gt;::samplecond (const  vec &amp;cond, double &amp;lik ) {</span>
+<a name="l01288"></a>01288 <span class="comment">//      this-&gt;condition ( cond );</span>
+<a name="l01289"></a>01289 <span class="comment">//      vec smp = epdf.sample();</span>
+<a name="l01290"></a>01290 <span class="comment">//      lik = epdf.eval ( smp );</span>
+<a name="l01291"></a>01291 <span class="comment">//      return smp;</span>
+<a name="l01292"></a>01292 <span class="comment">// }</span>
+<a name="l01293"></a>01293 
+<a name="l01294"></a>01294 <span class="comment">// template&lt;class sq_T&gt;</span>
+<a name="l01295"></a>01295 <span class="comment">// mat mlnorm&lt;sq_T&gt;::samplecond (const vec &amp;cond, vec &amp;lik, int n ) {</span>
+<a name="l01296"></a>01296 <span class="comment">//      int i;</span>
+<a name="l01297"></a>01297 <span class="comment">//      int dim = rv.count();</span>
+<a name="l01298"></a>01298 <span class="comment">//      mat Smp ( dim,n );</span>
+<a name="l01299"></a>01299 <span class="comment">//      vec smp ( dim );</span>
+<a name="l01300"></a>01300 <span class="comment">//      this-&gt;condition ( cond );</span>
+<a name="l01301"></a>01301 <span class="comment">//</span>
+<a name="l01302"></a>01302 <span class="comment">//      for ( i=0; i&lt;n; i++ ) {</span>
+<a name="l01303"></a>01303 <span class="comment">//              smp = epdf.sample();</span>
+<a name="l01304"></a>01304 <span class="comment">//              lik ( i ) = epdf.eval ( smp );</span>
+<a name="l01305"></a>01305 <span class="comment">//              Smp.set_col ( i ,smp );</span>
+<a name="l01306"></a>01306 <span class="comment">//      }</span>
+<a name="l01307"></a>01307 <span class="comment">//</span>
+<a name="l01308"></a>01308 <span class="comment">//      return Smp;</span>
+<a name="l01309"></a>01309 <span class="comment">// }</span>
+<a name="l01310"></a>01310 
+<a name="l01311"></a>01311 
+<a name="l01312"></a>01312 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01313"></a><a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08">01313</a> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;epdf&gt;</a> <a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">enorm&lt;sq_T&gt;::marginal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span>
+<a name="l01314"></a>01314 <span class="keyword"></span>{
+<a name="l01315"></a>01315         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> *tmp = <span class="keyword">new</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> ();
+<a name="l01316"></a>01316         <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;epdf&gt;</a> narrow(tmp);
+<a name="l01317"></a>01317         <a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">marginal</a> ( rvn, *tmp );
+<a name="l01318"></a>01318         <span class="keywordflow">return</span> narrow;
+<a name="l01319"></a>01319 }
 <a name="l01320"></a>01320 
-<a name="l01321"></a>01321         target.<a class="code" href="classbdm_1_1epdf.html#af423e28448dbb69ef4905295ec8de8ff" title="Name its rv.">set_rv</a> ( rvn );
-<a name="l01322"></a>01322         target.set_parameters (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> (irvn), Rn);
-<a name="l01323"></a>01323 }
-<a name="l01324"></a>01324 
-<a name="l01325"></a>01325 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01326"></a><a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20">01326</a> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> <a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">enorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span>
-<a name="l01327"></a>01327 <span class="keyword"></span>{
-<a name="l01328"></a>01328         <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm&lt;sq_T&gt;</a> *tmp = <span class="keyword">new</span> <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm&lt;sq_T&gt;</a> ();
-<a name="l01329"></a>01329         <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> narrow(tmp);
-<a name="l01330"></a>01330         <a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">condition</a> ( rvn, *tmp );
-<a name="l01331"></a>01331         <span class="keywordflow">return</span> narrow;
-<a name="l01332"></a>01332 }
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01335"></a>01335 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">enorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn, <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling , where  is random variable, rv, and...">mpdf</a> &amp;target )<span class="keyword"> const</span>
-<a name="l01336"></a>01336 <span class="keyword"></span>{
-<a name="l01337"></a>01337         <span class="keyword">typedef</span> <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm&lt;sq_T&gt;</a> TMlnorm;
-<a name="l01338"></a>01338 
-<a name="l01339"></a>01339         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (<a class="code" href="classbdm_1_1epdf.html#ac4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(), <span class="stringliteral">&quot;rvs are not assigned&quot;</span>);
-<a name="l01340"></a>01340         TMlnorm &amp;uptarget = <span class="keyword">dynamic_cast&lt;</span>TMlnorm &amp;<span class="keyword">&gt;</span>(target);
+<a name="l01321"></a>01321 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01322"></a>01322 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#adcb739443669ba0a8faf634196284c08" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">enorm&lt;sq_T&gt;::marginal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn, <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> &amp;target )<span class="keyword"> const</span>
+<a name="l01323"></a>01323 <span class="keyword"></span>{
+<a name="l01324"></a>01324         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (<a class="code" href="classbdm_1_1epdf.html#ac4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(), <span class="stringliteral">&quot;rv description is not assigned&quot;</span>);
+<a name="l01325"></a>01325         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);
+<a name="l01326"></a>01326 
+<a name="l01327"></a>01327         sq_T Rn (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>, irvn);  <span class="comment">// select rows and columns of R</span>
+<a name="l01328"></a>01328 
+<a name="l01329"></a>01329         target.<a class="code" href="classbdm_1_1epdf.html#af423e28448dbb69ef4905295ec8de8ff" title="Name its rv.">set_rv</a> ( rvn );
+<a name="l01330"></a>01330         target.set_parameters (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> (irvn), Rn);
+<a name="l01331"></a>01331 }
+<a name="l01332"></a>01332 
+<a name="l01333"></a>01333 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01334"></a><a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20">01334</a> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> <a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">enorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span>
+<a name="l01335"></a>01335 <span class="keyword"></span>{
+<a name="l01336"></a>01336         <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm&lt;sq_T&gt;</a> *tmp = <span class="keyword">new</span> <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm&lt;sq_T&gt;</a> ();
+<a name="l01337"></a>01337         <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> narrow(tmp);
+<a name="l01338"></a>01338         <a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">condition</a> ( rvn, *tmp );
+<a name="l01339"></a>01339         <span class="keywordflow">return</span> narrow;
+<a name="l01340"></a>01340 }
 <a name="l01341"></a>01341 
-<a name="l01342"></a>01342         <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvc = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#aaec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> (rvn);
-<a name="l01343"></a>01343         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( (rvc.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() + rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() == <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>()), <span class="stringliteral">&quot;wrong rvn&quot;</span>);
-<a name="l01344"></a>01344         <span class="comment">//Permutation vector of the new R</span>
-<a name="l01345"></a>01345         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);
-<a name="l01346"></a>01346         ivec irvc = rvc.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);
-<a name="l01347"></a>01347         ivec perm = concat (irvn , irvc);
-<a name="l01348"></a>01348         sq_T Rn (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>, perm);
+<a name="l01342"></a>01342 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01343"></a>01343 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a40201ca12c6900f7aeb493bb7c582e20" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">enorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn, <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling , where  is random variable, rv, and...">mpdf</a> &amp;target )<span class="keyword"> const</span>
+<a name="l01344"></a>01344 <span class="keyword"></span>{
+<a name="l01345"></a>01345         <span class="keyword">typedef</span> <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm&lt;sq_T&gt;</a> TMlnorm;
+<a name="l01346"></a>01346 
+<a name="l01347"></a>01347         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (<a class="code" href="classbdm_1_1epdf.html#ac4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(), <span class="stringliteral">&quot;rvs are not assigned&quot;</span>);
+<a name="l01348"></a>01348         TMlnorm &amp;uptarget = <span class="keyword">dynamic_cast&lt;</span>TMlnorm &amp;<span class="keyword">&gt;</span>(target);
 <a name="l01349"></a>01349 
-<a name="l01350"></a>01350         <span class="comment">//fixme - could this be done in general for all sq_T?</span>
-<a name="l01351"></a>01351         mat S = Rn.to_mat();
-<a name="l01352"></a>01352         <span class="comment">//fixme</span>
-<a name="l01353"></a>01353         <span class="keywordtype">int</span> n = rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() - 1;
-<a name="l01354"></a>01354         <span class="keywordtype">int</span> end = <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.rows() - 1;
-<a name="l01355"></a>01355         mat S11 = S.get (0, n, 0, n);
-<a name="l01356"></a>01356         mat S12 = S.get (0, n , rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end);
-<a name="l01357"></a>01357         mat S22 = S.get (rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end, rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end);
-<a name="l01358"></a>01358 
-<a name="l01359"></a>01359         vec mu1 = <a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> (irvn);
-<a name="l01360"></a>01360         vec mu2 = <a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> (irvc);
-<a name="l01361"></a>01361         mat A = S12 * inv (S22);
-<a name="l01362"></a>01362         sq_T R_n (S11 - A *S12.T());
-<a name="l01363"></a>01363 
-<a name="l01364"></a>01364         uptarget.set_rv (rvn);
-<a name="l01365"></a>01365         uptarget.set_rvc (rvc);
-<a name="l01366"></a>01366         uptarget.set_parameters (A, mu1 - A*mu2, R_n);
-<a name="l01367"></a>01367 }
-<a name="l01368"></a>01368 
-<a name="l01371"></a>01371 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01372"></a><a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339">01372</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339" title="set mean function">mgnorm&lt;sq_T &gt;::set_parameters</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> &amp;g0, <span class="keyword">const</span> sq_T &amp;R0) {
-<a name="l01373"></a>01373         g = g0;
-<a name="l01374"></a>01374         this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (zeros (g-&gt;dimension()), R0);
+<a name="l01350"></a>01350         <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvc = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#aaec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> (rvn);
+<a name="l01351"></a>01351         <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( (rvc.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() + rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() == <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>()), <span class="stringliteral">&quot;wrong rvn&quot;</span>);
+<a name="l01352"></a>01352         <span class="comment">//Permutation vector of the new R</span>
+<a name="l01353"></a>01353         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);
+<a name="l01354"></a>01354         ivec irvc = rvc.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);
+<a name="l01355"></a>01355         ivec perm = concat (irvn , irvc);
+<a name="l01356"></a>01356         sq_T Rn (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>, perm);
+<a name="l01357"></a>01357 
+<a name="l01358"></a>01358         <span class="comment">//fixme - could this be done in general for all sq_T?</span>
+<a name="l01359"></a>01359         mat S = Rn.to_mat();
+<a name="l01360"></a>01360         <span class="comment">//fixme</span>
+<a name="l01361"></a>01361         <span class="keywordtype">int</span> n = rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() - 1;
+<a name="l01362"></a>01362         <span class="keywordtype">int</span> end = <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.rows() - 1;
+<a name="l01363"></a>01363         mat S11 = S.get (0, n, 0, n);
+<a name="l01364"></a>01364         mat S12 = S.get (0, n , rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end);
+<a name="l01365"></a>01365         mat S22 = S.get (rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end, rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end);
+<a name="l01366"></a>01366 
+<a name="l01367"></a>01367         vec mu1 = <a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> (irvn);
+<a name="l01368"></a>01368         vec mu2 = <a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> (irvc);
+<a name="l01369"></a>01369         mat A = S12 * inv (S22);
+<a name="l01370"></a>01370         sq_T R_n (S11 - A *S12.T());
+<a name="l01371"></a>01371 
+<a name="l01372"></a>01372         uptarget.set_rv (rvn);
+<a name="l01373"></a>01373         uptarget.set_rvc (rvc);
+<a name="l01374"></a>01374         uptarget.set_parameters (A, mu1 - A*mu2, R_n);
 <a name="l01375"></a>01375 }
 <a name="l01376"></a>01376 
-<a name="l01377"></a>01377 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01378"></a><a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d">01378</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">mgnorm&lt;sq_T &gt;::condition</a> (<span class="keyword">const</span> vec &amp;cond) {this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = g-&gt;eval (cond);};
-<a name="l01379"></a>01379 
-<a name="l01381"></a>01381 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l01382"></a>01382 std::ostream &amp;operator&lt;&lt; (std::ostream &amp;os,  mlnorm&lt;sq_T&gt; &amp;ml)
-<a name="l01383"></a>01383 {
-<a name="l01384"></a>01384         os &lt;&lt; <span class="stringliteral">&quot;A:&quot;</span> &lt;&lt; ml.A &lt;&lt; endl;
-<a name="l01385"></a>01385         os &lt;&lt; <span class="stringliteral">&quot;mu:&quot;</span> &lt;&lt; ml.mu_const &lt;&lt; endl;
-<a name="l01386"></a>01386         os &lt;&lt; <span class="stringliteral">&quot;R:&quot;</span> &lt;&lt; ml._R() &lt;&lt; endl;
-<a name="l01387"></a>01387         <span class="keywordflow">return</span> os;
-<a name="l01388"></a>01388 };
-<a name="l01389"></a>01389 
-<a name="l01390"></a>01390 }
-<a name="l01391"></a>01391 <span class="preprocessor">#endif //EF_H</span>
+<a name="l01379"></a>01379 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01380"></a><a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339">01380</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339" title="set mean function">mgnorm&lt;sq_T &gt;::set_parameters</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;fnc&gt;</a> &amp;g0, <span class="keyword">const</span> sq_T &amp;R0) {
+<a name="l01381"></a>01381         g = g0;
+<a name="l01382"></a>01382         this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.set_parameters (zeros (g-&gt;dimension()), R0);
+<a name="l01383"></a>01383 }
+<a name="l01384"></a>01384 
+<a name="l01385"></a>01385 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01386"></a><a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d">01386</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">mgnorm&lt;sq_T &gt;::condition</a> (<span class="keyword">const</span> vec &amp;cond) {this-&gt;<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = g-&gt;eval (cond);};
+<a name="l01387"></a>01387 
+<a name="l01389"></a>01389 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l01390"></a>01390 std::ostream &amp;operator&lt;&lt; (std::ostream &amp;os,  mlnorm&lt;sq_T&gt; &amp;ml)
+<a name="l01391"></a>01391 {
+<a name="l01392"></a>01392         os &lt;&lt; <span class="stringliteral">&quot;A:&quot;</span> &lt;&lt; ml.A &lt;&lt; endl;
+<a name="l01393"></a>01393         os &lt;&lt; <span class="stringliteral">&quot;mu:&quot;</span> &lt;&lt; ml.mu_const &lt;&lt; endl;
+<a name="l01394"></a>01394         os &lt;&lt; <span class="stringliteral">&quot;R:&quot;</span> &lt;&lt; ml._R() &lt;&lt; endl;
+<a name="l01395"></a>01395         <span class="keywordflow">return</span> os;
+<a name="l01396"></a>01396 };
+<a name="l01397"></a>01397 
+<a name="l01398"></a>01398 }
+<a name="l01399"></a>01399 <span class="preprocessor">#endif //EF_H</span>
 </pre></div></div>
-<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Sep 8 22:11:32 2009 for mixpp by&nbsp;
+<hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 13 22:40:39 2009 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
