Index: doc/html/libEF_8h-source.html
===================================================================
--- doc/html/libEF_8h-source.html (revision 280)
+++ doc/html/libEF_8h-source.html (revision 287)
@@ -109,5 +109,5 @@
 <a name="l00094"></a>00094 <span class="comment">//      virtual void flatten ( double nu0 ) {it_error ( "Not implemented" );}</span>
 <a name="l00095"></a>00095 
-<a name="l00096"></a><a class="code" href="classbdm_1_1BMEF.html#5912dbcf28ae711e30b08c2fa766a3e6">00096</a>         <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* <a class="code" href="classbdm_1_1BM.html#c0f027ff91d8459937c6f60ff8e553ff">_copy_</a> ( <span class="keywordtype">bool</span> changerv=<span class="keyword">false</span> ) {it_error ( <span class="stringliteral">"function _copy_ not implemented for this BM"</span> ); <span class="keywordflow">return</span> NULL;};
+<a name="l00096"></a><a class="code" href="classbdm_1_1BMEF.html#80b43a62e180377648ebd0cbfabfbbeb">00096</a>         <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* <a class="code" href="classbdm_1_1BM.html#40f01563651c1e4fe926189e41a6b8ab">_copy_</a> ( <span class="keywordtype">bool</span> changerv=<span class="keyword">false</span> )<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"function _copy_ not implemented for this BM"</span> ); <span class="keywordflow">return</span> NULL;};
 <a name="l00097"></a>00097 };
 <a name="l00098"></a>00098 
@@ -122,5 +122,5 @@
 <a name="l00114"></a>00114 <span class="keyword">public</span>:
 <a name="l00117"></a>00117 
-<a name="l00118"></a>00118         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a> ( ):<a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ), <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( ),<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a> ( ) {};
+<a name="l00118"></a>00118         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a> ( ) :<a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ), <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( ),<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a> ( ) {};
 <a name="l00119"></a>00119         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a> ( <span class="keyword">const</span> vec &amp;<a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>,<span class="keyword">const</span> sq_T &amp;<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a> ) {set_parameters ( mu,R );}
 <a name="l00120"></a>00120         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;<a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>,<span class="keyword">const</span> sq_T &amp;<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a> );
@@ -269,5 +269,5 @@
 <a name="l00321"></a><a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1">00321</a>         vec <a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1" title="Vector .">beta</a>;
 <a name="l00322"></a>00322 <span class="keyword">public</span> :
-<a name="l00325"></a>00325         <a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> ( ) :<a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ), <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>(), <a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1" title="Vector .">beta</a>() {};
+<a name="l00325"></a>00325         <a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> ( ) :<a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ), <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>(0), <a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1" title="Vector .">beta</a>(0) {};
 <a name="l00326"></a>00326         <a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> ( <span class="keyword">const</span> vec &amp;a, <span class="keyword">const</span> vec &amp;b ) {set_parameters ( a, b );};
 <a name="l00327"></a>00327         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;a, <span class="keyword">const</span> vec &amp;b ) {<a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>=a,<a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1" title="Vector .">beta</a>=b;<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>.length();};
@@ -283,398 +283,446 @@
 <a name="l00340"></a>00340 };
 <a name="l00341"></a>00341 
-<a name="l00356"></a><a class="code" href="classbdm_1_1eigamma.html">00356</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> {
-<a name="l00357"></a>00357 <span class="keyword">protected</span>:
-<a name="l00359"></a><a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96">00359</a>         <a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>;
-<a name="l00361"></a><a class="code" href="classbdm_1_1eigamma.html#494fafd76d9448395efe160c9ba11ab6">00361</a>         vec &amp;<a class="code" href="classbdm_1_1eigamma.html#494fafd76d9448395efe160c9ba11ab6" title="Vector .">alpha</a>;
-<a name="l00363"></a><a class="code" href="classbdm_1_1eigamma.html#e32ff12ba6b2fdc22068c35dace23fa6">00363</a>         vec &amp;<a class="code" href="classbdm_1_1eigamma.html#e32ff12ba6b2fdc22068c35dace23fa6" title="Vector  (in fact it is 1/beta as used in definition of iG).">beta</a>;
-<a name="l00364"></a>00364 <span class="keyword">public</span> :
-<a name="l00367"></a>00367         <a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a> ( ) :<a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ), <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>(),<a class="code" href="classbdm_1_1eigamma.html#494fafd76d9448395efe160c9ba11ab6" title="Vector .">alpha</a> ( <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>._alpha() ), <a class="code" href="classbdm_1_1eigamma.html#e32ff12ba6b2fdc22068c35dace23fa6" title="Vector  (in fact it is 1/beta as used in definition of iG).">beta</a> ( <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>._beta() ) {};
-<a name="l00368"></a>00368         <a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a> ( <span class="keyword">const</span> vec &amp;a, <span class="keyword">const</span> vec &amp;b ):<a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ), <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>(),<a class="code" href="classbdm_1_1eigamma.html#494fafd76d9448395efe160c9ba11ab6" title="Vector .">alpha</a> ( <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>._alpha() ), <a class="code" href="classbdm_1_1eigamma.html#e32ff12ba6b2fdc22068c35dace23fa6" title="Vector  (in fact it is 1/beta as used in definition of iG).">beta</a> ( <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>._beta() ) {<a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>.<a class="code" href="classbdm_1_1egamma.html#749f82293ff23a8319c1bf52489d2ed2">set_parameters</a> ( a,b );};
-<a name="l00369"></a>00369         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;a, <span class="keyword">const</span> vec &amp;b ) {<a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>.set_parameters ( a,b );};
-<a name="l00371"></a>00371 
-<a name="l00372"></a><a class="code" href="classbdm_1_1eigamma.html#3aff7bf25ddac27731c60826fcfd878f">00372</a>         vec <a class="code" href="classbdm_1_1eigamma.html#3aff7bf25ddac27731c60826fcfd878f" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 1.0/<a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>.<a class="code" href="classbdm_1_1egamma.html#6ed82f0fd05f6002487256d8e75a0bbd" title="Returns a sample,  from density .">sample</a>();};
-<a name="l00374"></a>00374 <span class="comment">//      mat sample ( int N ) const;</span>
-<a name="l00375"></a><a class="code" href="classbdm_1_1eigamma.html#9e26c80c8e6708bfcf2e684958af6f91">00375</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eigamma.html#9e26c80c8e6708bfcf2e684958af6f91" title="TODO: is it used anywhere?">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>.<a class="code" href="classbdm_1_1egamma.html#a8e11e5a580ff42a1b205974c60768c6" title="TODO: is it used anywhere?">evallog</a> ( val );};
-<a name="l00376"></a><a class="code" href="classbdm_1_1eigamma.html#a52ac6d523e2fe05642d1f50fe66aec2">00376</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eigamma.html#a52ac6d523e2fe05642d1f50fe66aec2" title="logarithm of the normalizing constant, ">lognc</a> ()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eigamma.html#3e5c03201f073033a7db894fa15ddb96" title="internal egamma">eg</a>.<a class="code" href="classbdm_1_1egamma.html#9a66cbd100e8520c769ccb3c451f86f8" title="logarithm of the normalizing constant, ">lognc</a>();};
-<a name="l00378"></a><a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb">00378</a>         vec <a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb" title="Returns poiter to alpha and beta. Potentially dangerous: use with care!">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> elem_div ( <a class="code" href="classbdm_1_1eigamma.html#e32ff12ba6b2fdc22068c35dace23fa6" title="Vector  (in fact it is 1/beta as used in definition of iG).">beta</a>,<a class="code" href="classbdm_1_1eigamma.html#494fafd76d9448395efe160c9ba11ab6" title="Vector .">alpha</a>-1 );}
-<a name="l00379"></a><a class="code" href="classbdm_1_1eigamma.html#c2c696f8c668e9f65392c9449f6a5133">00379</a>         vec <a class="code" href="classbdm_1_1eigamma.html#c2c696f8c668e9f65392c9449f6a5133" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{vec mea=<a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb" title="Returns poiter to alpha and beta. Potentially dangerous: use with care!">mean</a>(); <span class="keywordflow">return</span> elem_div ( elem_mult ( mea,mea ),<a class="code" href="classbdm_1_1eigamma.html#494fafd76d9448395efe160c9ba11ab6" title="Vector .">alpha</a>-2 );}
-<a name="l00380"></a>00380         vec&amp; _alpha() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eigamma.html#494fafd76d9448395efe160c9ba11ab6" title="Vector .">alpha</a>;}
-<a name="l00381"></a>00381         vec&amp; _beta() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eigamma.html#e32ff12ba6b2fdc22068c35dace23fa6" title="Vector  (in fact it is 1/beta as used in definition of iG).">beta</a>;}
-<a name="l00382"></a>00382 };
-<a name="l00383"></a>00383 <span class="comment">/*</span>
-<a name="l00385"></a>00385 <span class="comment">class emix : public epdf {</span>
-<a name="l00386"></a>00386 <span class="comment">protected:</span>
-<a name="l00387"></a>00387 <span class="comment">        int n;</span>
-<a name="l00388"></a>00388 <span class="comment">        vec &amp;w;</span>
-<a name="l00389"></a>00389 <span class="comment">        Array&lt;epdf*&gt; Coms;</span>
-<a name="l00390"></a>00390 <span class="comment">public:</span>
-<a name="l00392"></a>00392 <span class="comment">        emix ( const RV &amp;rv, vec &amp;w0): epdf(rv), n(w0.length()), w(w0), Coms(n) {};</span>
-<a name="l00393"></a>00393 <span class="comment">        void set_parameters( int &amp;i, double wi, epdf* ep){w(i)=wi;Coms(i)=ep;}</span>
-<a name="l00394"></a>00394 <span class="comment">        vec mean(){vec pom; for(int i=0;i&lt;n;i++){pom+=Coms(i)-&gt;mean()*w(i);} return pom;};</span>
-<a name="l00395"></a>00395 <span class="comment">        vec sample() {it_error ( "Not implemented" );return 0;}</span>
-<a name="l00396"></a>00396 <span class="comment">};</span>
-<a name="l00397"></a>00397 <span class="comment">*/</span>
-<a name="l00398"></a>00398 
-<a name="l00400"></a>00400 
-<a name="l00401"></a><a class="code" href="classbdm_1_1euni.html">00401</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1euni.html" title="Uniform distributed density on a rectangular support.">euni</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="l00402"></a>00402 <span class="keyword">protected</span>:
-<a name="l00404"></a><a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32">00404</a>         vec <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>;
-<a name="l00406"></a><a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1">00406</a>         vec <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>;
-<a name="l00408"></a><a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c">00408</a>         vec <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>;
-<a name="l00410"></a><a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20">00410</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>;
-<a name="l00412"></a><a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476">00412</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>;
-<a name="l00413"></a>00413 <span class="keyword">public</span>:
-<a name="l00416"></a>00416         <a class="code" href="classbdm_1_1euni.html" title="Uniform distributed density on a rectangular support.">euni</a> ( ) :<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( ) {}
-<a name="l00417"></a>00417         <a class="code" href="classbdm_1_1euni.html" title="Uniform distributed density on a rectangular support.">euni</a> ( <span class="keyword">const</span> vec &amp;low0, <span class="keyword">const</span> vec &amp;high0 ) {set_parameters ( low0,high0 );}
-<a name="l00418"></a>00418         <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="l00419"></a>00419                 <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> = high0-low0;
-<a name="l00420"></a>00420                 it_assert_debug ( min ( <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> ) &gt;0.0,<span class="stringliteral">"bad support"</span> );
-<a name="l00421"></a>00421                 <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> = low0;
-<a name="l00422"></a>00422                 <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> = high0;
-<a name="l00423"></a>00423                 <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a> = prod ( 1.0/<a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> );
-<a name="l00424"></a>00424                 <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a> = log ( <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a> );
-<a name="l00425"></a>00425                 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>.length();
-<a name="l00426"></a>00426         }
-<a name="l00428"></a>00428 
-<a name="l00429"></a>00429         <span class="keywordtype">double</span> eval ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const  </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>;}
-<a name="l00430"></a><a class="code" href="classbdm_1_1euni.html#caa07b8307bd793d5339d6583e0aba81">00430</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#caa07b8307bd793d5339d6583e0aba81" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const  </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>;}
-<a name="l00431"></a><a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194">00431</a>         vec <a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{
-<a name="l00432"></a>00432                 vec smp ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
-<a name="l00433"></a>00433 <span class="preprocessor">#pragma omp critical</span>
-<a name="l00434"></a>00434 <span class="preprocessor"></span>                UniRNG.sample_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ,smp );
-<a name="l00435"></a>00435                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>+elem_mult ( <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>,smp );
-<a name="l00436"></a>00436         }
-<a name="l00438"></a><a class="code" href="classbdm_1_1euni.html#46caa8c13aba2e6228f964208918b226">00438</a>         vec <a class="code" href="classbdm_1_1euni.html#46caa8c13aba2e6228f964208918b226" 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#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>-<a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> ) /2.0;}
-<a name="l00439"></a><a class="code" href="classbdm_1_1euni.html#951f932155111f6053c980f672b4c22c">00439</a>         vec <a class="code" href="classbdm_1_1euni.html#951f932155111f6053c980f672b4c22c" 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#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>,2 ) +pow ( <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>,2 ) +elem_mult ( <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>,<a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> ) ) /3.0;}
-<a name="l00440"></a>00440 };
-<a name="l00441"></a>00441 
-<a name="l00442"></a>00442 
-<a name="l00448"></a>00448 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00449"></a><a class="code" href="classbdm_1_1mlnorm.html">00449</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_1mEF.html" title="Exponential family model.">mEF</a> {
-<a name="l00450"></a>00450 <span class="keyword">protected</span>:
-<a name="l00452"></a><a class="code" href="classbdm_1_1mlnorm.html#150ad6acb223b0a0abeaf92346686dcd">00452</a>         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;
-<a name="l00453"></a>00453         mat A;
-<a name="l00454"></a>00454         vec mu_const;
-<a name="l00455"></a>00455         vec&amp; _mu; <span class="comment">//cached epdf.mu;</span>
-<a name="l00456"></a>00456 <span class="keyword">public</span>:
-<a name="l00459"></a>00459         <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_1mEF.html" title="Exponential family model.">mEF</a> (),<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( ),A ( ),_mu ( <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._mu() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a> =&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>; };
-<a name="l00460"></a>00460         <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, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R ) :<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( ),_mu ( <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._mu() ) {
-<a name="l00461"></a>00461                 <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a> =&amp;<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_1mlnorm.html#5d18dec3167584338a4775c1d165d96f" title="Set A and R.">set_parameters</a> ( A,mu0,R );
-<a name="l00462"></a>00462         };
-<a name="l00464"></a>00464         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f" title="Set A and R.">set_parameters</a> ( <span class="keyword">const</span>  mat &amp;A, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R );
-<a name="l00467"></a>00467         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">condition</a> ( <span class="keyword">const</span> vec &amp;cond );
-<a name="l00468"></a>00468 
-<a name="l00470"></a><a class="code" href="classbdm_1_1mlnorm.html#56e587952f94fcac6cfc999eae6dbced">00470</a>         vec&amp; <a class="code" href="classbdm_1_1mlnorm.html#56e587952f94fcac6cfc999eae6dbced" title="access function">_mu_const</a>() {<span class="keywordflow">return</span> mu_const;}
-<a name="l00472"></a><a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614">00472</a>         mat&amp; <a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614" title="access function">_A</a>() {<span class="keywordflow">return</span> A;}
-<a name="l00474"></a><a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604">00474</a>         mat <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._R().to_mat();}
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_M&gt;
-<a name="l00477"></a>00477         <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_M&gt; &amp;ml );
-<a name="l00478"></a>00478 };
-<a name="l00479"></a>00479 
-<a name="l00487"></a><a class="code" href="classbdm_1_1mlstudent.html">00487</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&gt; {
-<a name="l00488"></a>00488 <span class="keyword">protected</span>:
-<a name="l00489"></a>00489         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Lambda;
-<a name="l00490"></a>00490         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;<a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a>;
-<a name="l00491"></a>00491         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Re;
-<a name="l00492"></a>00492 <span class="keyword">public</span>:
-<a name="l00493"></a>00493         <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&lt;ldmat&gt;</a> (),
-<a name="l00494"></a>00494                         Lambda (),      <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a> ( <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._R() ) {}
-<a name="l00495"></a>00495         <span class="keywordtype">void</span> set_parameters ( <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="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;R0, <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&amp; Lambda0 ) {
-<a name="l00496"></a>00496                 it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> );
-<a name="l00497"></a>00497                 it_assert_debug ( R0.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ==A0.rows(),<span class="stringliteral">""</span> );
-<a name="l00498"></a>00498 
-<a name="l00499"></a>00499                 <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.set_parameters ( mu0,Lambda ); <span class="comment">//</span>
-<a name="l00500"></a>00500                 A = A0;
-<a name="l00501"></a>00501                 mu_const = mu0;
-<a name="l00502"></a>00502                 Re=R0;
-<a name="l00503"></a>00503                 Lambda = Lambda0;
-<a name="l00504"></a>00504         }
-<a name="l00505"></a><a class="code" href="classbdm_1_1mlstudent.html#efd37560585c8613897f30d3c2f58d0d">00505</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#efd37560585c8613897f30d3c2f58d0d">condition</a> ( <span class="keyword">const</span> vec &amp;cond ) {
-<a name="l00506"></a>00506                 _mu = A*cond + mu_const;
-<a name="l00507"></a>00507                 <span class="keywordtype">double</span> zeta;
-<a name="l00508"></a>00508                 <span class="comment">//ugly hack!</span>
-<a name="l00509"></a>00509                 <span class="keywordflow">if</span> ( ( cond.length() +1 ) ==Lambda.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ) {
-<a name="l00510"></a>00510                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( concat ( cond, vec_1 ( 1.0 ) ) );
-<a name="l00511"></a>00511                 }
-<a name="l00512"></a>00512                 <span class="keywordflow">else</span> {
-<a name="l00513"></a>00513                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( cond );
-<a name="l00514"></a>00514                 }
-<a name="l00515"></a>00515                 <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a> = Re;
-<a name="l00516"></a>00516                 <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a>*= ( 1+zeta );<span class="comment">// / ( nu ); &lt;&lt; nu is in Re!!!!!!</span>
-<a name="l00517"></a>00517         };
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519 };
-<a name="l00529"></a><a class="code" href="classbdm_1_1mgamma.html">00529</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_1mEF.html" title="Exponential family model.">mEF</a> {
-<a name="l00530"></a>00530 <span class="keyword">protected</span>:
-<a name="l00532"></a><a class="code" href="classbdm_1_1mgamma.html#bdc9f1e9e03c09e91103fee269864438">00532</a>         <a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;
-<a name="l00534"></a><a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09">00534</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>;
-<a name="l00536"></a><a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312">00536</a>         vec &amp;<a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>;
-<a name="l00537"></a>00537 
-<a name="l00538"></a>00538 <span class="keyword">public</span>:
-<a name="l00540"></a><a class="code" href="classbdm_1_1mgamma.html#1a9dc8661e5b214a8185d6e6b9956eb1">00540</a>         <a class="code" href="classbdm_1_1mgamma.html#1a9dc8661e5b214a8185d6e6b9956eb1" title="Constructor.">mgamma</a> ( ) : <a class="code" href="classbdm_1_1mEF.html" title="Exponential family model.">mEF</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_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</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_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;};
-<a name="l00542"></a>00542         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#a0f21c2557b233a85838b497d040ab14" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, <span class="keyword">const</span> vec &amp;beta0 );
-<a name="l00543"></a><a class="code" href="classbdm_1_1mgamma.html#8996500f1885e39cde30221b20900bff">00543</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#8996500f1885e39cde30221b20900bff" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {<a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>=<a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>/val;};
-<a name="l00544"></a>00544 };
-<a name="l00545"></a>00545 
-<a name="l00555"></a><a class="code" href="classbdm_1_1migamma.html">00555</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_1mEF.html" title="Exponential family model.">mEF</a> {
-<a name="l00556"></a>00556 <span class="keyword">protected</span>:
-<a name="l00558"></a><a class="code" href="classbdm_1_1migamma.html#a31b39d4179551b593c9e0d7d756783a">00558</a>         <a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;
-<a name="l00560"></a><a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c">00560</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>;
-<a name="l00562"></a><a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc">00562</a>         vec &amp;<a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>;
-<a name="l00564"></a><a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5">00564</a>         vec &amp;<a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>;
-<a name="l00565"></a>00565 
-<a name="l00566"></a>00566 <span class="keyword">public</span>:
-<a name="l00569"></a>00569         <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> ( ) : <a class="code" href="classbdm_1_1mEF.html" title="Exponential family model.">mEF</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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>() ), <a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</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_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;};
-<a name="l00570"></a>00570         <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_1mEF.html" title="Exponential family model.">mEF</a> (), <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( m.<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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>() ), <a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</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_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;};
-<a name="l00572"></a>00572 
-<a name="l00574"></a><a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151">00574</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">int</span> len, <span class="keywordtype">double</span> k0 ) {
-<a name="l00575"></a>00575                 <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>=k0;
-<a name="l00576"></a>00576                 <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.set_parameters ( ( 1.0/ ( <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>*<a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> ) +2.0 ) *ones ( len ) <span class="comment">/*alpha*/</span>, ones ( len ) <span class="comment">/*beta*/</span> );
-<a name="l00577"></a>00577                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
-<a name="l00578"></a>00578         };
-<a name="l00579"></a><a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c">00579</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {
-<a name="l00580"></a>00580                 <a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>=elem_mult ( val, ( <a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>-1.0 ) );
-<a name="l00581"></a>00581         };
-<a name="l00582"></a>00582 };
-<a name="l00583"></a>00583 
-<a name="l00595"></a><a class="code" href="classbdm_1_1mgamma__fix.html">00595</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="l00596"></a>00596 <span class="keyword">protected</span>:
-<a name="l00598"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa">00598</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>;
-<a name="l00600"></a><a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2">00600</a>         vec <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>;
-<a name="l00601"></a>00601 <span class="keyword">public</span>:
-<a name="l00603"></a><a class="code" href="classbdm_1_1mgamma__fix.html#9a31bc9b4b60188a18a2a6b588dc4b2d">00603</a>         <a class="code" href="classbdm_1_1mgamma__fix.html#9a31bc9b4b60188a18a2a6b588dc4b2d" 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#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a> () {};
-<a name="l00605"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2">00605</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0 ) {
-<a name="l00606"></a>00606                 <a class="code" href="classbdm_1_1mgamma.html#a0f21c2557b233a85838b497d040ab14" title="Set value of k.">mgamma::set_parameters</a> ( k0, ref0 );
-<a name="l00607"></a>00607                 <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>=pow ( ref0,1.0-l0 );<a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>=l0;
-<a name="l00608"></a>00608                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=dimension();
-<a name="l00609"></a>00609         };
-<a name="l00610"></a>00610 
-<a name="l00611"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1d539591deb7a38bb3403c2b396c8ff7">00611</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1d539591deb7a38bb3403c2b396c8ff7" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {vec mean=elem_mult ( <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>,pow ( val,<a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a> ) ); <a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>=<a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>/mean;};
-<a name="l00612"></a>00612 };
-<a name="l00613"></a>00613 
+<a name="l00358"></a><a class="code" href="classbdm_1_1eigamma.html">00358</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> {
+<a name="l00359"></a>00359 <span class="keyword">protected</span>:
+<a name="l00360"></a>00360 <span class="keyword">public</span> :
+<a name="l00365"></a>00365 
+<a name="l00366"></a><a class="code" href="classbdm_1_1eigamma.html#3aff7bf25ddac27731c60826fcfd878f">00366</a>         vec <a class="code" href="classbdm_1_1eigamma.html#3aff7bf25ddac27731c60826fcfd878f" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 1.0/<a class="code" href="classbdm_1_1egamma.html#6ed82f0fd05f6002487256d8e75a0bbd" title="Returns a sample,  from density .">egamma::sample</a>();};
+<a name="l00368"></a><a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb">00368</a>         vec <a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb" title="Returns poiter to alpha and beta. Potentially dangerous: use with care!">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> elem_div ( <a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1" title="Vector .">beta</a>,<a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>-1 );}
+<a name="l00369"></a><a class="code" href="classbdm_1_1eigamma.html#c2c696f8c668e9f65392c9449f6a5133">00369</a>         vec <a class="code" href="classbdm_1_1eigamma.html#c2c696f8c668e9f65392c9449f6a5133" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{vec mea=<a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb" title="Returns poiter to alpha and beta. Potentially dangerous: use with care!">mean</a>(); <span class="keywordflow">return</span> elem_div ( elem_mult ( mea,mea ),<a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>-2 );}
+<a name="l00370"></a>00370 };
+<a name="l00371"></a>00371 <span class="comment">/*</span>
+<a name="l00373"></a>00373 <span class="comment">class emix : public epdf {</span>
+<a name="l00374"></a>00374 <span class="comment">protected:</span>
+<a name="l00375"></a>00375 <span class="comment">        int n;</span>
+<a name="l00376"></a>00376 <span class="comment">        vec &amp;w;</span>
+<a name="l00377"></a>00377 <span class="comment">        Array&lt;epdf*&gt; Coms;</span>
+<a name="l00378"></a>00378 <span class="comment">public:</span>
+<a name="l00380"></a>00380 <span class="comment">        emix ( const RV &amp;rv, vec &amp;w0): epdf(rv), n(w0.length()), w(w0), Coms(n) {};</span>
+<a name="l00381"></a>00381 <span class="comment">        void set_parameters( int &amp;i, double wi, epdf* ep){w(i)=wi;Coms(i)=ep;}</span>
+<a name="l00382"></a>00382 <span class="comment">        vec mean(){vec pom; for(int i=0;i&lt;n;i++){pom+=Coms(i)-&gt;mean()*w(i);} return pom;};</span>
+<a name="l00383"></a>00383 <span class="comment">        vec sample() {it_error ( "Not implemented" );return 0;}</span>
+<a name="l00384"></a>00384 <span class="comment">};</span>
+<a name="l00385"></a>00385 <span class="comment">*/</span>
+<a name="l00386"></a>00386 
+<a name="l00388"></a>00388 
+<a name="l00389"></a><a class="code" href="classbdm_1_1euni.html">00389</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1euni.html" title="Uniform distributed density on a rectangular support.">euni</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="l00390"></a>00390 <span class="keyword">protected</span>:
+<a name="l00392"></a><a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32">00392</a>         vec <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>;
+<a name="l00394"></a><a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1">00394</a>         vec <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>;
+<a name="l00396"></a><a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c">00396</a>         vec <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>;
+<a name="l00398"></a><a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20">00398</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>;
+<a name="l00400"></a><a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476">00400</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>;
+<a name="l00401"></a>00401 <span class="keyword">public</span>:
+<a name="l00404"></a>00404         <a class="code" href="classbdm_1_1euni.html" title="Uniform distributed density on a rectangular support.">euni</a> ( ) :<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( ) {}
+<a name="l00405"></a>00405         <a class="code" href="classbdm_1_1euni.html" title="Uniform distributed density on a rectangular support.">euni</a> ( <span class="keyword">const</span> vec &amp;low0, <span class="keyword">const</span> vec &amp;high0 ) {set_parameters ( low0,high0 );}
+<a name="l00406"></a>00406         <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="l00407"></a>00407                 <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> = high0-low0;
+<a name="l00408"></a>00408                 it_assert_debug ( min ( <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> ) &gt;0.0,<span class="stringliteral">"bad support"</span> );
+<a name="l00409"></a>00409                 <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> = low0;
+<a name="l00410"></a>00410                 <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> = high0;
+<a name="l00411"></a>00411                 <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a> = prod ( 1.0/<a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> );
+<a name="l00412"></a>00412                 <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a> = log ( <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a> );
+<a name="l00413"></a>00413                 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>.length();
+<a name="l00414"></a>00414         }
+<a name="l00416"></a>00416 
+<a name="l00417"></a>00417         <span class="keywordtype">double</span> eval ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const  </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>;}
+<a name="l00418"></a><a class="code" href="classbdm_1_1euni.html#caa07b8307bd793d5339d6583e0aba81">00418</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#caa07b8307bd793d5339d6583e0aba81" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const  </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>;}
+<a name="l00419"></a><a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194">00419</a>         vec <a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{
+<a name="l00420"></a>00420                 vec smp ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
+<a name="l00421"></a>00421 <span class="preprocessor">#pragma omp critical</span>
+<a name="l00422"></a>00422 <span class="preprocessor"></span>                UniRNG.sample_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ,smp );
+<a name="l00423"></a>00423                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>+elem_mult ( <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>,smp );
+<a name="l00424"></a>00424         }
+<a name="l00426"></a><a class="code" href="classbdm_1_1euni.html#46caa8c13aba2e6228f964208918b226">00426</a>         vec <a class="code" href="classbdm_1_1euni.html#46caa8c13aba2e6228f964208918b226" 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#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>-<a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> ) /2.0;}
+<a name="l00427"></a><a class="code" href="classbdm_1_1euni.html#951f932155111f6053c980f672b4c22c">00427</a>         vec <a class="code" href="classbdm_1_1euni.html#951f932155111f6053c980f672b4c22c" 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#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>,2 ) +pow ( <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>,2 ) +elem_mult ( <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>,<a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> ) ) /3.0;}
+<a name="l00428"></a>00428 };
+<a name="l00429"></a>00429 
+<a name="l00430"></a>00430 
+<a name="l00436"></a>00436 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00437"></a><a class="code" href="classbdm_1_1mlnorm.html">00437</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_1mEF.html" title="Exponential family model.">mEF</a> {
+<a name="l00438"></a>00438 <span class="keyword">protected</span>:
+<a name="l00440"></a><a class="code" href="classbdm_1_1mlnorm.html#150ad6acb223b0a0abeaf92346686dcd">00440</a>         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;
+<a name="l00441"></a>00441         mat A;
+<a name="l00442"></a>00442         vec mu_const;
+<a name="l00443"></a>00443         vec&amp; _mu; <span class="comment">//cached epdf.mu;</span>
+<a name="l00444"></a>00444 <span class="keyword">public</span>:
+<a name="l00447"></a>00447         <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_1mEF.html" title="Exponential family model.">mEF</a> (),<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( ),A ( ),_mu ( <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._mu() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a> =&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>; };
+<a name="l00448"></a>00448         <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, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R ) :<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( ),_mu ( <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._mu() ) {
+<a name="l00449"></a>00449                 <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a> =&amp;<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_1mlnorm.html#5d18dec3167584338a4775c1d165d96f" title="Set A and R.">set_parameters</a> ( A,mu0,R );
+<a name="l00450"></a>00450         };
+<a name="l00452"></a>00452         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f" title="Set A and R.">set_parameters</a> ( <span class="keyword">const</span>  mat &amp;A, <span class="keyword">const</span> vec &amp;mu0, <span class="keyword">const</span> sq_T &amp;R );
+<a name="l00455"></a>00455         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">condition</a> ( <span class="keyword">const</span> vec &amp;cond );
+<a name="l00456"></a>00456 
+<a name="l00458"></a><a class="code" href="classbdm_1_1mlnorm.html#56e587952f94fcac6cfc999eae6dbced">00458</a>         vec&amp; <a class="code" href="classbdm_1_1mlnorm.html#56e587952f94fcac6cfc999eae6dbced" title="access function">_mu_const</a>() {<span class="keywordflow">return</span> mu_const;}
+<a name="l00460"></a><a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614">00460</a>         mat&amp; <a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614" title="access function">_A</a>() {<span class="keywordflow">return</span> A;}
+<a name="l00462"></a><a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604">00462</a>         mat <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._R().to_mat();}
+<a name="l00463"></a>00463 
+<a name="l00464"></a>00464         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_M&gt;
+<a name="l00465"></a>00465         <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_M&gt; &amp;ml );
+<a name="l00466"></a>00466 };
+<a name="l00467"></a>00467 
+<a name="l00469"></a>00469 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00470"></a><a class="code" href="classbdm_1_1mgnorm.html">00470</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_1mEF.html" title="Exponential family model.">mEF</a> {
+<a name="l00471"></a>00471 <span class="keyword">protected</span>:
+<a name="l00473"></a><a class="code" href="classbdm_1_1mgnorm.html#8f7a376a1d2197e0634557e88e03104a">00473</a>         <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;
+<a name="l00474"></a>00474         vec &amp;mu;
+<a name="l00475"></a>00475         <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>* g;
+<a name="l00476"></a>00476 <span class="keyword">public</span>:
+<a name="l00478"></a><a class="code" href="classbdm_1_1mgnorm.html#1b014915d74470d3efab74e07cacb97d">00478</a>         <a class="code" href="classbdm_1_1mgnorm.html#1b014915d74470d3efab74e07cacb97d" title="default constructor">mgnorm</a>() :mu ( <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._mu() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;}
+<a name="l00480"></a><a class="code" href="classbdm_1_1mgnorm.html#578e02458e2a0d17f3864826b6ebd564">00480</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#578e02458e2a0d17f3864826b6ebd564" title="set mean function">set_parameters</a> ( <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>* g0, <span class="keyword">const</span> sq_T &amp;R0 ) {g=g0; <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.set_parameters ( zeros ( g-&gt;<a class="code" href="classbdm_1_1fnc.html#083832294da9d1e40804158b979c4341" title="access function">dimension</a>() ), R0 );}
+<a name="l00481"></a><a class="code" href="classbdm_1_1mgnorm.html#b31d63472cf6a1030cd8dbd8094c1f6d">00481</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#b31d63472cf6a1030cd8dbd8094c1f6d" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;cond ) {mu=g-&gt;<a class="code" href="classbdm_1_1fnc.html#6277b11d7fffc7ef8a2fa3e84ae5bad4" title="function evaluates numerical value of  at  cond ">eval</a> ( cond );};
+<a name="l00482"></a>00482 };
+<a name="l00483"></a>00483 
+<a name="l00491"></a><a class="code" href="classbdm_1_1mlstudent.html">00491</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&gt; {
+<a name="l00492"></a>00492 <span class="keyword">protected</span>:
+<a name="l00493"></a>00493         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Lambda;
+<a name="l00494"></a>00494         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;<a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a>;
+<a name="l00495"></a>00495         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Re;
+<a name="l00496"></a>00496 <span class="keyword">public</span>:
+<a name="l00497"></a>00497         <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&lt;ldmat&gt;</a> (),
+<a name="l00498"></a>00498                         Lambda (),      <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a> ( <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>._R() ) {}
+<a name="l00499"></a>00499         <span class="keywordtype">void</span> set_parameters ( <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="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &amp;R0, <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>&amp; Lambda0 ) {
+<a name="l00500"></a>00500                 it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> );
+<a name="l00501"></a>00501                 it_assert_debug ( R0.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ==A0.rows(),<span class="stringliteral">""</span> );
+<a name="l00502"></a>00502 
+<a name="l00503"></a>00503                 <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.set_parameters ( mu0,Lambda ); <span class="comment">//</span>
+<a name="l00504"></a>00504                 A = A0;
+<a name="l00505"></a>00505                 mu_const = mu0;
+<a name="l00506"></a>00506                 Re=R0;
+<a name="l00507"></a>00507                 Lambda = Lambda0;
+<a name="l00508"></a>00508         }
+<a name="l00509"></a><a class="code" href="classbdm_1_1mlstudent.html#efd37560585c8613897f30d3c2f58d0d">00509</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#efd37560585c8613897f30d3c2f58d0d">condition</a> ( <span class="keyword">const</span> vec &amp;cond ) {
+<a name="l00510"></a>00510                 _mu = A*cond + mu_const;
+<a name="l00511"></a>00511                 <span class="keywordtype">double</span> zeta;
+<a name="l00512"></a>00512                 <span class="comment">//ugly hack!</span>
+<a name="l00513"></a>00513                 <span class="keywordflow">if</span> ( ( cond.length() +1 ) ==Lambda.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ) {
+<a name="l00514"></a>00514                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( concat ( cond, vec_1 ( 1.0 ) ) );
+<a name="l00515"></a>00515                 }
+<a name="l00516"></a>00516                 <span class="keywordflow">else</span> {
+<a name="l00517"></a>00517                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( cond );
+<a name="l00518"></a>00518                 }
+<a name="l00519"></a>00519                 <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a> = Re;
+<a name="l00520"></a>00520                 <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a>*= ( 1+zeta );<span class="comment">// / ( nu ); &lt;&lt; nu is in Re!!!!!!</span>
+<a name="l00521"></a>00521         };
+<a name="l00522"></a>00522 
+<a name="l00523"></a>00523 };
+<a name="l00533"></a><a class="code" href="classbdm_1_1mgamma.html">00533</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_1mEF.html" title="Exponential family model.">mEF</a> {
+<a name="l00534"></a>00534 <span class="keyword">protected</span>:
+<a name="l00536"></a><a class="code" href="classbdm_1_1mgamma.html#bdc9f1e9e03c09e91103fee269864438">00536</a>         <a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;
+<a name="l00538"></a><a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09">00538</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>;
+<a name="l00540"></a><a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312">00540</a>         vec &amp;<a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>;
+<a name="l00541"></a>00541 
+<a name="l00542"></a>00542 <span class="keyword">public</span>:
+<a name="l00544"></a><a class="code" href="classbdm_1_1mgamma.html#1a9dc8661e5b214a8185d6e6b9956eb1">00544</a>         <a class="code" href="classbdm_1_1mgamma.html#1a9dc8661e5b214a8185d6e6b9956eb1" title="Constructor.">mgamma</a> ( ) : <a class="code" href="classbdm_1_1mEF.html" title="Exponential family model.">mEF</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_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</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_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;};
+<a name="l00546"></a>00546         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#a0f21c2557b233a85838b497d040ab14" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, <span class="keyword">const</span> vec &amp;beta0 );
+<a name="l00547"></a><a class="code" href="classbdm_1_1mgamma.html#8996500f1885e39cde30221b20900bff">00547</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#8996500f1885e39cde30221b20900bff" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {<a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>=<a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>/val;};
+<a name="l00548"></a>00548 };
+<a name="l00549"></a>00549 
+<a name="l00559"></a><a class="code" href="classbdm_1_1migamma.html">00559</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_1mEF.html" title="Exponential family model.">mEF</a> {
+<a name="l00560"></a>00560 <span class="keyword">protected</span>:
+<a name="l00562"></a><a class="code" href="classbdm_1_1migamma.html#a31b39d4179551b593c9e0d7d756783a">00562</a>         <a class="code" href="classbdm_1_1eigamma.html" title="Inverse-Gamma posterior density.">eigamma</a> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;
+<a name="l00564"></a><a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c">00564</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>;
+<a name="l00566"></a><a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc">00566</a>         vec &amp;<a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>;
+<a name="l00568"></a><a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5">00568</a>         vec &amp;<a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>;
+<a name="l00569"></a>00569 
+<a name="l00570"></a>00570 <span class="keyword">public</span>:
+<a name="l00573"></a>00573         <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> ( ) : <a class="code" href="classbdm_1_1mEF.html" title="Exponential family model.">mEF</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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>() ), <a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</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_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;};
+<a name="l00574"></a>00574         <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_1mEF.html" title="Exponential family model.">mEF</a> (), <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( m.<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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</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_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>() ), <a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</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_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>() ) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;<a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>;};
+<a name="l00576"></a>00576 
+<a name="l00578"></a><a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151">00578</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">int</span> len, <span class="keywordtype">double</span> k0 ) {
+<a name="l00579"></a>00579                 <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>=k0;
+<a name="l00580"></a>00580                 <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.set_parameters ( ( 1.0/ ( <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>*<a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a> ) +2.0 ) *ones ( len ) <span class="comment">/*alpha*/</span>, ones ( len ) <span class="comment">/*beta*/</span> );
+<a name="l00581"></a>00581                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
+<a name="l00582"></a>00582         };
+<a name="l00583"></a><a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c">00583</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {
+<a name="l00584"></a>00584                 <a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>=elem_mult ( val, ( <a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>-1.0 ) );
+<a name="l00585"></a>00585         };
+<a name="l00586"></a>00586 };
+<a name="l00587"></a>00587 
+<a name="l00599"></a><a class="code" href="classbdm_1_1mgamma__fix.html">00599</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="l00600"></a>00600 <span class="keyword">protected</span>:
+<a name="l00602"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa">00602</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>;
+<a name="l00604"></a><a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2">00604</a>         vec <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>;
+<a name="l00605"></a>00605 <span class="keyword">public</span>:
+<a name="l00607"></a><a class="code" href="classbdm_1_1mgamma__fix.html#9a31bc9b4b60188a18a2a6b588dc4b2d">00607</a>         <a class="code" href="classbdm_1_1mgamma__fix.html#9a31bc9b4b60188a18a2a6b588dc4b2d" 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#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a> () {};
+<a name="l00609"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2">00609</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0 ) {
+<a name="l00610"></a>00610                 <a class="code" href="classbdm_1_1mgamma.html#a0f21c2557b233a85838b497d040ab14" title="Set value of k.">mgamma::set_parameters</a> ( k0, ref0 );
+<a name="l00611"></a>00611                 <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>=pow ( ref0,1.0-l0 );<a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>=l0;
+<a name="l00612"></a>00612                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=dimension();
+<a name="l00613"></a>00613         };
 <a name="l00614"></a>00614 
-<a name="l00627"></a><a class="code" href="classbdm_1_1migamma__fix.html">00627</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1migamma__fix.html" title="Inverse-Gamma random walk around a fixed point.">migamma_fix</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> {
-<a name="l00628"></a>00628 <span class="keyword">protected</span>:
-<a name="l00630"></a><a class="code" href="classbdm_1_1migamma__fix.html#e1c344accac36d7ccc3ffa502e8d2f4e">00630</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma__fix.html#e1c344accac36d7ccc3ffa502e8d2f4e" title="parameter l">l</a>;
-<a name="l00632"></a><a class="code" href="classbdm_1_1migamma__fix.html#5d453e5a2bdfc9a16c8acb8842dc9780">00632</a>         vec <a class="code" href="classbdm_1_1migamma__fix.html#5d453e5a2bdfc9a16c8acb8842dc9780" title="reference vector">refl</a>;
-<a name="l00633"></a>00633 <span class="keyword">public</span>:
-<a name="l00635"></a><a class="code" href="classbdm_1_1migamma__fix.html#42a61f9468b2c435386f47ae8a5ddf7e">00635</a>         <a class="code" href="classbdm_1_1migamma__fix.html#42a61f9468b2c435386f47ae8a5ddf7e" title="Constructor.">migamma_fix</a> ( ) : <a class="code" href="classbdm_1_1migamma.html" title="Inverse-Gamma random walk.">migamma</a> (),<a class="code" href="classbdm_1_1migamma__fix.html#5d453e5a2bdfc9a16c8acb8842dc9780" title="reference vector">refl</a> ( ) {};
-<a name="l00637"></a><a class="code" href="classbdm_1_1migamma__fix.html#17f9ce1068660a4e8c05173bef7d7440">00637</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__fix.html#17f9ce1068660a4e8c05173bef7d7440" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0 ) {
-<a name="l00638"></a>00638                 <a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151" title="Set value of k.">migamma::set_parameters</a> ( ref0.length(), k0 );
-<a name="l00639"></a>00639                 <a class="code" href="classbdm_1_1migamma__fix.html#5d453e5a2bdfc9a16c8acb8842dc9780" title="reference vector">refl</a>=pow ( ref0,1.0-l0 );
-<a name="l00640"></a>00640                 <a class="code" href="classbdm_1_1migamma__fix.html#e1c344accac36d7ccc3ffa502e8d2f4e" title="parameter l">l</a>=l0;
-<a name="l00641"></a>00641                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
-<a name="l00642"></a>00642         };
-<a name="l00643"></a>00643 
-<a name="l00644"></a><a class="code" href="classbdm_1_1migamma__fix.html#cfbabd293795d44aae1b7c874e57c4b8">00644</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__fix.html#cfbabd293795d44aae1b7c874e57c4b8" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {
-<a name="l00645"></a>00645                 vec mean=elem_mult ( <a class="code" href="classbdm_1_1migamma__fix.html#5d453e5a2bdfc9a16c8acb8842dc9780" title="reference vector">refl</a>,pow ( val,<a class="code" href="classbdm_1_1migamma__fix.html#e1c344accac36d7ccc3ffa502e8d2f4e" title="parameter l">l</a> ) );
-<a name="l00646"></a>00646                 <a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">migamma::condition</a> ( mean );
-<a name="l00647"></a>00647         };
-<a name="l00648"></a>00648 };
-<a name="l00650"></a>00650 <span class="keyword">enum</span> RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 };
-<a name="l00656"></a><a class="code" href="classbdm_1_1eEmp.html">00656</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="l00657"></a>00657 <span class="keyword">protected</span> :
-<a name="l00659"></a><a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031">00659</a>         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;
-<a name="l00661"></a><a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d">00661</a>         vec <a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;
-<a name="l00663"></a><a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3">00663</a>         Array&lt;vec&gt; <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;
-<a name="l00664"></a>00664 <span class="keyword">public</span>:
-<a name="l00667"></a>00667         <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#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> (  ),<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( ) {};
-<a name="l00668"></a>00668         <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">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#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>(e.<a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>), <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>(e.<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>) {};
-<a name="l00670"></a>00670         
-<a name="l00672"></a>00672         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#82320074a9b0ad7e1bb33a6e885b65d7" title="Set samples and weights.">set_parameters</a> ( <span class="keyword">const</span> vec &amp;w0, <span class="keyword">const</span> epdf* pdf0 );
-<a name="l00674"></a>00674         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#b62d802b8ef39f7c4dcbeb366c90951a" title="Set sample.">set_samples</a> ( <span class="keyword">const</span> epdf* pdf0 );
-<a name="l00676"></a><a class="code" href="classbdm_1_1eEmp.html#dccd02eaa4c45e858a6351723686ac85">00676</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#dccd02eaa4c45e858a6351723686ac85" title="Set sample.">set_n</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#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>.set_size ( n0,copy );<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>.set_size ( n0,copy );};
-<a name="l00678"></a><a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef">00678</a>         vec&amp; <a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>()  {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
-<a name="l00680"></a><a class="code" href="classbdm_1_1eEmp.html#b7d7106f486e3fad38590914a693d714">00680</a>         <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" 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#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
-<a name="l00682"></a><a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2">00682</a>         Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
-<a name="l00684"></a><a class="code" href="classbdm_1_1eEmp.html#b59af0efdb009d98ea8ebfa965e74ae2">00684</a>         <span class="keyword">const</span> Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
-<a name="l00686"></a>00686         ivec <a class="code" href="classbdm_1_1eEmp.html#f06ce255de5dbb2313f52ee51f82ba3d" title="Function performs resampling, i.e. removal of low-weight samples and duplication...">resample</a> ( RESAMPLING_METHOD method = SYSTEMATIC );
-<a name="l00688"></a><a class="code" href="classbdm_1_1eEmp.html#97f1e07b5ae6eebc91c7365f0f88d270">00688</a>         vec <a class="code" href="classbdm_1_1eEmp.html#97f1e07b5ae6eebc91c7365f0f88d270" title="inherited operation : NOT implemneted">sample</a>()<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> 0;}
-<a name="l00690"></a><a class="code" href="classbdm_1_1eEmp.html#01654c014d3aa068f8d4ecba4be86d09">00690</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eEmp.html#01654c014d3aa068f8d4ecba4be86d09" title="inherited operation : NOT implemneted">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> 0.0;}
-<a name="l00691"></a><a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9">00691</a>         vec <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>()<span class="keyword"> const </span>{
-<a name="l00692"></a>00692                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
-<a name="l00693"></a>00693                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++ ) {pom+=<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ) *<a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> ( i );}
-<a name="l00694"></a>00694                 <span class="keywordflow">return</span> pom;
-<a name="l00695"></a>00695         }
-<a name="l00696"></a><a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87">00696</a>         vec <a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
-<a name="l00697"></a>00697                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
-<a name="l00698"></a>00698                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++ ) {pom+=pow ( <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ),2 ) *<a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> ( i );}
-<a name="l00699"></a>00699                 <span class="keywordflow">return</span> pom-pow ( <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>(),2 );
-<a name="l00700"></a>00700         }
-<a name="l00701"></a>00701 };
-<a name="l00702"></a>00702 
+<a name="l00615"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1d539591deb7a38bb3403c2b396c8ff7">00615</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1d539591deb7a38bb3403c2b396c8ff7" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {vec mean=elem_mult ( <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>,pow ( val,<a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a> ) ); <a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>=<a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>/mean;};
+<a name="l00616"></a>00616 };
+<a name="l00617"></a>00617 
+<a name="l00618"></a>00618 
+<a name="l00631"></a><a class="code" href="classbdm_1_1migamma__ref.html">00631</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="l00632"></a>00632 <span class="keyword">protected</span>:
+<a name="l00634"></a><a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d">00634</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>;
+<a name="l00636"></a><a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6">00636</a>         vec <a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>;
+<a name="l00637"></a>00637 <span class="keyword">public</span>:
+<a name="l00639"></a><a class="code" href="classbdm_1_1migamma__ref.html#f45b15a10f084991ba6b48295f10421f">00639</a>         <a class="code" href="classbdm_1_1migamma__ref.html#f45b15a10f084991ba6b48295f10421f" 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#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a> ( ) {};
+<a name="l00641"></a><a class="code" href="classbdm_1_1migamma__ref.html#b0b4eb278ef5d0831ec4954ba7bd2800">00641</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#b0b4eb278ef5d0831ec4954ba7bd2800" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">double</span> k0 , vec ref0, <span class="keywordtype">double</span> l0 ) {
+<a name="l00642"></a>00642                 <a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151" title="Set value of k.">migamma::set_parameters</a> ( ref0.length(), k0 );
+<a name="l00643"></a>00643                 <a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>=pow ( ref0,1.0-l0 );
+<a name="l00644"></a>00644                 <a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>=l0;
+<a name="l00645"></a>00645                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension();
+<a name="l00646"></a>00646         };
+<a name="l00647"></a>00647 
+<a name="l00648"></a><a class="code" href="classbdm_1_1migamma__ref.html#ae86b2e4ff963d62e05d4e130514634a">00648</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#ae86b2e4ff963d62e05d4e130514634a" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {
+<a name="l00649"></a>00649                 vec mean=elem_mult ( <a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>,pow ( val,<a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a> ) );
+<a name="l00650"></a>00650                 <a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">migamma::condition</a> ( mean );
+<a name="l00651"></a>00651         };
+<a name="l00652"></a>00652 };
+<a name="l00653"></a>00653 
+<a name="l00663"></a><a class="code" href="classbdm_1_1elognorm.html">00663</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="l00664"></a>00664         <span class="keyword">public</span>:
+<a name="l00665"></a><a class="code" href="classbdm_1_1elognorm.html#8b948e2bce1253765a2542199913aaba">00665</a>                 vec <a class="code" href="classbdm_1_1elognorm.html#8b948e2bce1253765a2542199913aaba" 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="l00666"></a><a class="code" href="classbdm_1_1elognorm.html#adb41e4f4d6600dec6f8c1dbc5ed9eea">00666</a>                 vec <a class="code" href="classbdm_1_1elognorm.html#adb41e4f4d6600dec6f8c1dbc5ed9eea" title="return expected value">mean</a>()<span class="keyword"> const </span>{vec var=<a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;ldmat&gt;::variance</a>();<span class="keywordflow">return</span> exp(<a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> - 0.5*var);};
+<a name="l00667"></a>00667                 
+<a name="l00668"></a>00668 };
+<a name="l00669"></a>00669 
+<a name="l00681"></a><a class="code" href="classbdm_1_1mlognorm.html">00681</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.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> {
+<a name="l00682"></a>00682         <span class="keyword">protected</span>:
+<a name="l00683"></a>00683                 <a class="code" href="classbdm_1_1elognorm.html">elognorm</a> eno;
+<a name="l00685"></a><a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a">00685</a>                 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>;
+<a name="l00687"></a><a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2">00687</a>                 vec &amp;<a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a>;
+<a name="l00688"></a>00688         <span class="keyword">public</span>:
+<a name="l00690"></a><a class="code" href="classbdm_1_1mlognorm.html#a5d6eb2688d02e0348b96c4fbd7bde41">00690</a>                 <a class="code" href="classbdm_1_1mlognorm.html#a5d6eb2688d02e0348b96c4fbd7bde41" title="Constructor.">mlognorm</a> ( ) : eno (), <a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a>(eno._mu()) {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;eno;};
+<a name="l00692"></a><a class="code" href="classbdm_1_1mlognorm.html#604cab0e8a76f9041dc3c606043bb39f">00692</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#604cab0e8a76f9041dc3c606043bb39f" title="Set value of k.">set_parameters</a> ( <span class="keywordtype">int</span> size, <span class="keywordtype">double</span> k) {
+<a name="l00693"></a>00693                         <a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a> = 0.5*log(k*k+1);
+<a name="l00694"></a>00694                         eno.<a class="code" href="classbdm_1_1enorm.html#b8322f2c11560871dd922c660f4771bb">set_parameters</a>(zeros(size),2*<a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>*eye(size));
+<a name="l00695"></a>00695                         
+<a name="l00696"></a>00696                         <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = size;
+<a name="l00697"></a>00697                 };
+<a name="l00698"></a>00698 
+<a name="l00699"></a><a class="code" href="classbdm_1_1mlognorm.html#9106d8fd8bdf2b6be675ffd8f3ca584e">00699</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#9106d8fd8bdf2b6be675ffd8f3ca584e" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &amp;val ) {
+<a name="l00700"></a>00700                         <a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a>=log(val)-<a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>;<span class="comment">//elem_mult ( refl,pow ( val,l ) );</span>
+<a name="l00701"></a>00701                 };
+<a name="l00702"></a>00702 };
 <a name="l00703"></a>00703 
-<a name="l00705"></a>00705 
-<a name="l00706"></a>00706 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00707"></a>00707 <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="l00708"></a>00708 <span class="comment">//Fixme test dimensions of mu0 and R0;</span>
-<a name="l00709"></a>00709         mu = mu0;
-<a name="l00710"></a>00710         R = R0;
-<a name="l00711"></a>00711         <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = mu0.length();
-<a name="l00712"></a>00712 };
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00715"></a><a class="code" href="classbdm_1_1enorm.html#d2e0d3a1e30ab3ab04df2d0c43ae74a2">00715</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::dupdate</a> ( mat &amp;v, <span class="keywordtype">double</span> nu ) {
-<a name="l00716"></a>00716         <span class="comment">//</span>
-<a name="l00717"></a>00717 };
-<a name="l00718"></a>00718 
-<a name="l00719"></a>00719 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l00720"></a>00720 <span class="comment">// void enorm&lt;sq_T&gt;::tupdate ( double phi, mat &amp;vbar, double nubar ) {</span>
-<a name="l00721"></a>00721 <span class="comment">//      //</span>
-<a name="l00722"></a>00722 <span class="comment">// };</span>
-<a name="l00723"></a>00723 
-<a name="l00724"></a>00724 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00725"></a><a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766">00725</a> vec <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::sample</a>()<span class="keyword"> const </span>{
-<a name="l00726"></a>00726         vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
-<a name="l00727"></a>00727 <span class="preprocessor">#pragma omp critical</span>
-<a name="l00728"></a>00728 <span class="preprocessor"></span>        NorRNG.sample_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,x );
-<a name="l00729"></a>00729         vec smp = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x );
-<a name="l00730"></a>00730 
-<a name="l00731"></a>00731         smp += <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>;
-<a name="l00732"></a>00732         <span class="keywordflow">return</span> smp;
-<a name="l00733"></a>00733 };
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00736"></a>00736 mat <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::sample</a> ( <span class="keywordtype">int</span> N )<span class="keyword"> const </span>{
-<a name="l00737"></a>00737         mat X ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,N );
-<a name="l00738"></a>00738         vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
-<a name="l00739"></a>00739         vec pom;
-<a name="l00740"></a>00740         <span class="keywordtype">int</span> i;
-<a name="l00741"></a>00741 
-<a name="l00742"></a>00742         <span class="keywordflow">for</span> ( i=0;i&lt;N;i++ ) {
-<a name="l00743"></a>00743 <span class="preprocessor">#pragma omp critical</span>
-<a name="l00744"></a>00744 <span class="preprocessor"></span>                NorRNG.sample_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,x );
-<a name="l00745"></a>00745                 pom = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x );
-<a name="l00746"></a>00746                 pom +=<a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>;
-<a name="l00747"></a>00747                 X.set_col ( i, pom );
-<a name="l00748"></a>00748         }
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750         <span class="keywordflow">return</span> X;
-<a name="l00751"></a>00751 };
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l00754"></a>00754 <span class="comment">// double enorm&lt;sq_T&gt;::eval ( const vec &amp;val ) const {</span>
-<a name="l00755"></a>00755 <span class="comment">//      double pdfl,e;</span>
-<a name="l00756"></a>00756 <span class="comment">//      pdfl = evallog ( val );</span>
-<a name="l00757"></a>00757 <span class="comment">//      e = exp ( pdfl );</span>
-<a name="l00758"></a>00758 <span class="comment">//      return e;</span>
-<a name="l00759"></a>00759 <span class="comment">// };</span>
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00762"></a><a class="code" href="classbdm_1_1enorm.html#e13aeed5b543b2179bacdc4fa2ae47a3">00762</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::evallog_nn</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{
-<a name="l00763"></a>00763         <span class="comment">// 1.83787706640935 = log(2pi)</span>
-<a name="l00764"></a>00764         <span class="keywordtype">double</span> tmp=-0.5* ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.invqform ( <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>-val ) );<span class="comment">// - lognc();</span>
-<a name="l00765"></a>00765         <span class="keywordflow">return</span>  tmp;
-<a name="l00766"></a>00766 };
-<a name="l00767"></a>00767 
-<a name="l00768"></a>00768 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00769"></a><a class="code" href="classbdm_1_1enorm.html#25785343aff102cc5df1cab08ba16d32">00769</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::lognc</a> ()<span class="keyword"> const </span>{
-<a name="l00770"></a>00770         <span class="comment">// 1.83787706640935 = log(2pi)</span>
-<a name="l00771"></a>00771         <span class="keywordtype">double</span> tmp=0.5* ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.cols() * 1.83787706640935 +<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.logdet() );
-<a name="l00772"></a>00772         <span class="keywordflow">return</span> tmp;
-<a name="l00773"></a>00773 };
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00776"></a><a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f">00776</a> <span class="keywordtype">void</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;::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="l00777"></a>00777         it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> );
-<a name="l00778"></a>00778         it_assert_debug ( A0.rows() ==R0.rows(),<span class="stringliteral">""</span> );
-<a name="l00779"></a>00779 
-<a name="l00780"></a>00780         <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.set_parameters ( zeros ( A0.rows() ),R0 );
-<a name="l00781"></a>00781         A = A0;
-<a name="l00782"></a>00782         mu_const = mu0;
-<a name="l00783"></a>00783         <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=A0.cols();
-<a name="l00784"></a>00784 }
+<a name="l00707"></a><a class="code" href="classbdm_1_1iW.html">00707</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1iW.html">iW</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="l00708"></a>00708         <span class="keyword">public</span>:
+<a name="l00709"></a>00709                 vec sample(){<span class="keywordflow">return</span> vec();}
+<a name="l00710"></a>00710 };
+<a name="l00711"></a>00711 
+<a name="l00713"></a>00713 <span class="keyword">enum</span> RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 };
+<a name="l00719"></a><a class="code" href="classbdm_1_1eEmp.html">00719</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="l00720"></a>00720 <span class="keyword">protected</span> :
+<a name="l00722"></a><a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031">00722</a>         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;
+<a name="l00724"></a><a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d">00724</a>         vec <a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;
+<a name="l00726"></a><a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3">00726</a>         Array&lt;vec&gt; <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;
+<a name="l00727"></a>00727 <span class="keyword">public</span>:
+<a name="l00730"></a>00730         <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#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> ( ),<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( ) {};
+<a name="l00731"></a>00731         <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">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#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> ( e.<a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> ), <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( e.<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ) {};
+<a name="l00733"></a>00733 
+<a name="l00735"></a>00735         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#7cfd383180b486fe4526bdf0179350c0" title="Set samples and weights.">set_statistics</a> ( <span class="keyword">const</span> vec &amp;w0, <span class="keyword">const</span> epdf* pdf0 );
+<a name="l00737"></a><a class="code" href="classbdm_1_1eEmp.html#cef74aa5f87d10d440b9b1e8bc78c1e7">00737</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#7cfd383180b486fe4526bdf0179350c0" 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>* pdf0 , <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a> ) {<a class="code" href="classbdm_1_1eEmp.html#7cfd383180b486fe4526bdf0179350c0" title="Set samples and weights.">set_statistics</a> ( ones ( n ) /n,pdf0 );};
+<a name="l00739"></a>00739         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#b62d802b8ef39f7c4dcbeb366c90951a" 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="l00741"></a><a class="code" href="classbdm_1_1eEmp.html#c74c281d652356c19b6b079e42ca7ef1">00741</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#c74c281d652356c19b6b079e42ca7ef1" 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#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>=n0; <a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>.set_size ( n0,copy );<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>.set_size ( n0,copy );};
+<a name="l00743"></a><a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef">00743</a>         vec&amp; <a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>()  {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
+<a name="l00745"></a><a class="code" href="classbdm_1_1eEmp.html#b7d7106f486e3fad38590914a693d714">00745</a>         <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" 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#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>;};
+<a name="l00747"></a><a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2">00747</a>         Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
+<a name="l00749"></a><a class="code" href="classbdm_1_1eEmp.html#b59af0efdb009d98ea8ebfa965e74ae2">00749</a>         <span class="keyword">const</span> Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>;};
+<a name="l00751"></a>00751         ivec <a class="code" href="classbdm_1_1eEmp.html#f06ce255de5dbb2313f52ee51f82ba3d" title="Function performs resampling, i.e. removal of low-weight samples and duplication...">resample</a> ( RESAMPLING_METHOD method=SYSTEMATIC );
+<a name="l00753"></a><a class="code" href="classbdm_1_1eEmp.html#97f1e07b5ae6eebc91c7365f0f88d270">00753</a>         vec <a class="code" href="classbdm_1_1eEmp.html#97f1e07b5ae6eebc91c7365f0f88d270" title="inherited operation : NOT implemneted">sample</a>()<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> 0;}
+<a name="l00755"></a><a class="code" href="classbdm_1_1eEmp.html#01654c014d3aa068f8d4ecba4be86d09">00755</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eEmp.html#01654c014d3aa068f8d4ecba4be86d09" title="inherited operation : NOT implemneted">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> 0.0;}
+<a name="l00756"></a><a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9">00756</a>         vec <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>()<span class="keyword"> const </span>{
+<a name="l00757"></a>00757                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
+<a name="l00758"></a>00758                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++ ) {pom+=<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ) *<a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> ( i );}
+<a name="l00759"></a>00759                 <span class="keywordflow">return</span> pom;
+<a name="l00760"></a>00760         }
+<a name="l00761"></a><a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87">00761</a>         vec <a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
+<a name="l00762"></a>00762                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
+<a name="l00763"></a>00763                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++ ) {pom+=pow ( <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ),2 ) *<a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a> ( i );}
+<a name="l00764"></a>00764                 <span class="keywordflow">return</span> pom-pow ( <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>(),2 );
+<a name="l00765"></a>00765         }
+<a name="l00767"></a><a class="code" href="classbdm_1_1eEmp.html#b1c9df656144edf79ba2d885613f661f">00767</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#b1c9df656144edf79ba2d885613f661f" 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="l00768"></a>00768                 <span class="comment">// lb in inf so than it will be pushed below;</span>
+<a name="l00769"></a>00769                 lb.set_size(<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l00770"></a>00770                 ub.set_size(<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l00771"></a>00771                 lb = std::numeric_limits&lt;double&gt;::infinity();
+<a name="l00772"></a>00772                 ub = -std::numeric_limits&lt;double&gt;::infinity();
+<a name="l00773"></a>00773                 <span class="keywordtype">int</span> j;
+<a name="l00774"></a>00774                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>;i++ ) {
+<a name="l00775"></a>00775                         <span class="keywordflow">for</span> ( j=0;j&lt;<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>; j++ ) {
+<a name="l00776"></a>00776                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ) ( j ) &lt;lb ( j ) ) {lb ( j ) =<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ) ( j );}
+<a name="l00777"></a>00777                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ) ( j ) &gt;ub ( j ) ) {ub ( j ) =<a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a> ( i ) ( j );}
+<a name="l00778"></a>00778                         }
+<a name="l00779"></a>00779                 }
+<a name="l00780"></a>00780         }
+<a name="l00781"></a>00781 };
+<a name="l00782"></a>00782 
+<a name="l00783"></a>00783 
 <a name="l00785"></a>00785 
-<a name="l00786"></a>00786 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l00787"></a>00787 <span class="comment">// vec mlnorm&lt;sq_T&gt;::samplecond (const  vec &amp;cond, double &amp;lik ) {</span>
-<a name="l00788"></a>00788 <span class="comment">//      this-&gt;condition ( cond );</span>
-<a name="l00789"></a>00789 <span class="comment">//      vec smp = epdf.sample();</span>
-<a name="l00790"></a>00790 <span class="comment">//      lik = epdf.eval ( smp );</span>
-<a name="l00791"></a>00791 <span class="comment">//      return smp;</span>
-<a name="l00792"></a>00792 <span class="comment">// }</span>
+<a name="l00786"></a>00786 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00787"></a>00787 <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="l00788"></a>00788 <span class="comment">//Fixme test dimensions of mu0 and R0;</span>
+<a name="l00789"></a>00789         mu = mu0;
+<a name="l00790"></a>00790         R = R0;
+<a name="l00791"></a>00791         <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = mu0.length();
+<a name="l00792"></a>00792 };
 <a name="l00793"></a>00793 
-<a name="l00794"></a>00794 <span class="comment">// template&lt;class sq_T&gt;</span>
-<a name="l00795"></a>00795 <span class="comment">// mat mlnorm&lt;sq_T&gt;::samplecond (const vec &amp;cond, vec &amp;lik, int n ) {</span>
-<a name="l00796"></a>00796 <span class="comment">//      int i;</span>
-<a name="l00797"></a>00797 <span class="comment">//      int dim = rv.count();</span>
-<a name="l00798"></a>00798 <span class="comment">//      mat Smp ( dim,n );</span>
-<a name="l00799"></a>00799 <span class="comment">//      vec smp ( dim );</span>
-<a name="l00800"></a>00800 <span class="comment">//      this-&gt;condition ( cond );</span>
-<a name="l00801"></a>00801 <span class="comment">//</span>
-<a name="l00802"></a>00802 <span class="comment">//      for ( i=0; i&lt;n; i++ ) {</span>
-<a name="l00803"></a>00803 <span class="comment">//              smp = epdf.sample();</span>
-<a name="l00804"></a>00804 <span class="comment">//              lik ( i ) = epdf.eval ( smp );</span>
-<a name="l00805"></a>00805 <span class="comment">//              Smp.set_col ( i ,smp );</span>
-<a name="l00806"></a>00806 <span class="comment">//      }</span>
-<a name="l00807"></a>00807 <span class="comment">//</span>
-<a name="l00808"></a>00808 <span class="comment">//      return Smp;</span>
-<a name="l00809"></a>00809 <span class="comment">// }</span>
+<a name="l00794"></a>00794 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00795"></a><a class="code" href="classbdm_1_1enorm.html#d2e0d3a1e30ab3ab04df2d0c43ae74a2">00795</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::dupdate</a> ( mat &amp;v, <span class="keywordtype">double</span> nu ) {
+<a name="l00796"></a>00796         <span class="comment">//</span>
+<a name="l00797"></a>00797 };
+<a name="l00798"></a>00798 
+<a name="l00799"></a>00799 <span class="comment">// template&lt;class sq_T&gt;</span>
+<a name="l00800"></a>00800 <span class="comment">// void enorm&lt;sq_T&gt;::tupdate ( double phi, mat &amp;vbar, double nubar ) {</span>
+<a name="l00801"></a>00801 <span class="comment">//      //</span>
+<a name="l00802"></a>00802 <span class="comment">// };</span>
+<a name="l00803"></a>00803 
+<a name="l00804"></a>00804 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00805"></a><a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766">00805</a> vec <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::sample</a>()<span class="keyword"> const </span>{
+<a name="l00806"></a>00806         vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
+<a name="l00807"></a>00807 <span class="preprocessor">#pragma omp critical</span>
+<a name="l00808"></a>00808 <span class="preprocessor"></span>        NorRNG.sample_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,x );
+<a name="l00809"></a>00809         vec smp = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x );
 <a name="l00810"></a>00810 
-<a name="l00811"></a>00811 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00812"></a><a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">00812</a> <span class="keywordtype">void</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;::condition</a> ( <span class="keyword">const</span> vec &amp;cond ) {
-<a name="l00813"></a>00813         _mu = A*cond + mu_const;
-<a name="l00814"></a>00814 <span class="comment">//R is already assigned;</span>
-<a name="l00815"></a>00815 }
-<a name="l00816"></a>00816 
-<a name="l00817"></a>00817 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00818"></a><a class="code" href="classbdm_1_1enorm.html#cd02d76e9d4f96bdd3fa6b604e273039">00818</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_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">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="l00819"></a>00819         it_assert_debug(<a class="code" href="classbdm_1_1epdf.html#c4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(), <span class="stringliteral">"rv description is not assigned"</span>);
-<a name="l00820"></a>00820         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
+<a name="l00811"></a>00811         smp += <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>;
+<a name="l00812"></a>00812         <span class="keywordflow">return</span> smp;
+<a name="l00813"></a>00813 };
+<a name="l00814"></a>00814 
+<a name="l00815"></a>00815 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00816"></a>00816 mat <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::sample</a> ( <span class="keywordtype">int</span> N )<span class="keyword"> const </span>{
+<a name="l00817"></a>00817         mat X ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,N );
+<a name="l00818"></a>00818         vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
+<a name="l00819"></a>00819         vec pom;
+<a name="l00820"></a>00820         <span class="keywordtype">int</span> i;
 <a name="l00821"></a>00821 
-<a name="l00822"></a>00822         sq_T Rn ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>,irvn ); <span class="comment">//select rows and columns of R</span>
-<a name="l00823"></a>00823         
-<a name="l00824"></a>00824         <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="l00825"></a>00825         tmp-&gt;<a class="code" href="classbdm_1_1epdf.html#f423e28448dbb69ef4905295ec8de8ff" title="Name its rv.">set_rv</a> ( rvn );
-<a name="l00826"></a>00826         tmp-&gt;<a class="code" href="classbdm_1_1enorm.html#b8322f2c11560871dd922c660f4771bb">set_parameters</a> ( <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvn ), Rn );
-<a name="l00827"></a>00827         <span class="keywordflow">return</span> tmp;
-<a name="l00828"></a>00828 }
+<a name="l00822"></a>00822         <span class="keywordflow">for</span> ( i=0;i&lt;N;i++ ) {
+<a name="l00823"></a>00823 <span class="preprocessor">#pragma omp critical</span>
+<a name="l00824"></a>00824 <span class="preprocessor"></span>                NorRNG.sample_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,x );
+<a name="l00825"></a>00825                 pom = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x );
+<a name="l00826"></a>00826                 pom +=<a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>;
+<a name="l00827"></a>00827                 X.set_col ( i, pom );
+<a name="l00828"></a>00828         }
 <a name="l00829"></a>00829 
-<a name="l00830"></a>00830 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00831"></a><a class="code" href="classbdm_1_1enorm.html#baea4d49c657342b58297d68cda16d26">00831</a> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a>* <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">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="l00830"></a>00830         <span class="keywordflow">return</span> X;
+<a name="l00831"></a>00831 };
 <a name="l00832"></a>00832 
-<a name="l00833"></a>00833         it_assert_debug ( <a class="code" href="classbdm_1_1epdf.html#c4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(),<span class="stringliteral">"rvs are not assigned"</span> );
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835         <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#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#aec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> ( rvn );
-<a name="l00836"></a>00836         it_assert_debug ( ( rvc.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>() +rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>() ==<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>() ),<span class="stringliteral">"wrong rvn"</span> );
-<a name="l00837"></a>00837         <span class="comment">//Permutation vector of the new R</span>
-<a name="l00838"></a>00838         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
-<a name="l00839"></a>00839         ivec irvc = rvc.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
-<a name="l00840"></a>00840         ivec perm=concat ( irvn , irvc );
-<a name="l00841"></a>00841         sq_T Rn ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>,perm );
-<a name="l00842"></a>00842 
-<a name="l00843"></a>00843         <span class="comment">//fixme - could this be done in general for all sq_T?</span>
-<a name="l00844"></a>00844         mat S=Rn.to_mat();
-<a name="l00845"></a>00845         <span class="comment">//fixme</span>
-<a name="l00846"></a>00846         <span class="keywordtype">int</span> n=rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>()-1;
-<a name="l00847"></a>00847         <span class="keywordtype">int</span> end=<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.rows()-1;
-<a name="l00848"></a>00848         mat S11 = S.get ( 0,n, 0, n );
-<a name="l00849"></a>00849         mat S12 = S.get ( 0, n , rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end );
-<a name="l00850"></a>00850         mat S22 = S.get ( rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end, rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end );
-<a name="l00851"></a>00851 
-<a name="l00852"></a>00852         vec mu1 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvn );
-<a name="l00853"></a>00853         vec mu2 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvc );
-<a name="l00854"></a>00854         mat A=S12*inv ( S22 );
-<a name="l00855"></a>00855         sq_T R_n ( S11 - A *S12.T() );
-<a name="l00856"></a>00856 
-<a name="l00857"></a>00857         <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="l00858"></a>00858         tmp-&gt;set_rv(rvn); tmp-&gt;set_rvc(rvc);
-<a name="l00859"></a>00859         tmp-&gt;set_parameters ( A,mu1-A*mu2,R_n );
-<a name="l00860"></a>00860         <span class="keywordflow">return</span> tmp;
-<a name="l00861"></a>00861 }
-<a name="l00862"></a>00862 
-<a name="l00864"></a>00864 
-<a name="l00865"></a>00865 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
-<a name="l00866"></a>00866 std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_T&gt; &amp;ml ) {
-<a name="l00867"></a>00867         os &lt;&lt; <span class="stringliteral">"A:"</span>&lt;&lt; ml.A&lt;&lt;endl;
-<a name="l00868"></a>00868         os &lt;&lt; <span class="stringliteral">"mu:"</span>&lt;&lt; ml.mu_const&lt;&lt;endl;
-<a name="l00869"></a>00869         os &lt;&lt; <span class="stringliteral">"R:"</span> &lt;&lt; ml.epdf._R().to_mat() &lt;&lt;endl;
-<a name="l00870"></a>00870         <span class="keywordflow">return</span> os;
-<a name="l00871"></a>00871 };
-<a name="l00872"></a>00872 
-<a name="l00873"></a>00873 }
-<a name="l00874"></a>00874 <span class="preprocessor">#endif //EF_H</span>
+<a name="l00833"></a>00833 <span class="comment">// template&lt;class sq_T&gt;</span>
+<a name="l00834"></a>00834 <span class="comment">// double enorm&lt;sq_T&gt;::eval ( const vec &amp;val ) const {</span>
+<a name="l00835"></a>00835 <span class="comment">//      double pdfl,e;</span>
+<a name="l00836"></a>00836 <span class="comment">//      pdfl = evallog ( val );</span>
+<a name="l00837"></a>00837 <span class="comment">//      e = exp ( pdfl );</span>
+<a name="l00838"></a>00838 <span class="comment">//      return e;</span>
+<a name="l00839"></a>00839 <span class="comment">// };</span>
+<a name="l00840"></a>00840 
+<a name="l00841"></a>00841 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00842"></a><a class="code" href="classbdm_1_1enorm.html#e13aeed5b543b2179bacdc4fa2ae47a3">00842</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::evallog_nn</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{
+<a name="l00843"></a>00843         <span class="comment">// 1.83787706640935 = log(2pi)</span>
+<a name="l00844"></a>00844         <span class="keywordtype">double</span> tmp=-0.5* ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.invqform ( <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>-val ) );<span class="comment">// - lognc();</span>
+<a name="l00845"></a>00845         <span class="keywordflow">return</span>  tmp;
+<a name="l00846"></a>00846 };
+<a name="l00847"></a>00847 
+<a name="l00848"></a>00848 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00849"></a><a class="code" href="classbdm_1_1enorm.html#25785343aff102cc5df1cab08ba16d32">00849</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;sq_T&gt;::lognc</a> ()<span class="keyword"> const </span>{
+<a name="l00850"></a>00850         <span class="comment">// 1.83787706640935 = log(2pi)</span>
+<a name="l00851"></a>00851         <span class="keywordtype">double</span> tmp=0.5* ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.cols() * 1.83787706640935 +<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.logdet() );
+<a name="l00852"></a>00852         <span class="keywordflow">return</span> tmp;
+<a name="l00853"></a>00853 };
+<a name="l00854"></a>00854 
+<a name="l00855"></a>00855 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00856"></a><a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f">00856</a> <span class="keywordtype">void</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;::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="l00857"></a>00857         it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> );
+<a name="l00858"></a>00858         it_assert_debug ( A0.rows() ==R0.rows(),<span class="stringliteral">""</span> );
+<a name="l00859"></a>00859 
+<a name="l00860"></a>00860         <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.set_parameters ( zeros ( A0.rows() ),R0 );
+<a name="l00861"></a>00861         A = A0;
+<a name="l00862"></a>00862         mu_const = mu0;
+<a name="l00863"></a>00863         <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=A0.cols();
+<a name="l00864"></a>00864 }
+<a name="l00865"></a>00865 
+<a name="l00866"></a>00866 <span class="comment">// template&lt;class sq_T&gt;</span>
+<a name="l00867"></a>00867 <span class="comment">// vec mlnorm&lt;sq_T&gt;::samplecond (const  vec &amp;cond, double &amp;lik ) {</span>
+<a name="l00868"></a>00868 <span class="comment">//      this-&gt;condition ( cond );</span>
+<a name="l00869"></a>00869 <span class="comment">//      vec smp = epdf.sample();</span>
+<a name="l00870"></a>00870 <span class="comment">//      lik = epdf.eval ( smp );</span>
+<a name="l00871"></a>00871 <span class="comment">//      return smp;</span>
+<a name="l00872"></a>00872 <span class="comment">// }</span>
+<a name="l00873"></a>00873 
+<a name="l00874"></a>00874 <span class="comment">// template&lt;class sq_T&gt;</span>
+<a name="l00875"></a>00875 <span class="comment">// mat mlnorm&lt;sq_T&gt;::samplecond (const vec &amp;cond, vec &amp;lik, int n ) {</span>
+<a name="l00876"></a>00876 <span class="comment">//      int i;</span>
+<a name="l00877"></a>00877 <span class="comment">//      int dim = rv.count();</span>
+<a name="l00878"></a>00878 <span class="comment">//      mat Smp ( dim,n );</span>
+<a name="l00879"></a>00879 <span class="comment">//      vec smp ( dim );</span>
+<a name="l00880"></a>00880 <span class="comment">//      this-&gt;condition ( cond );</span>
+<a name="l00881"></a>00881 <span class="comment">//</span>
+<a name="l00882"></a>00882 <span class="comment">//      for ( i=0; i&lt;n; i++ ) {</span>
+<a name="l00883"></a>00883 <span class="comment">//              smp = epdf.sample();</span>
+<a name="l00884"></a>00884 <span class="comment">//              lik ( i ) = epdf.eval ( smp );</span>
+<a name="l00885"></a>00885 <span class="comment">//              Smp.set_col ( i ,smp );</span>
+<a name="l00886"></a>00886 <span class="comment">//      }</span>
+<a name="l00887"></a>00887 <span class="comment">//</span>
+<a name="l00888"></a>00888 <span class="comment">//      return Smp;</span>
+<a name="l00889"></a>00889 <span class="comment">// }</span>
+<a name="l00890"></a>00890 
+<a name="l00891"></a>00891 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00892"></a><a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">00892</a> <span class="keywordtype">void</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;::condition</a> ( <span class="keyword">const</span> vec &amp;cond ) {
+<a name="l00893"></a>00893         _mu = A*cond + mu_const;
+<a name="l00894"></a>00894 <span class="comment">//R is already assigned;</span>
+<a name="l00895"></a>00895 }
+<a name="l00896"></a>00896 
+<a name="l00897"></a>00897 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00898"></a><a class="code" href="classbdm_1_1enorm.html#cd02d76e9d4f96bdd3fa6b604e273039">00898</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_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">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="l00899"></a>00899         it_assert_debug ( <a class="code" href="classbdm_1_1epdf.html#c4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(), <span class="stringliteral">"rv description is not assigned"</span> );
+<a name="l00900"></a>00900         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
+<a name="l00901"></a>00901 
+<a name="l00902"></a>00902         sq_T Rn ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>,irvn ); <span class="comment">//select rows and columns of R</span>
+<a name="l00903"></a>00903 
+<a name="l00904"></a>00904         <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="l00905"></a>00905         tmp-&gt;<a class="code" href="classbdm_1_1epdf.html#f423e28448dbb69ef4905295ec8de8ff" title="Name its rv.">set_rv</a> ( rvn );
+<a name="l00906"></a>00906         tmp-&gt;<a class="code" href="classbdm_1_1enorm.html#b8322f2c11560871dd922c660f4771bb">set_parameters</a> ( <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvn ), Rn );
+<a name="l00907"></a>00907         <span class="keywordflow">return</span> tmp;
+<a name="l00908"></a>00908 }
+<a name="l00909"></a>00909 
+<a name="l00910"></a>00910 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00911"></a><a class="code" href="classbdm_1_1enorm.html#baea4d49c657342b58297d68cda16d26">00911</a> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a>* <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">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="l00912"></a>00912 
+<a name="l00913"></a>00913         it_assert_debug ( <a class="code" href="classbdm_1_1epdf.html#c4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(),<span class="stringliteral">"rvs are not assigned"</span> );
+<a name="l00914"></a>00914 
+<a name="l00915"></a>00915         <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#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#aec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> ( rvn );
+<a name="l00916"></a>00916         it_assert_debug ( ( rvc.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>() +rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>() ==<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>() ),<span class="stringliteral">"wrong rvn"</span> );
+<a name="l00917"></a>00917         <span class="comment">//Permutation vector of the new R</span>
+<a name="l00918"></a>00918         ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
+<a name="l00919"></a>00919         ivec irvc = rvc.<a class="code" href="classbdm_1_1RV.html#cbebdb5e0d30101a6eb63550ef701c55">dataind</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
+<a name="l00920"></a>00920         ivec perm=concat ( irvn , irvc );
+<a name="l00921"></a>00921         sq_T Rn ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>,perm );
+<a name="l00922"></a>00922 
+<a name="l00923"></a>00923         <span class="comment">//fixme - could this be done in general for all sq_T?</span>
+<a name="l00924"></a>00924         mat S=Rn.to_mat();
+<a name="l00925"></a>00925         <span class="comment">//fixme</span>
+<a name="l00926"></a>00926         <span class="keywordtype">int</span> n=rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>()-1;
+<a name="l00927"></a>00927         <span class="keywordtype">int</span> end=<a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.rows()-1;
+<a name="l00928"></a>00928         mat S11 = S.get ( 0,n, 0, n );
+<a name="l00929"></a>00929         mat S12 = S.get ( 0, n , rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end );
+<a name="l00930"></a>00930         mat S22 = S.get ( rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end, rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end );
+<a name="l00931"></a>00931 
+<a name="l00932"></a>00932         vec mu1 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvn );
+<a name="l00933"></a>00933         vec mu2 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvc );
+<a name="l00934"></a>00934         mat A=S12*inv ( S22 );
+<a name="l00935"></a>00935         sq_T R_n ( S11 - A *S12.T() );
+<a name="l00936"></a>00936 
+<a name="l00937"></a>00937         <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="l00938"></a>00938         tmp-&gt;set_rv ( rvn ); tmp-&gt;set_rvc ( rvc );
+<a name="l00939"></a>00939         tmp-&gt;set_parameters ( A,mu1-A*mu2,R_n );
+<a name="l00940"></a>00940         <span class="keywordflow">return</span> tmp;
+<a name="l00941"></a>00941 }
+<a name="l00942"></a>00942 
+<a name="l00944"></a>00944 
+<a name="l00945"></a>00945 <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt;
+<a name="l00946"></a>00946 std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_T&gt; &amp;ml ) {
+<a name="l00947"></a>00947         os &lt;&lt; <span class="stringliteral">"A:"</span>&lt;&lt; ml.A&lt;&lt;endl;
+<a name="l00948"></a>00948         os &lt;&lt; <span class="stringliteral">"mu:"</span>&lt;&lt; ml.mu_const&lt;&lt;endl;
+<a name="l00949"></a>00949         os &lt;&lt; <span class="stringliteral">"R:"</span> &lt;&lt; ml.epdf._R().to_mat() &lt;&lt;endl;
+<a name="l00950"></a>00950         <span class="keywordflow">return</span> os;
+<a name="l00951"></a>00951 };
+<a name="l00952"></a>00952 
+<a name="l00953"></a>00953 }
+<a name="l00954"></a>00954 <span class="preprocessor">#endif //EF_H</span>
 </pre></div></div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 18 17:38:40 2009 for mixpp by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Wed Mar 4 18:50:11 2009 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
