Show
Ignore:
Timestamp:
04/09/09 16:11:47 (16 years ago)
Author:
smidl
Message:

doc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/html/libEF_8h-source.html

    r305 r312  
    208208<a name="l00229"></a>00229                 <span class="keyword">protected</span>: 
    209209<a name="l00231"></a><a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2">00231</a>                         vec <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>; 
    210 <a name="l00233"></a><a class="code" href="classbdm_1_1eDirich.html#ee9db192a6f0ab7b29c33b2a18a5e1b4">00233</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eDirich.html#ee9db192a6f0ab7b29c33b2a18a5e1b4" title="speedup variable">gamma</a>; 
    211 <a name="l00234"></a>00234                 <span class="keyword">public</span>: 
    212 <a name="l00237"></a>00237  
    213 <a name="l00238"></a>00238                         <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> () : <a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ) {}; 
    214 <a name="l00239"></a>00239                         <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> &amp;D0 ) : <a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> () {set_parameters ( D0.<a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a> );}; 
    215 <a name="l00240"></a>00240                         eDirich ( <span class="keyword">const</span> vec &amp;beta0 ) {set_parameters ( beta0 );}; 
    216 <a name="l00241"></a>00241                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;beta0 ) 
    217 <a name="l00242"></a>00242                         { 
    218 <a name="l00243"></a>00243                                 <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>= beta0; 
    219 <a name="l00244"></a>00244                                 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>.length(); 
    220 <a name="l00245"></a>00245                                 <a class="code" href="classbdm_1_1eDirich.html#ee9db192a6f0ab7b29c33b2a18a5e1b4" title="speedup variable">gamma</a> = sum ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a> ); 
    221 <a name="l00246"></a>00246                         } 
    222 <a name="l00248"></a>00248  
    223 <a name="l00249"></a><a class="code" href="classbdm_1_1eDirich.html#3290613d31d58daa8a45a54b003871fc">00249</a>                         vec <a class="code" href="classbdm_1_1eDirich.html#3290613d31d58daa8a45a54b003871fc" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> vec_1 ( 0.0 );}; 
    224 <a name="l00250"></a><a class="code" href="classbdm_1_1eDirich.html#cb343355ec791298bb5a3404cd482fb6">00250</a>                         vec <a class="code" href="classbdm_1_1eDirich.html#cb343355ec791298bb5a3404cd482fb6" title="return expected value">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>/<a class="code" href="classbdm_1_1eDirich.html#ee9db192a6f0ab7b29c33b2a18a5e1b4" title="speedup variable">gamma</a>;}; 
    225 <a name="l00251"></a><a class="code" href="classbdm_1_1eDirich.html#43c547a2507e233706f92712d8c2aacc">00251</a>                         vec <a class="code" href="classbdm_1_1eDirich.html#43c547a2507e233706f92712d8c2aacc" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> elem_mult ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>, ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>+1 ) ) / ( <a class="code" href="classbdm_1_1eDirich.html#ee9db192a6f0ab7b29c33b2a18a5e1b4" title="speedup variable">gamma</a>* ( <a class="code" href="classbdm_1_1eDirich.html#ee9db192a6f0ab7b29c33b2a18a5e1b4" title="speedup variable">gamma</a>+1 ) );} 
    226 <a name="l00253"></a><a class="code" href="classbdm_1_1eDirich.html#e09a24938e80c3d94b0ee842d1552318">00253</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eDirich.html#e09a24938e80c3d94b0ee842d1552318" title="In this instance, val is ...">evallog_nn</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const</span> 
    227 <a name="l00254"></a>00254 <span class="keyword">                        </span>{ 
    228 <a name="l00255"></a>00255                                 <span class="keywordtype">double</span> tmp; tmp= ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>-1 ) *log ( val );               it_assert_debug ( std::isfinite ( tmp ),<span class="stringliteral">"Infinite value"</span> ); 
    229 <a name="l00256"></a>00256                                 <span class="keywordflow">return</span> tmp; 
    230 <a name="l00257"></a>00257                         }; 
    231 <a name="l00258"></a><a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2">00258</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a> ()<span class="keyword"> const</span> 
    232 <a name="l00259"></a>00259 <span class="keyword">                        </span>{ 
    233 <a name="l00260"></a>00260                                 <span class="keywordtype">double</span> tmp; 
    234 <a name="l00261"></a>00261                                 <span class="keywordtype">double</span> gam=sum ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a> ); 
    235 <a name="l00262"></a>00262                                 <span class="keywordtype">double</span> lgb=0.0; 
    236 <a name="l00263"></a>00263                                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>.length();i++ ) {lgb+=lgamma ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a> ( i ) );} 
    237 <a name="l00264"></a>00264                                 tmp= lgb-lgamma ( gam ); 
    238 <a name="l00265"></a>00265                                 it_assert_debug ( std::isfinite ( tmp ),<span class="stringliteral">"Infinite value"</span> ); 
    239 <a name="l00266"></a>00266                                 <span class="keywordflow">return</span> tmp; 
    240 <a name="l00267"></a>00267                         }; 
    241 <a name="l00269"></a><a class="code" href="classbdm_1_1eDirich.html#175e0add26d2105c28d8121eefb9e324">00269</a>                         vec&amp; <a class="code" href="classbdm_1_1eDirich.html#175e0add26d2105c28d8121eefb9e324" title="access function">_beta</a>()  {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>;} 
    242 <a name="l00271"></a>00271         }; 
    243 <a name="l00272"></a>00272  
    244 <a name="l00274"></a><a class="code" href="classbdm_1_1multiBM.html">00274</a>         <span class="keyword">class </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> 
    245 <a name="l00275"></a>00275         { 
    246 <a name="l00276"></a>00276                 <span class="keyword">protected</span>: 
    247 <a name="l00278"></a><a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a">00278</a>                         <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>; 
    248 <a name="l00280"></a><a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25">00280</a>                         vec &amp;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>; 
    249 <a name="l00281"></a>00281                 <span class="keyword">public</span>: 
    250 <a name="l00283"></a><a class="code" href="classbdm_1_1multiBM.html#c4dd6d9522a8a605776d21bac9bd9daf">00283</a>                         <a class="code" href="classbdm_1_1multiBM.html#c4dd6d9522a8a605776d21bac9bd9daf" title="Default constructor.">multiBM</a> ( ) : <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ),<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ( ),<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>._beta() ) 
    251 <a name="l00284"></a>00284                         { 
    252 <a name="l00285"></a>00285                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>.length() &gt;0 ) {<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
    253 <a name="l00286"></a>00286                                 <span class="keywordflow">else</span>{<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=0.0;} 
    254 <a name="l00287"></a>00287                         } 
    255 <a name="l00289"></a><a class="code" href="classbdm_1_1multiBM.html#c4378cf8037f6bed29c74eea63344b31">00289</a>                         <a class="code" href="classbdm_1_1multiBM.html#c4378cf8037f6bed29c74eea63344b31" title="Copy constructor.">multiBM</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a> &amp;B ) : <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( B ),<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ( B.<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ),<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>._beta() ) {} 
    256 <a name="l00291"></a><a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52">00291</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52" title="Sets sufficient statistics to match that of givefrom mB0.">set_statistics</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a>* mB0 ) {<span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>* mB=<span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>*<span class="keyword">&gt;</span> ( mB0 ); <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>=mB-&gt;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>;} 
    257 <a name="l00292"></a><a class="code" href="classbdm_1_1multiBM.html#1e4bf41b61937fd80f34049742e23f95">00292</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#1e4bf41b61937fd80f34049742e23f95" title="Incremental Bayes rule.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ) 
    258 <a name="l00293"></a>00293                         { 
    259 <a name="l00294"></a>00294                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>&lt;1.0 ) {<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>*=<a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>;<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
    260 <a name="l00295"></a>00295                                 <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>+=dt; 
    261 <a name="l00296"></a>00296                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {<a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>()-<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>;} 
    262 <a name="l00297"></a>00297                         } 
    263 <a name="l00298"></a><a class="code" href="classbdm_1_1multiBM.html#e157b607c1e3fa91d42aeea44458e2bf">00298</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1multiBM.html#e157b607c1e3fa91d42aeea44458e2bf">logpred</a> ( <span class="keyword">const</span> vec &amp;dt )<span class="keyword"> const</span> 
    264 <a name="l00299"></a>00299 <span class="keyword">                        </span>{ 
    265 <a name="l00300"></a>00300                                 <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> pred ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ); 
    266 <a name="l00301"></a>00301                                 vec &amp;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> = pred.<a class="code" href="classbdm_1_1eDirich.html#175e0add26d2105c28d8121eefb9e324" title="access function">_beta</a>(); 
    267 <a name="l00302"></a>00302  
    268 <a name="l00303"></a>00303                                 <span class="keywordtype">double</span> lll; 
    269 <a name="l00304"></a>00304                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>&lt;1.0 ) 
    270 <a name="l00305"></a>00305                                         {beta*=<a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>;lll=pred.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
    271 <a name="l00306"></a>00306                                 <span class="keywordflow">else</span> 
    272 <a name="l00307"></a>00307                                         <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {lll=<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>;} 
    273 <a name="l00308"></a>00308                                         <span class="keywordflow">else</span>{lll=pred.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
    274 <a name="l00309"></a>00309  
    275 <a name="l00310"></a>00310                                 beta+=dt; 
    276 <a name="l00311"></a>00311                                 <span class="keywordflow">return</span> pred.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>()-lll; 
    277 <a name="l00312"></a>00312                         } 
    278 <a name="l00313"></a><a class="code" href="classbdm_1_1multiBM.html#aaeb18c989088feb8d26d300e4971732">00313</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#aaeb18c989088feb8d26d300e4971732" title="Flatten the posterior according to the given BMEF (of the same type!).">flatten</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* B ) 
    279 <a name="l00314"></a>00314                         { 
    280 <a name="l00315"></a>00315                                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>* E=<span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>*<span class="keyword">&gt;</span> ( B ); 
    281 <a name="l00316"></a>00316                                 <span class="comment">// sum(beta) should be equal to sum(B.beta)</span> 
    282 <a name="l00317"></a>00317                                 <span class="keyword">const</span> vec &amp;Eb=E-&gt;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>;<span class="comment">//const_cast&lt;multiBM*&gt; ( E )-&gt;_beta();</span> 
    283 <a name="l00318"></a>00318                                 <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>*= ( sum ( Eb ) /sum ( <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ) ); 
    284 <a name="l00319"></a>00319                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
    285 <a name="l00320"></a>00320                         } 
    286 <a name="l00321"></a>00321                         <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>&amp; posterior()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>;}; 
    287 <a name="l00322"></a>00322                         <span class="keyword">const</span> eDirich* _e()<span class="keyword"> const </span>{<span class="keywordflow">return</span> &amp;<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>;}; 
    288 <a name="l00323"></a>00323                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;beta0 ) 
    289 <a name="l00324"></a>00324                         { 
    290 <a name="l00325"></a>00325                                 <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.set_parameters ( beta0 ); 
    291 <a name="l00326"></a>00326                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.lognc();} 
    292 <a name="l00327"></a>00327                         } 
    293 <a name="l00328"></a>00328         }; 
    294 <a name="l00329"></a>00329  
    295 <a name="l00339"></a><a class="code" href="classbdm_1_1egamma.html">00339</a>         <span class="keyword">class </span><a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> 
    296 <a name="l00340"></a>00340         { 
    297 <a name="l00341"></a>00341                 <span class="keyword">protected</span>: 
    298 <a name="l00343"></a><a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa">00343</a>                         vec <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>; 
    299 <a name="l00345"></a><a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1">00345</a>                         vec <a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1" title="Vector .">beta</a>; 
    300 <a name="l00346"></a>00346                 <span class="keyword">public</span> : 
    301 <a name="l00349"></a>00349                         <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 ) {}; 
    302 <a name="l00350"></a>00350                         <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 );}; 
    303 <a name="l00351"></a>00351                         <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();}; 
    304 <a name="l00353"></a>00353  
    305 <a name="l00354"></a>00354                         vec <a class="code" href="classbdm_1_1egamma.html#6ed82f0fd05f6002487256d8e75a0bbd" title="Returns a sample,  from density .">sample</a>() <span class="keyword">const</span>; 
    306 <a name="l00356"></a>00356 <span class="comment">//      mat sample ( int N ) const;</span> 
    307 <a name="l00357"></a>00357                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1egamma.html#a8e11e5a580ff42a1b205974c60768c6" title="TODO: is it used anywhere?">evallog</a> ( <span class="keyword">const</span> vec &amp;val ) <span class="keyword">const</span>; 
    308 <a name="l00358"></a>00358                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1egamma.html#9a66cbd100e8520c769ccb3c451f86f8" title="logarithm of the normalizing constant, ">lognc</a> () <span class="keyword">const</span>; 
    309 <a name="l00360"></a><a class="code" href="classbdm_1_1egamma.html#0865cb3d6339fdc7410806cf70a329ed">00360</a>                         vec&amp; <a class="code" href="classbdm_1_1egamma.html#0865cb3d6339fdc7410806cf70a329ed" title="Returns poiter to alpha and beta. Potentially dengerous: use with care!">_alpha</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>;} 
    310 <a name="l00361"></a>00361                         vec&amp; _beta() {<span class="keywordflow">return</span> beta;} 
    311 <a name="l00362"></a><a class="code" href="classbdm_1_1egamma.html#49d256c42cce14c6faa56ec242b57e85">00362</a>                         vec <a class="code" href="classbdm_1_1egamma.html#49d256c42cce14c6faa56ec242b57e85" title="return expected value">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> elem_div ( <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>,beta );} 
    312 <a name="l00363"></a><a class="code" href="classbdm_1_1egamma.html#36986cc01917cd0796fadc17125bdec1">00363</a>                         vec <a class="code" href="classbdm_1_1egamma.html#36986cc01917cd0796fadc17125bdec1" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> elem_div ( <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>,elem_mult ( beta,beta ) ); } 
    313 <a name="l00364"></a>00364         }; 
    314 <a name="l00365"></a>00365  
    315 <a name="l00382"></a><a class="code" href="classbdm_1_1eigamma.html">00382</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> 
    316 <a name="l00383"></a>00383         { 
    317 <a name="l00384"></a>00384                 <span class="keyword">protected</span>: 
    318 <a name="l00385"></a>00385                 <span class="keyword">public</span> : 
    319 <a name="l00390"></a>00390  
    320 <a name="l00391"></a><a class="code" href="classbdm_1_1eigamma.html#3aff7bf25ddac27731c60826fcfd878f">00391</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#3aff7bf25ddac27731c60826fcfd878f" title="Returns a sample,  from density .">egamma::sample</a>();}; 
    321 <a name="l00393"></a><a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb">00393</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 );} 
    322 <a name="l00394"></a><a class="code" href="classbdm_1_1eigamma.html#c2c696f8c668e9f65392c9449f6a5133">00394</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 );} 
    323 <a name="l00395"></a>00395         }; 
    324 <a name="l00396"></a>00396         <span class="comment">/*</span> 
    325 <a name="l00398"></a>00398 <span class="comment">        class emix : public epdf {</span> 
    326 <a name="l00399"></a>00399 <span class="comment">        protected:</span> 
    327 <a name="l00400"></a>00400 <span class="comment">                int n;</span> 
    328 <a name="l00401"></a>00401 <span class="comment">                vec &amp;w;</span> 
    329 <a name="l00402"></a>00402 <span class="comment">                Array&lt;epdf*&gt; Coms;</span> 
    330 <a name="l00403"></a>00403 <span class="comment">        public:</span> 
    331 <a name="l00405"></a>00405 <span class="comment">                emix ( const RV &amp;rv, vec &amp;w0): epdf(rv), n(w0.length()), w(w0), Coms(n) {};</span> 
    332 <a name="l00406"></a>00406 <span class="comment">                void set_parameters( int &amp;i, double wi, epdf* ep){w(i)=wi;Coms(i)=ep;}</span> 
    333 <a name="l00407"></a>00407 <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> 
    334 <a name="l00408"></a>00408 <span class="comment">                vec sample() {it_error ( "Not implemented" );return 0;}</span> 
    335 <a name="l00409"></a>00409 <span class="comment">        };</span> 
    336 <a name="l00410"></a>00410 <span class="comment">        */</span> 
    337 <a name="l00411"></a>00411  
    338 <a name="l00413"></a>00413  
    339 <a name="l00414"></a><a class="code" href="classbdm_1_1euni.html">00414</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> 
    340 <a name="l00415"></a>00415         { 
    341 <a name="l00416"></a>00416                 <span class="keyword">protected</span>: 
    342 <a name="l00418"></a><a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32">00418</a>                         vec <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>; 
    343 <a name="l00420"></a><a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1">00420</a>                         vec <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>; 
    344 <a name="l00422"></a><a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c">00422</a>                         vec <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>; 
    345 <a name="l00424"></a><a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20">00424</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>; 
    346 <a name="l00426"></a><a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476">00426</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>; 
    347 <a name="l00427"></a>00427                 <span class="keyword">public</span>: 
    348 <a name="l00430"></a>00430                         <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> ( ) {} 
    349 <a name="l00431"></a>00431                         <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 );} 
    350 <a name="l00432"></a>00432                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;low0, <span class="keyword">const</span> vec &amp;high0 ) 
    351 <a name="l00433"></a>00433                         { 
    352 <a name="l00434"></a>00434                                 <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> = high0-low0; 
    353 <a name="l00435"></a>00435                                 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> ); 
    354 <a name="l00436"></a>00436                                 <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> = low0; 
    355 <a name="l00437"></a>00437                                 <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> = high0; 
    356 <a name="l00438"></a>00438                                 <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> ); 
    357 <a name="l00439"></a>00439                                 <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> ); 
    358 <a name="l00440"></a>00440                                 <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(); 
    359 <a name="l00441"></a>00441                         } 
    360 <a name="l00443"></a>00443  
    361 <a name="l00444"></a>00444                         <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>;} 
    362 <a name="l00445"></a><a class="code" href="classbdm_1_1euni.html#caa07b8307bd793d5339d6583e0aba81">00445</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>;} 
    363 <a name="l00446"></a><a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194">00446</a>                         vec <a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const</span> 
    364 <a name="l00447"></a>00447 <span class="keyword">                        </span>{ 
    365 <a name="l00448"></a>00448                                 vec smp ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
    366 <a name="l00449"></a>00449 <span class="preprocessor">#pragma omp critical</span> 
    367 <a name="l00450"></a>00450 <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 ); 
    368 <a name="l00451"></a>00451                                 <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 ); 
    369 <a name="l00452"></a>00452                         } 
    370 <a name="l00454"></a><a class="code" href="classbdm_1_1euni.html#46caa8c13aba2e6228f964208918b226">00454</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;} 
    371 <a name="l00455"></a><a class="code" href="classbdm_1_1euni.html#951f932155111f6053c980f672b4c22c">00455</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;} 
    372 <a name="l00456"></a>00456         }; 
    373 <a name="l00457"></a>00457  
    374 <a name="l00458"></a>00458  
    375 <a name="l00464"></a>00464         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    376 <a name="l00465"></a><a class="code" href="classbdm_1_1mlnorm.html">00465</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> 
    377 <a name="l00466"></a>00466         { 
    378 <a name="l00467"></a>00467                 <span class="keyword">protected</span>: 
    379 <a name="l00469"></a><a class="code" href="classbdm_1_1mlnorm.html#150ad6acb223b0a0abeaf92346686dcd">00469</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>; 
    380 <a name="l00470"></a>00470                         mat A; 
    381 <a name="l00471"></a>00471                         vec mu_const; 
    382 <a name="l00472"></a>00472                         vec&amp; _mu; <span class="comment">//cached epdf.mu;</span> 
    383 <a name="l00473"></a>00473                 <span class="keyword">public</span>: 
    384 <a name="l00476"></a>00476                         <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>; }; 
    385 <a name="l00477"></a>00477                         <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() ) 
    386 <a name="l00478"></a>00478                         { 
    387 <a name="l00479"></a>00479                                 <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 ); 
    388 <a name="l00480"></a>00480                         }; 
    389 <a name="l00482"></a>00482                         <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 ); 
    390 <a name="l00485"></a>00485                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">condition</a> ( <span class="keyword">const</span> vec &amp;cond ); 
    391 <a name="l00486"></a>00486  
    392 <a name="l00488"></a><a class="code" href="classbdm_1_1mlnorm.html#56e587952f94fcac6cfc999eae6dbced">00488</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;} 
    393 <a name="l00490"></a><a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614">00490</a>                         mat&amp; <a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614" title="access function">_A</a>() {<span class="keywordflow">return</span> A;} 
    394 <a name="l00492"></a><a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604">00492</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();} 
    395 <a name="l00493"></a>00493  
    396 <a name="l00494"></a>00494                         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_M&gt; 
    397 <a name="l00495"></a>00495                         <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_M&gt; &amp;ml ); 
    398 <a name="l00496"></a>00496         }; 
    399 <a name="l00497"></a>00497  
    400 <a name="l00499"></a>00499         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    401 <a name="l00500"></a><a class="code" href="classbdm_1_1mgnorm.html">00500</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> 
    402 <a name="l00501"></a>00501         { 
    403 <a name="l00502"></a>00502                 <span class="keyword">protected</span>: 
    404 <a name="l00504"></a><a class="code" href="classbdm_1_1mgnorm.html#8f7a376a1d2197e0634557e88e03104a">00504</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>; 
    405 <a name="l00505"></a>00505                         vec &amp;mu; 
    406 <a name="l00506"></a>00506                         <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>* g; 
    407 <a name="l00507"></a>00507                 <span class="keyword">public</span>: 
    408 <a name="l00509"></a><a class="code" href="classbdm_1_1mgnorm.html#1b014915d74470d3efab74e07cacb97d">00509</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>;} 
    409 <a name="l00511"></a><a class="code" href="classbdm_1_1mgnorm.html#578e02458e2a0d17f3864826b6ebd564">00511</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 );} 
    410 <a name="l00512"></a><a class="code" href="classbdm_1_1mgnorm.html#b31d63472cf6a1030cd8dbd8094c1f6d">00512</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 );}; 
    411 <a name="l00513"></a>00513         }; 
    412 <a name="l00514"></a>00514  
    413 <a name="l00522"></a><a class="code" href="classbdm_1_1mlstudent.html">00522</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; 
    414 <a name="l00523"></a>00523         { 
    415 <a name="l00524"></a>00524                 <span class="keyword">protected</span>: 
    416 <a name="l00525"></a>00525                         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Lambda; 
    417 <a name="l00526"></a>00526                         <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>; 
    418 <a name="l00527"></a>00527                         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Re; 
    419 <a name="l00528"></a>00528                 <span class="keyword">public</span>: 
    420 <a name="l00529"></a>00529                         <a class="code" href="classbdm_1_1mlstudent.html">mlstudent</a> ( ) :<a class="code" href="classbdm_1_1mlnorm.html">mlnorm&lt;ldmat&gt;</a> (), 
    421 <a name="l00530"></a>00530                                         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() ) {} 
    422 <a name="l00531"></a>00531                         <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 ) 
    423 <a name="l00532"></a>00532                         { 
    424 <a name="l00533"></a>00533                                 it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> ); 
    425 <a name="l00534"></a>00534                                 it_assert_debug ( R0.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ==A0.rows(),<span class="stringliteral">""</span> ); 
    426 <a name="l00535"></a>00535  
    427 <a name="l00536"></a>00536                                 <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> 
    428 <a name="l00537"></a>00537                                 A = A0; 
    429 <a name="l00538"></a>00538                                 mu_const = mu0; 
    430 <a name="l00539"></a>00539                                 Re=R0; 
    431 <a name="l00540"></a>00540                                 Lambda = Lambda0; 
    432 <a name="l00541"></a>00541                         } 
    433 <a name="l00542"></a><a class="code" href="classbdm_1_1mlstudent.html#efd37560585c8613897f30d3c2f58d0d">00542</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 ) 
    434 <a name="l00543"></a>00543                         { 
    435 <a name="l00544"></a>00544                                 _mu = A*cond + mu_const; 
    436 <a name="l00545"></a>00545                                 <span class="keywordtype">double</span> zeta; 
    437 <a name="l00546"></a>00546                                 <span class="comment">//ugly hack!</span> 
    438 <a name="l00547"></a>00547                                 <span class="keywordflow">if</span> ( ( cond.length() +1 ) ==Lambda.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ) 
    439 <a name="l00548"></a>00548                                 { 
    440 <a name="l00549"></a>00549                                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( concat ( cond, vec_1 ( 1.0 ) ) ); 
    441 <a name="l00550"></a>00550                                 } 
    442 <a name="l00551"></a>00551                                 <span class="keywordflow">else</span> 
    443 <a name="l00552"></a>00552                                 { 
    444 <a name="l00553"></a>00553                                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( cond ); 
    445 <a name="l00554"></a>00554                                 } 
    446 <a name="l00555"></a>00555                                 <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a> = Re; 
    447 <a name="l00556"></a>00556                                 <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> 
    448 <a name="l00557"></a>00557                         }; 
    449 <a name="l00558"></a>00558  
    450 <a name="l00559"></a>00559         }; 
    451 <a name="l00569"></a><a class="code" href="classbdm_1_1mgamma.html">00569</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> 
    452 <a name="l00570"></a>00570         { 
    453 <a name="l00571"></a>00571                 <span class="keyword">protected</span>: 
    454 <a name="l00573"></a><a class="code" href="classbdm_1_1mgamma.html#bdc9f1e9e03c09e91103fee269864438">00573</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>; 
    455 <a name="l00575"></a><a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09">00575</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>; 
    456 <a name="l00577"></a><a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312">00577</a>                         vec &amp;<a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>; 
    457 <a name="l00578"></a>00578  
    458 <a name="l00579"></a>00579                 <span class="keyword">public</span>: 
    459 <a name="l00581"></a><a class="code" href="classbdm_1_1mgamma.html#1a9dc8661e5b214a8185d6e6b9956eb1">00581</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>;}; 
    460 <a name="l00583"></a>00583                         <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 ); 
    461 <a name="l00584"></a><a class="code" href="classbdm_1_1mgamma.html#8996500f1885e39cde30221b20900bff">00584</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;}; 
    462 <a name="l00585"></a>00585         }; 
    463 <a name="l00586"></a>00586  
    464 <a name="l00596"></a><a class="code" href="classbdm_1_1migamma.html">00596</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> 
    465 <a name="l00597"></a>00597         { 
    466 <a name="l00598"></a>00598                 <span class="keyword">protected</span>: 
    467 <a name="l00600"></a><a class="code" href="classbdm_1_1migamma.html#a31b39d4179551b593c9e0d7d756783a">00600</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>; 
    468 <a name="l00602"></a><a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c">00602</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>; 
    469 <a name="l00604"></a><a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc">00604</a>                         vec &amp;<a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>; 
    470 <a name="l00606"></a><a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5">00606</a>                         vec &amp;<a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>; 
    471 <a name="l00607"></a>00607  
    472 <a name="l00608"></a>00608                 <span class="keyword">public</span>: 
    473 <a name="l00611"></a>00611                         <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>;}; 
    474 <a name="l00612"></a>00612                         <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>;}; 
    475 <a name="l00614"></a>00614  
    476 <a name="l00616"></a><a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151">00616</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 ) 
    477 <a name="l00617"></a>00617                         { 
    478 <a name="l00618"></a>00618                                 <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>=k0; 
    479 <a name="l00619"></a>00619                                 <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> ); 
    480 <a name="l00620"></a>00620                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension(); 
    481 <a name="l00621"></a>00621                         }; 
    482 <a name="l00622"></a><a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c">00622</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 ) 
    483 <a name="l00623"></a>00623                         { 
    484 <a name="l00624"></a>00624                                 <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 ) ); 
    485 <a name="l00625"></a>00625                         }; 
    486 <a name="l00626"></a>00626         }; 
    487 <a name="l00627"></a>00627  
    488 <a name="l00639"></a><a class="code" href="classbdm_1_1mgamma__fix.html">00639</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> 
    489 <a name="l00640"></a>00640         { 
    490 <a name="l00641"></a>00641                 <span class="keyword">protected</span>: 
    491 <a name="l00643"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa">00643</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>; 
    492 <a name="l00645"></a><a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2">00645</a>                         vec <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>; 
    493 <a name="l00646"></a>00646                 <span class="keyword">public</span>: 
    494 <a name="l00648"></a><a class="code" href="classbdm_1_1mgamma__fix.html#9a31bc9b4b60188a18a2a6b588dc4b2d">00648</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> () {}; 
    495 <a name="l00650"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2">00650</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 ) 
    496 <a name="l00651"></a>00651                         { 
    497 <a name="l00652"></a>00652                                 <a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">mgamma::set_parameters</a> ( k0, ref0 ); 
    498 <a name="l00653"></a>00653                                 <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; 
    499 <a name="l00654"></a>00654                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=dimension(); 
    500 <a name="l00655"></a>00655                         }; 
     210<a name="l00232"></a>00232                 <span class="keyword">public</span>: 
     211<a name="l00235"></a>00235  
     212<a name="l00236"></a>00236                         <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> () : <a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> ( ) {}; 
     213<a name="l00237"></a>00237                         <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> &amp;D0 ) : <a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> () {set_parameters ( D0.<a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a> );}; 
     214<a name="l00238"></a>00238                         eDirich ( <span class="keyword">const</span> vec &amp;beta0 ) {set_parameters ( beta0 );}; 
     215<a name="l00239"></a>00239                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;beta0 ) 
     216<a name="l00240"></a>00240                         { 
     217<a name="l00241"></a>00241                                 <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>= beta0; 
     218<a name="l00242"></a>00242                                 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>.length(); 
     219<a name="l00243"></a>00243                         } 
     220<a name="l00245"></a>00245  
     221<a name="l00246"></a><a class="code" href="classbdm_1_1eDirich.html#3290613d31d58daa8a45a54b003871fc">00246</a>                         vec <a class="code" href="classbdm_1_1eDirich.html#3290613d31d58daa8a45a54b003871fc" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"Not implemented"</span> );<span class="keywordflow">return</span> vec_1 ( 0.0 );}; 
     222<a name="l00247"></a><a class="code" href="classbdm_1_1eDirich.html#cb343355ec791298bb5a3404cd482fb6">00247</a>                         vec <a class="code" href="classbdm_1_1eDirich.html#cb343355ec791298bb5a3404cd482fb6" title="return expected value">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>/sum(<a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>);}; 
     223<a name="l00248"></a><a class="code" href="classbdm_1_1eDirich.html#43c547a2507e233706f92712d8c2aacc">00248</a>                         vec <a class="code" href="classbdm_1_1eDirich.html#43c547a2507e233706f92712d8c2aacc" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{<span class="keywordtype">double</span> gamma =sum(<a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>); <span class="keywordflow">return</span> elem_mult ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>, ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>+1 ) ) / ( gamma* ( gamma+1 ) );} 
     224<a name="l00250"></a><a class="code" href="classbdm_1_1eDirich.html#e09a24938e80c3d94b0ee842d1552318">00250</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eDirich.html#e09a24938e80c3d94b0ee842d1552318" title="In this instance, val is ...">evallog_nn</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const</span> 
     225<a name="l00251"></a>00251 <span class="keyword">                        </span>{ 
     226<a name="l00252"></a>00252                                 <span class="keywordtype">double</span> tmp; tmp= ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>-1 ) *log ( val );               it_assert_debug ( std::isfinite ( tmp ),<span class="stringliteral">"Infinite value"</span> ); 
     227<a name="l00253"></a>00253                                 <span class="keywordflow">return</span> tmp; 
     228<a name="l00254"></a>00254                         }; 
     229<a name="l00255"></a><a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2">00255</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a> ()<span class="keyword"> const</span> 
     230<a name="l00256"></a>00256 <span class="keyword">                        </span>{ 
     231<a name="l00257"></a>00257                                 <span class="keywordtype">double</span> tmp; 
     232<a name="l00258"></a>00258                                 <span class="keywordtype">double</span> gam=sum ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a> ); 
     233<a name="l00259"></a>00259                                 <span class="keywordtype">double</span> lgb=0.0; 
     234<a name="l00260"></a>00260                                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>.length();i++ ) {lgb+=lgamma ( <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a> ( i ) );} 
     235<a name="l00261"></a>00261                                 tmp= lgb-lgamma ( gam ); 
     236<a name="l00262"></a>00262                                 it_assert_debug ( std::isfinite ( tmp ),<span class="stringliteral">"Infinite value"</span> ); 
     237<a name="l00263"></a>00263                                 <span class="keywordflow">return</span> tmp; 
     238<a name="l00264"></a>00264                         }; 
     239<a name="l00266"></a><a class="code" href="classbdm_1_1eDirich.html#175e0add26d2105c28d8121eefb9e324">00266</a>                         vec&amp; <a class="code" href="classbdm_1_1eDirich.html#175e0add26d2105c28d8121eefb9e324" title="access function">_beta</a>()  {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eDirich.html#f25886a49b4667af61245de81c83b5d2" title="sufficient statistics">beta</a>;} 
     240<a name="l00268"></a>00268         }; 
     241<a name="l00269"></a>00269  
     242<a name="l00271"></a><a class="code" href="classbdm_1_1multiBM.html">00271</a>         <span class="keyword">class </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> 
     243<a name="l00272"></a>00272         { 
     244<a name="l00273"></a>00273                 <span class="keyword">protected</span>: 
     245<a name="l00275"></a><a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a">00275</a>                         <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>; 
     246<a name="l00277"></a><a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25">00277</a>                         vec &amp;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>; 
     247<a name="l00278"></a>00278                 <span class="keyword">public</span>: 
     248<a name="l00280"></a><a class="code" href="classbdm_1_1multiBM.html#c4dd6d9522a8a605776d21bac9bd9daf">00280</a>                         <a class="code" href="classbdm_1_1multiBM.html#c4dd6d9522a8a605776d21bac9bd9daf" title="Default constructor.">multiBM</a> ( ) : <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ),<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ( ),<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>._beta() ) 
     249<a name="l00281"></a>00281                         { 
     250<a name="l00282"></a>00282                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>.length() &gt;0 ) {<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
     251<a name="l00283"></a>00283                                 <span class="keywordflow">else</span>{<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=0.0;} 
     252<a name="l00284"></a>00284                         } 
     253<a name="l00286"></a><a class="code" href="classbdm_1_1multiBM.html#c4378cf8037f6bed29c74eea63344b31">00286</a>                         <a class="code" href="classbdm_1_1multiBM.html#c4378cf8037f6bed29c74eea63344b31" title="Copy constructor.">multiBM</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a> &amp;B ) : <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( B ),<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ( B.<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ),<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>._beta() ) {} 
     254<a name="l00288"></a><a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52">00288</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52" title="Sets sufficient statistics to match that of givefrom mB0.">set_statistics</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a>* mB0 ) {<span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>* mB=<span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>*<span class="keyword">&gt;</span> ( mB0 ); <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>=mB-&gt;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>;} 
     255<a name="l00289"></a><a class="code" href="classbdm_1_1multiBM.html#1e4bf41b61937fd80f34049742e23f95">00289</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#1e4bf41b61937fd80f34049742e23f95" title="Incremental Bayes rule.">bayes</a> ( <span class="keyword">const</span> vec &amp;dt ) 
     256<a name="l00290"></a>00290                         { 
     257<a name="l00291"></a>00291                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>&lt;1.0 ) {<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>*=<a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>;<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
     258<a name="l00292"></a>00292                                 <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>+=dt; 
     259<a name="l00293"></a>00293                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {<a class="code" href="classbdm_1_1BM.html#4064b6559d962633e4372b12f4cd204a" title="Logarithm of marginalized data likelihood.">ll</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>()-<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>;} 
     260<a name="l00294"></a>00294                         } 
     261<a name="l00295"></a><a class="code" href="classbdm_1_1multiBM.html#e157b607c1e3fa91d42aeea44458e2bf">00295</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1multiBM.html#e157b607c1e3fa91d42aeea44458e2bf">logpred</a> ( <span class="keyword">const</span> vec &amp;dt )<span class="keyword"> const</span> 
     262<a name="l00296"></a>00296 <span class="keyword">                        </span>{ 
     263<a name="l00297"></a>00297                                 <a class="code" href="classbdm_1_1eDirich.html" title="Dirichlet posterior density.">eDirich</a> pred ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ); 
     264<a name="l00298"></a>00298                                 vec &amp;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> = pred.<a class="code" href="classbdm_1_1eDirich.html#175e0add26d2105c28d8121eefb9e324" title="access function">_beta</a>(); 
     265<a name="l00299"></a>00299  
     266<a name="l00300"></a>00300                                 <span class="keywordtype">double</span> lll; 
     267<a name="l00301"></a>00301                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>&lt;1.0 ) 
     268<a name="l00302"></a>00302                                         {beta*=<a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>;lll=pred.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
     269<a name="l00303"></a>00303                                 <span class="keywordflow">else</span> 
     270<a name="l00304"></a>00304                                         <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {lll=<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>;} 
     271<a name="l00305"></a>00305                                         <span class="keywordflow">else</span>{lll=pred.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
     272<a name="l00306"></a>00306  
     273<a name="l00307"></a>00307                                 beta+=dt; 
     274<a name="l00308"></a>00308                                 <span class="keywordflow">return</span> pred.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>()-lll; 
     275<a name="l00309"></a>00309                         } 
     276<a name="l00310"></a><a class="code" href="classbdm_1_1multiBM.html#aaeb18c989088feb8d26d300e4971732">00310</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#aaeb18c989088feb8d26d300e4971732" title="Flatten the posterior according to the given BMEF (of the same type!).">flatten</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* B ) 
     277<a name="l00311"></a>00311                         { 
     278<a name="l00312"></a>00312                                 <span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>* E=<span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>*<span class="keyword">&gt;</span> ( B ); 
     279<a name="l00313"></a>00313                                 <span class="comment">// sum(beta) should be equal to sum(B.beta)</span> 
     280<a name="l00314"></a>00314                                 <span class="keyword">const</span> vec &amp;Eb=E-&gt;<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>;<span class="comment">//const_cast&lt;multiBM*&gt; ( E )-&gt;_beta();</span> 
     281<a name="l00315"></a>00315                                 <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>*= ( sum ( Eb ) /sum ( <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ) ); 
     282<a name="l00316"></a>00316                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} 
     283<a name="l00317"></a>00317                         } 
     284<a name="l00318"></a>00318                         <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>&amp; posterior()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>;}; 
     285<a name="l00319"></a>00319                         <span class="keyword">const</span> eDirich* _e()<span class="keyword"> const </span>{<span class="keywordflow">return</span> &amp;<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>;}; 
     286<a name="l00320"></a>00320                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;beta0 ) 
     287<a name="l00321"></a>00321                         { 
     288<a name="l00322"></a>00322                                 <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.set_parameters ( beta0 ); 
     289<a name="l00323"></a>00323                                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BM.html#faff0ad12556fe7dc0e2807d4fd938ee" title="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</a> ) {<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.lognc();} 
     290<a name="l00324"></a>00324                         } 
     291<a name="l00325"></a>00325         }; 
     292<a name="l00326"></a>00326  
     293<a name="l00336"></a><a class="code" href="classbdm_1_1egamma.html">00336</a>         <span class="keyword">class </span><a class="code" href="classbdm_1_1egamma.html" title="Gamma posterior density.">egamma</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> 
     294<a name="l00337"></a>00337         { 
     295<a name="l00338"></a>00338                 <span class="keyword">protected</span>: 
     296<a name="l00340"></a><a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa">00340</a>                         vec <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>; 
     297<a name="l00342"></a><a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1">00342</a>                         vec <a class="code" href="classbdm_1_1egamma.html#457bfb1ccb2057df85073e519a15ccc1" title="Vector .">beta</a>; 
     298<a name="l00343"></a>00343                 <span class="keyword">public</span> : 
     299<a name="l00346"></a>00346                         <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 ) {}; 
     300<a name="l00347"></a>00347                         <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 );}; 
     301<a name="l00348"></a>00348                         <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();}; 
     302<a name="l00350"></a>00350  
     303<a name="l00351"></a>00351                         vec <a class="code" href="classbdm_1_1egamma.html#6ed82f0fd05f6002487256d8e75a0bbd" title="Returns a sample,  from density .">sample</a>() <span class="keyword">const</span>; 
     304<a name="l00353"></a>00353 <span class="comment">//      mat sample ( int N ) const;</span> 
     305<a name="l00354"></a>00354                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1egamma.html#a8e11e5a580ff42a1b205974c60768c6" title="TODO: is it used anywhere?">evallog</a> ( <span class="keyword">const</span> vec &amp;val ) <span class="keyword">const</span>; 
     306<a name="l00355"></a>00355                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1egamma.html#9a66cbd100e8520c769ccb3c451f86f8" title="logarithm of the normalizing constant, ">lognc</a> () <span class="keyword">const</span>; 
     307<a name="l00357"></a><a class="code" href="classbdm_1_1egamma.html#0865cb3d6339fdc7410806cf70a329ed">00357</a>                         vec&amp; <a class="code" href="classbdm_1_1egamma.html#0865cb3d6339fdc7410806cf70a329ed" title="Returns poiter to alpha and beta. Potentially dengerous: use with care!">_alpha</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>;} 
     308<a name="l00358"></a>00358                         vec&amp; _beta() {<span class="keywordflow">return</span> beta;} 
     309<a name="l00359"></a><a class="code" href="classbdm_1_1egamma.html#49d256c42cce14c6faa56ec242b57e85">00359</a>                         vec <a class="code" href="classbdm_1_1egamma.html#49d256c42cce14c6faa56ec242b57e85" title="return expected value">mean</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> elem_div ( <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>,beta );} 
     310<a name="l00360"></a><a class="code" href="classbdm_1_1egamma.html#36986cc01917cd0796fadc17125bdec1">00360</a>                         vec <a class="code" href="classbdm_1_1egamma.html#36986cc01917cd0796fadc17125bdec1" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> elem_div ( <a class="code" href="classbdm_1_1egamma.html#0901ec983e66b8337aaa506e13b122fa" title="Vector .">alpha</a>,elem_mult ( beta,beta ) ); } 
     311<a name="l00361"></a>00361         }; 
     312<a name="l00362"></a>00362  
     313<a name="l00379"></a><a class="code" href="classbdm_1_1eigamma.html">00379</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> 
     314<a name="l00380"></a>00380         { 
     315<a name="l00381"></a>00381                 <span class="keyword">protected</span>: 
     316<a name="l00382"></a>00382                 <span class="keyword">public</span> : 
     317<a name="l00387"></a>00387  
     318<a name="l00388"></a><a class="code" href="classbdm_1_1eigamma.html#3aff7bf25ddac27731c60826fcfd878f">00388</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#3aff7bf25ddac27731c60826fcfd878f" title="Returns a sample,  from density .">egamma::sample</a>();}; 
     319<a name="l00390"></a><a class="code" href="classbdm_1_1eigamma.html#46cecb295edbabd28120cb0f6f572bcb">00390</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 );} 
     320<a name="l00391"></a><a class="code" href="classbdm_1_1eigamma.html#c2c696f8c668e9f65392c9449f6a5133">00391</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 );} 
     321<a name="l00392"></a>00392         }; 
     322<a name="l00393"></a>00393         <span class="comment">/*</span> 
     323<a name="l00395"></a>00395 <span class="comment">        class emix : public epdf {</span> 
     324<a name="l00396"></a>00396 <span class="comment">        protected:</span> 
     325<a name="l00397"></a>00397 <span class="comment">                int n;</span> 
     326<a name="l00398"></a>00398 <span class="comment">                vec &amp;w;</span> 
     327<a name="l00399"></a>00399 <span class="comment">                Array&lt;epdf*&gt; Coms;</span> 
     328<a name="l00400"></a>00400 <span class="comment">        public:</span> 
     329<a name="l00402"></a>00402 <span class="comment">                emix ( const RV &amp;rv, vec &amp;w0): epdf(rv), n(w0.length()), w(w0), Coms(n) {};</span> 
     330<a name="l00403"></a>00403 <span class="comment">                void set_parameters( int &amp;i, double wi, epdf* ep){w(i)=wi;Coms(i)=ep;}</span> 
     331<a name="l00404"></a>00404 <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> 
     332<a name="l00405"></a>00405 <span class="comment">                vec sample() {it_error ( "Not implemented" );return 0;}</span> 
     333<a name="l00406"></a>00406 <span class="comment">        };</span> 
     334<a name="l00407"></a>00407 <span class="comment">        */</span> 
     335<a name="l00408"></a>00408  
     336<a name="l00410"></a>00410  
     337<a name="l00411"></a><a class="code" href="classbdm_1_1euni.html">00411</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> 
     338<a name="l00412"></a>00412         { 
     339<a name="l00413"></a>00413                 <span class="keyword">protected</span>: 
     340<a name="l00415"></a><a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32">00415</a>                         vec <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>; 
     341<a name="l00417"></a><a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1">00417</a>                         vec <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>; 
     342<a name="l00419"></a><a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c">00419</a>                         vec <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a>; 
     343<a name="l00421"></a><a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20">00421</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#31bb13e8449a8eff35246d46dae35c20" title="normalizing coefficients">nk</a>; 
     344<a name="l00423"></a><a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476">00423</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>; 
     345<a name="l00424"></a>00424                 <span class="keyword">public</span>: 
     346<a name="l00427"></a>00427                         <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> ( ) {} 
     347<a name="l00428"></a>00428                         <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 );} 
     348<a name="l00429"></a>00429                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> vec &amp;low0, <span class="keyword">const</span> vec &amp;high0 ) 
     349<a name="l00430"></a>00430                         { 
     350<a name="l00431"></a>00431                                 <a class="code" href="classbdm_1_1euni.html#d3c27e331f90c754d80228108de8ed4c" title="internal">distance</a> = high0-low0; 
     351<a name="l00432"></a>00432                                 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> ); 
     352<a name="l00433"></a>00433                                 <a class="code" href="classbdm_1_1euni.html#ff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a> = low0; 
     353<a name="l00434"></a>00434                                 <a class="code" href="classbdm_1_1euni.html#cfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a> = high0; 
     354<a name="l00435"></a>00435                                 <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> ); 
     355<a name="l00436"></a>00436                                 <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> ); 
     356<a name="l00437"></a>00437                                 <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(); 
     357<a name="l00438"></a>00438                         } 
     358<a name="l00440"></a>00440  
     359<a name="l00441"></a>00441                         <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>;} 
     360<a name="l00442"></a><a class="code" href="classbdm_1_1euni.html#caa07b8307bd793d5339d6583e0aba81">00442</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>;} 
     361<a name="l00443"></a><a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194">00443</a>                         vec <a class="code" href="classbdm_1_1euni.html#fc5df80359ead2918384b2004ce67194" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const</span> 
     362<a name="l00444"></a>00444 <span class="keyword">                        </span>{ 
     363<a name="l00445"></a>00445                                 vec smp ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
     364<a name="l00446"></a>00446 <span class="preprocessor">#pragma omp critical</span> 
     365<a name="l00447"></a>00447 <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 ); 
     366<a name="l00448"></a>00448                                 <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 ); 
     367<a name="l00449"></a>00449                         } 
     368<a name="l00451"></a><a class="code" href="classbdm_1_1euni.html#46caa8c13aba2e6228f964208918b226">00451</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;} 
     369<a name="l00452"></a><a class="code" href="classbdm_1_1euni.html#951f932155111f6053c980f672b4c22c">00452</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;} 
     370<a name="l00453"></a>00453         }; 
     371<a name="l00454"></a>00454  
     372<a name="l00455"></a>00455  
     373<a name="l00461"></a>00461         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     374<a name="l00462"></a><a class="code" href="classbdm_1_1mlnorm.html">00462</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> 
     375<a name="l00463"></a>00463         { 
     376<a name="l00464"></a>00464                 <span class="keyword">protected</span>: 
     377<a name="l00466"></a><a class="code" href="classbdm_1_1mlnorm.html#150ad6acb223b0a0abeaf92346686dcd">00466</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>; 
     378<a name="l00467"></a>00467                         mat A; 
     379<a name="l00468"></a>00468                         vec mu_const; 
     380<a name="l00469"></a>00469                         vec&amp; _mu; <span class="comment">//cached epdf.mu;</span> 
     381<a name="l00470"></a>00470                 <span class="keyword">public</span>: 
     382<a name="l00473"></a>00473                         <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>; }; 
     383<a name="l00474"></a>00474                         <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() ) 
     384<a name="l00475"></a>00475                         { 
     385<a name="l00476"></a>00476                                 <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 ); 
     386<a name="l00477"></a>00477                         }; 
     387<a name="l00479"></a>00479                         <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 ); 
     388<a name="l00482"></a>00482                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">condition</a> ( <span class="keyword">const</span> vec &amp;cond ); 
     389<a name="l00483"></a>00483  
     390<a name="l00485"></a><a class="code" href="classbdm_1_1mlnorm.html#56e587952f94fcac6cfc999eae6dbced">00485</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;} 
     391<a name="l00487"></a><a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614">00487</a>                         mat&amp; <a class="code" href="classbdm_1_1mlnorm.html#262a2a486bff585f34bb6a5005b02614" title="access function">_A</a>() {<span class="keywordflow">return</span> A;} 
     392<a name="l00489"></a><a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604">00489</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();} 
     393<a name="l00490"></a>00490  
     394<a name="l00491"></a>00491                         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_M&gt; 
     395<a name="l00492"></a>00492                         <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_M&gt; &amp;ml ); 
     396<a name="l00493"></a>00493         }; 
     397<a name="l00494"></a>00494  
     398<a name="l00496"></a>00496         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     399<a name="l00497"></a><a class="code" href="classbdm_1_1mgnorm.html">00497</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> 
     400<a name="l00498"></a>00498         { 
     401<a name="l00499"></a>00499                 <span class="keyword">protected</span>: 
     402<a name="l00501"></a><a class="code" href="classbdm_1_1mgnorm.html#8f7a376a1d2197e0634557e88e03104a">00501</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>; 
     403<a name="l00502"></a>00502                         vec &amp;mu; 
     404<a name="l00503"></a>00503                         <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>* g; 
     405<a name="l00504"></a>00504                 <span class="keyword">public</span>: 
     406<a name="l00506"></a><a class="code" href="classbdm_1_1mgnorm.html#1b014915d74470d3efab74e07cacb97d">00506</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>;} 
     407<a name="l00508"></a><a class="code" href="classbdm_1_1mgnorm.html#578e02458e2a0d17f3864826b6ebd564">00508</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 );} 
     408<a name="l00509"></a><a class="code" href="classbdm_1_1mgnorm.html#b31d63472cf6a1030cd8dbd8094c1f6d">00509</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 );}; 
     409<a name="l00510"></a>00510         }; 
     410<a name="l00511"></a>00511  
     411<a name="l00519"></a><a class="code" href="classbdm_1_1mlstudent.html">00519</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; 
     412<a name="l00520"></a>00520         { 
     413<a name="l00521"></a>00521                 <span class="keyword">protected</span>: 
     414<a name="l00522"></a>00522                         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Lambda; 
     415<a name="l00523"></a>00523                         <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>; 
     416<a name="l00524"></a>00524                         <a class="code" href="classldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> Re; 
     417<a name="l00525"></a>00525                 <span class="keyword">public</span>: 
     418<a name="l00526"></a>00526                         <a class="code" href="classbdm_1_1mlstudent.html">mlstudent</a> ( ) :<a class="code" href="classbdm_1_1mlnorm.html">mlnorm&lt;ldmat&gt;</a> (), 
     419<a name="l00527"></a>00527                                         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() ) {} 
     420<a name="l00528"></a>00528                         <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 ) 
     421<a name="l00529"></a>00529                         { 
     422<a name="l00530"></a>00530                                 it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> ); 
     423<a name="l00531"></a>00531                                 it_assert_debug ( R0.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ==A0.rows(),<span class="stringliteral">""</span> ); 
     424<a name="l00532"></a>00532  
     425<a name="l00533"></a>00533                                 <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> 
     426<a name="l00534"></a>00534                                 A = A0; 
     427<a name="l00535"></a>00535                                 mu_const = mu0; 
     428<a name="l00536"></a>00536                                 Re=R0; 
     429<a name="l00537"></a>00537                                 Lambda = Lambda0; 
     430<a name="l00538"></a>00538                         } 
     431<a name="l00539"></a><a class="code" href="classbdm_1_1mlstudent.html#efd37560585c8613897f30d3c2f58d0d">00539</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 ) 
     432<a name="l00540"></a>00540                         { 
     433<a name="l00541"></a>00541                                 _mu = A*cond + mu_const; 
     434<a name="l00542"></a>00542                                 <span class="keywordtype">double</span> zeta; 
     435<a name="l00543"></a>00543                                 <span class="comment">//ugly hack!</span> 
     436<a name="l00544"></a>00544                                 <span class="keywordflow">if</span> ( ( cond.length() +1 ) ==Lambda.<a class="code" href="group__math.html#g96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() ) 
     437<a name="l00545"></a>00545                                 { 
     438<a name="l00546"></a>00546                                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( concat ( cond, vec_1 ( 1.0 ) ) ); 
     439<a name="l00547"></a>00547                                 } 
     440<a name="l00548"></a>00548                                 <span class="keywordflow">else</span> 
     441<a name="l00549"></a>00549                                 { 
     442<a name="l00550"></a>00550                                         zeta = Lambda.<a class="code" href="classldmat.html#d876c5f83e02b3e809b35c9de5068f14" title="Evaluates quadratic form ;.">invqform</a> ( cond ); 
     443<a name="l00551"></a>00551                                 } 
     444<a name="l00552"></a>00552                                 <a class="code" href="classbdm_1_1mlnorm.html#78120ecd1c2b1d7e80124b4603504604" title="access function">_R</a> = Re; 
     445<a name="l00553"></a>00553                                 <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> 
     446<a name="l00554"></a>00554                         }; 
     447<a name="l00555"></a>00555  
     448<a name="l00556"></a>00556         }; 
     449<a name="l00566"></a><a class="code" href="classbdm_1_1mgamma.html">00566</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> 
     450<a name="l00567"></a>00567         { 
     451<a name="l00568"></a>00568                 <span class="keyword">protected</span>: 
     452<a name="l00570"></a><a class="code" href="classbdm_1_1mgamma.html#bdc9f1e9e03c09e91103fee269864438">00570</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>; 
     453<a name="l00572"></a><a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09">00572</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>; 
     454<a name="l00574"></a><a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312">00574</a>                         vec &amp;<a class="code" href="classbdm_1_1mgamma.html#3d95f4dde9214ff6dba265e18af60312" title="cache of epdf.beta">_beta</a>; 
     455<a name="l00575"></a>00575  
     456<a name="l00576"></a>00576                 <span class="keyword">public</span>: 
     457<a name="l00578"></a><a class="code" href="classbdm_1_1mgamma.html#1a9dc8661e5b214a8185d6e6b9956eb1">00578</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>;}; 
     458<a name="l00580"></a>00580                         <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 ); 
     459<a name="l00581"></a><a class="code" href="classbdm_1_1mgamma.html#8996500f1885e39cde30221b20900bff">00581</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;}; 
     460<a name="l00582"></a>00582         }; 
     461<a name="l00583"></a>00583  
     462<a name="l00593"></a><a class="code" href="classbdm_1_1migamma.html">00593</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> 
     463<a name="l00594"></a>00594         { 
     464<a name="l00595"></a>00595                 <span class="keyword">protected</span>: 
     465<a name="l00597"></a><a class="code" href="classbdm_1_1migamma.html#a31b39d4179551b593c9e0d7d756783a">00597</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>; 
     466<a name="l00599"></a><a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c">00599</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>; 
     467<a name="l00601"></a><a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc">00601</a>                         vec &amp;<a class="code" href="classbdm_1_1migamma.html#c9847093da59a9ba0ebb68d2c592f5dc" title="cache of epdf.alpha">_alpha</a>; 
     468<a name="l00603"></a><a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5">00603</a>                         vec &amp;<a class="code" href="classbdm_1_1migamma.html#0d854c047001b5465cf1ba21f52904b5" title="cache of epdf.beta">_beta</a>; 
     469<a name="l00604"></a>00604  
     470<a name="l00605"></a>00605                 <span class="keyword">public</span>: 
     471<a name="l00608"></a>00608                         <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>;}; 
     472<a name="l00609"></a>00609                         <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>;}; 
     473<a name="l00611"></a>00611  
     474<a name="l00613"></a><a class="code" href="classbdm_1_1migamma.html#8b10ab922e2a7bae2fb6bb3efc7b6151">00613</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 ) 
     475<a name="l00614"></a>00614                         { 
     476<a name="l00615"></a>00615                                 <a class="code" href="classbdm_1_1migamma.html#dc56bc9da542e0103ec16b9be8e5e38c" title="Constant .">k</a>=k0; 
     477<a name="l00616"></a>00616                                 <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> ); 
     478<a name="l00617"></a>00617                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension(); 
     479<a name="l00618"></a>00618                         }; 
     480<a name="l00619"></a><a class="code" href="classbdm_1_1migamma.html#7a34b1e2e3aa2250d7c0ed7df1665b8c">00619</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 ) 
     481<a name="l00620"></a>00620                         { 
     482<a name="l00621"></a>00621                                 <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 ) ); 
     483<a name="l00622"></a>00622                         }; 
     484<a name="l00623"></a>00623         }; 
     485<a name="l00624"></a>00624  
     486<a name="l00636"></a><a class="code" href="classbdm_1_1mgamma__fix.html">00636</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> 
     487<a name="l00637"></a>00637         { 
     488<a name="l00638"></a>00638                 <span class="keyword">protected</span>: 
     489<a name="l00640"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa">00640</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma__fix.html#1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>; 
     490<a name="l00642"></a><a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2">00642</a>                         vec <a class="code" href="classbdm_1_1mgamma__fix.html#018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>; 
     491<a name="l00643"></a>00643                 <span class="keyword">public</span>: 
     492<a name="l00645"></a><a class="code" href="classbdm_1_1mgamma__fix.html#9a31bc9b4b60188a18a2a6b588dc4b2d">00645</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> () {}; 
     493<a name="l00647"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2">00647</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 ) 
     494<a name="l00648"></a>00648                         { 
     495<a name="l00649"></a>00649                                 <a class="code" href="classbdm_1_1mgamma__fix.html#1bfd30e90db9dc1fbda4a9fbb0b716b2" title="Set value of k.">mgamma::set_parameters</a> ( k0, ref0 ); 
     496<a name="l00650"></a>00650                                 <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; 
     497<a name="l00651"></a>00651                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=dimension(); 
     498<a name="l00652"></a>00652                         }; 
     499<a name="l00653"></a>00653  
     500<a name="l00654"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1d539591deb7a38bb3403c2b396c8ff7">00654</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;}; 
     501<a name="l00655"></a>00655         }; 
    501502<a name="l00656"></a>00656  
    502 <a name="l00657"></a><a class="code" href="classbdm_1_1mgamma__fix.html#1d539591deb7a38bb3403c2b396c8ff7">00657</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;}; 
    503 <a name="l00658"></a>00658         }; 
    504 <a name="l00659"></a>00659  
    505 <a name="l00660"></a>00660  
    506 <a name="l00673"></a><a class="code" href="classbdm_1_1migamma__ref.html">00673</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> 
    507 <a name="l00674"></a>00674         { 
    508 <a name="l00675"></a>00675                 <span class="keyword">protected</span>: 
    509 <a name="l00677"></a><a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d">00677</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>; 
    510 <a name="l00679"></a><a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6">00679</a>                         vec <a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>; 
    511 <a name="l00680"></a>00680                 <span class="keyword">public</span>: 
    512 <a name="l00682"></a><a class="code" href="classbdm_1_1migamma__ref.html#f45b15a10f084991ba6b48295f10421f">00682</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> ( ) {}; 
    513 <a name="l00684"></a><a class="code" href="classbdm_1_1migamma__ref.html#b0b4eb278ef5d0831ec4954ba7bd2800">00684</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 ) 
    514 <a name="l00685"></a>00685                         { 
    515 <a name="l00686"></a>00686                                 <a class="code" href="classbdm_1_1migamma__ref.html#b0b4eb278ef5d0831ec4954ba7bd2800" title="Set value of k.">migamma::set_parameters</a> ( ref0.length(), k0 ); 
    516 <a name="l00687"></a>00687                                 <a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>=pow ( ref0,1.0-l0 ); 
    517 <a name="l00688"></a>00688                                 <a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>=l0; 
    518 <a name="l00689"></a>00689                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension(); 
    519 <a name="l00690"></a>00690                         }; 
    520 <a name="l00691"></a>00691  
    521 <a name="l00692"></a><a class="code" href="classbdm_1_1migamma__ref.html#ae86b2e4ff963d62e05d4e130514634a">00692</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 ) 
    522 <a name="l00693"></a>00693                         { 
    523 <a name="l00694"></a>00694                                 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> ) ); 
    524 <a name="l00695"></a>00695                                 <a class="code" href="classbdm_1_1migamma__ref.html#ae86b2e4ff963d62e05d4e130514634a" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">migamma::condition</a> ( mean ); 
    525 <a name="l00696"></a>00696                         }; 
    526 <a name="l00697"></a>00697         }; 
    527 <a name="l00698"></a>00698  
    528 <a name="l00708"></a><a class="code" href="classbdm_1_1elognorm.html">00708</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; 
    529 <a name="l00709"></a>00709         { 
    530 <a name="l00710"></a>00710                 <span class="keyword">public</span>: 
    531 <a name="l00711"></a><a class="code" href="classbdm_1_1elognorm.html#8b948e2bce1253765a2542199913aaba">00711</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>() );}; 
    532 <a name="l00712"></a><a class="code" href="classbdm_1_1elognorm.html#adb41e4f4d6600dec6f8c1dbc5ed9eea">00712</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#729c75ef0fa8abae03d58ad1f81e6773" title="return expected variance (not covariance!)">enorm&lt;ldmat&gt;::variance</a>();<span class="keywordflow">return</span> exp ( <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> - 0.5*var );}; 
    533 <a name="l00713"></a>00713  
    534 <a name="l00714"></a>00714         }; 
    535 <a name="l00715"></a>00715  
    536 <a name="l00727"></a><a class="code" href="classbdm_1_1mlognorm.html">00727</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> 
    537 <a name="l00728"></a>00728         { 
    538 <a name="l00729"></a>00729                 <span class="keyword">protected</span>: 
    539 <a name="l00730"></a>00730                         <a class="code" href="classbdm_1_1elognorm.html">elognorm</a> eno; 
    540 <a name="l00732"></a><a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a">00732</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>; 
    541 <a name="l00734"></a><a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2">00734</a>                         vec &amp;<a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a>; 
    542 <a name="l00735"></a>00735                 <span class="keyword">public</span>: 
    543 <a name="l00737"></a><a class="code" href="classbdm_1_1mlognorm.html#a5d6eb2688d02e0348b96c4fbd7bde41">00737</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;}; 
    544 <a name="l00739"></a><a class="code" href="classbdm_1_1mlognorm.html#604cab0e8a76f9041dc3c606043bb39f">00739</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 ) 
    545 <a name="l00740"></a>00740                         { 
    546 <a name="l00741"></a>00741                                 <a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a> = 0.5*log ( k*k+1 ); 
    547 <a name="l00742"></a>00742                                 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 ) ); 
     503<a name="l00657"></a>00657  
     504<a name="l00670"></a><a class="code" href="classbdm_1_1migamma__ref.html">00670</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> 
     505<a name="l00671"></a>00671         { 
     506<a name="l00672"></a>00672                 <span class="keyword">protected</span>: 
     507<a name="l00674"></a><a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d">00674</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>; 
     508<a name="l00676"></a><a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6">00676</a>                         vec <a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>; 
     509<a name="l00677"></a>00677                 <span class="keyword">public</span>: 
     510<a name="l00679"></a><a class="code" href="classbdm_1_1migamma__ref.html#f45b15a10f084991ba6b48295f10421f">00679</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> ( ) {}; 
     511<a name="l00681"></a><a class="code" href="classbdm_1_1migamma__ref.html#b0b4eb278ef5d0831ec4954ba7bd2800">00681</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 ) 
     512<a name="l00682"></a>00682                         { 
     513<a name="l00683"></a>00683                                 <a class="code" href="classbdm_1_1migamma__ref.html#b0b4eb278ef5d0831ec4954ba7bd2800" title="Set value of k.">migamma::set_parameters</a> ( ref0.length(), k0 ); 
     514<a name="l00684"></a>00684                                 <a class="code" href="classbdm_1_1migamma__ref.html#3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>=pow ( ref0,1.0-l0 ); 
     515<a name="l00685"></a>00685                                 <a class="code" href="classbdm_1_1migamma__ref.html#cdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>=l0; 
     516<a name="l00686"></a>00686                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension(); 
     517<a name="l00687"></a>00687                         }; 
     518<a name="l00688"></a>00688  
     519<a name="l00689"></a><a class="code" href="classbdm_1_1migamma__ref.html#ae86b2e4ff963d62e05d4e130514634a">00689</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 ) 
     520<a name="l00690"></a>00690                         { 
     521<a name="l00691"></a>00691                                 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> ) ); 
     522<a name="l00692"></a>00692                                 <a class="code" href="classbdm_1_1migamma__ref.html#ae86b2e4ff963d62e05d4e130514634a" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">migamma::condition</a> ( mean ); 
     523<a name="l00693"></a>00693                         }; 
     524<a name="l00694"></a>00694         }; 
     525<a name="l00695"></a>00695  
     526<a name="l00705"></a><a class="code" href="classbdm_1_1elognorm.html">00705</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; 
     527<a name="l00706"></a>00706         { 
     528<a name="l00707"></a>00707                 <span class="keyword">public</span>: 
     529<a name="l00708"></a><a class="code" href="classbdm_1_1elognorm.html#8b948e2bce1253765a2542199913aaba">00708</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>() );}; 
     530<a name="l00709"></a><a class="code" href="classbdm_1_1elognorm.html#adb41e4f4d6600dec6f8c1dbc5ed9eea">00709</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#729c75ef0fa8abae03d58ad1f81e6773" title="return expected variance (not covariance!)">enorm&lt;ldmat&gt;::variance</a>();<span class="keywordflow">return</span> exp ( <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> - 0.5*var );}; 
     531<a name="l00710"></a>00710  
     532<a name="l00711"></a>00711         }; 
     533<a name="l00712"></a>00712  
     534<a name="l00724"></a><a class="code" href="classbdm_1_1mlognorm.html">00724</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> 
     535<a name="l00725"></a>00725         { 
     536<a name="l00726"></a>00726                 <span class="keyword">protected</span>: 
     537<a name="l00727"></a>00727                         <a class="code" href="classbdm_1_1elognorm.html">elognorm</a> eno; 
     538<a name="l00729"></a><a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a">00729</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>; 
     539<a name="l00731"></a><a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2">00731</a>                         vec &amp;<a class="code" href="classbdm_1_1mlognorm.html#7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a>; 
     540<a name="l00732"></a>00732                 <span class="keyword">public</span>: 
     541<a name="l00734"></a><a class="code" href="classbdm_1_1mlognorm.html#a5d6eb2688d02e0348b96c4fbd7bde41">00734</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;}; 
     542<a name="l00736"></a><a class="code" href="classbdm_1_1mlognorm.html#604cab0e8a76f9041dc3c606043bb39f">00736</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 ) 
     543<a name="l00737"></a>00737                         { 
     544<a name="l00738"></a>00738                                 <a class="code" href="classbdm_1_1mlognorm.html#a51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a> = 0.5*log ( k*k+1 ); 
     545<a name="l00739"></a>00739                                 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 ) ); 
     546<a name="l00740"></a>00740  
     547<a name="l00741"></a>00741                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = size; 
     548<a name="l00742"></a>00742                         }; 
    548549<a name="l00743"></a>00743  
    549 <a name="l00744"></a>00744                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = size; 
    550 <a name="l00745"></a>00745                         }; 
    551 <a name="l00746"></a>00746  
    552 <a name="l00747"></a><a class="code" href="classbdm_1_1mlognorm.html#9106d8fd8bdf2b6be675ffd8f3ca584e">00747</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 ) 
    553 <a name="l00748"></a>00748                         { 
    554 <a name="l00749"></a>00749                                 <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> 
    555 <a name="l00750"></a>00750                         }; 
    556 <a name="l00751"></a>00751         }; 
    557 <a name="l00752"></a>00752  
    558 <a name="l00756"></a><a class="code" href="classbdm_1_1eWishartCh.html">00756</a>         <span class="keyword">class </span><a class="code" href="classbdm_1_1eWishartCh.html">eWishartCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> 
    559 <a name="l00757"></a>00757         { 
    560 <a name="l00758"></a>00758                 <span class="keyword">protected</span>: 
    561 <a name="l00760"></a><a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490">00760</a>                         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>; 
    562 <a name="l00762"></a><a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f">00762</a>                         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>; 
    563 <a name="l00764"></a><a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3">00764</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>; 
    564 <a name="l00765"></a>00765                 <span class="keyword">public</span>: 
    565 <a name="l00766"></a>00766                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0 ) {<a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>=<a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> ( Y0 );<a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>=delta0; <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>=<a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>(); <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>*<a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>; } 
    566 <a name="l00767"></a>00767                         mat sample_mat()<span class="keyword"> const</span> 
    567 <a name="l00768"></a>00768 <span class="keyword">                        </span>{ 
    568 <a name="l00769"></a>00769                                 mat X=zeros ( <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>,<a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a> ); 
    569 <a name="l00770"></a>00770  
    570 <a name="l00771"></a>00771                                 <span class="comment">//sample diagonal</span> 
    571 <a name="l00772"></a>00772                                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>;i++ ) 
    572 <a name="l00773"></a>00773                                 { 
    573 <a name="l00774"></a>00774                                         GamRNG.<a class="code" href="classitpp_1_1Gamma__RNG.html#dfaae19411e39aa87e1f72e409b6babe" title="Set lambda.">setup</a> ( 0.5* ( <a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>-i ) , 0.5 ); <span class="comment">// no +1 !! index if from 0</span> 
    574 <a name="l00775"></a>00775 <span class="preprocessor">#pragma omp critical</span> 
    575 <a name="l00776"></a>00776 <span class="preprocessor"></span>                                        X ( i,i ) =sqrt ( GamRNG() ); 
    576 <a name="l00777"></a>00777                                 } 
    577 <a name="l00778"></a>00778                                 <span class="comment">//do the rest</span> 
    578 <a name="l00779"></a>00779                                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;p;i++ ) 
    579 <a name="l00780"></a>00780                                 { 
    580 <a name="l00781"></a>00781                                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j=i+1;j&lt;p;j++ ) 
    581 <a name="l00782"></a>00782                                         { 
    582 <a name="l00783"></a>00783 <span class="preprocessor">#pragma omp critical</span> 
    583 <a name="l00784"></a>00784 <span class="preprocessor"></span>                                                X ( i,j ) =NorRNG.sample(); 
    584 <a name="l00785"></a>00785                                         } 
    585 <a name="l00786"></a>00786                                 } 
    586 <a name="l00787"></a>00787                                 <span class="keywordflow">return</span> X*<a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>();<span class="comment">// return upper triangular part of the decomposition</span> 
    587 <a name="l00788"></a>00788                         } 
    588 <a name="l00789"></a><a class="code" href="classbdm_1_1eWishartCh.html#8f2154b8b5be8f4c5788f261b6d57b9a">00789</a>                         vec <a class="code" href="classbdm_1_1eWishartCh.html#8f2154b8b5be8f4c5788f261b6d57b9a" title="Returns a sample,  from density .">sample</a> ()<span class="keyword"> const</span> 
    589 <a name="l00790"></a>00790 <span class="keyword">                        </span>{ 
    590 <a name="l00791"></a>00791                                 <span class="keywordflow">return</span> vec ( sample_mat()._data(),p*p ); 
    591 <a name="l00792"></a>00792                         } 
    592 <a name="l00794"></a><a class="code" href="classbdm_1_1eWishartCh.html#4eee757c0535c2a88bb20f0767c64981">00794</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#4eee757c0535c2a88bb20f0767c64981" title="fast access function y0 will be copied into Y.Ch.">setY</a> ( <span class="keyword">const</span> mat &amp;Ch0 ) {copy_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,Ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>()._data() );} 
    593 <a name="l00796"></a><a class="code" href="classbdm_1_1eWishartCh.html#7eac414ec10b85aa5536b0092c57bc4a">00796</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#7eac414ec10b85aa5536b0092c57bc4a" title="fast access function y0 will be copied into Y.Ch.">_setY</a> ( <span class="keyword">const</span> vec &amp;ch0 ) {copy_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>()._data() ); } 
    594 <a name="l00798"></a><a class="code" href="classbdm_1_1eWishartCh.html#1708cacb5d8cb1b96395d35f5327cb7e">00798</a>                         <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classbdm_1_1eWishartCh.html#1708cacb5d8cb1b96395d35f5327cb7e" title="access function">getY</a>()<span class="keyword">const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>;} 
    595 <a name="l00799"></a>00799         }; 
    596 <a name="l00800"></a>00800  
    597 <a name="l00801"></a>00801         <span class="keyword">class </span>eiWishartCh: <span class="keyword">public</span> epdf 
    598 <a name="l00802"></a>00802         { 
    599 <a name="l00803"></a>00803                 <span class="keyword">protected</span>: 
    600 <a name="l00804"></a>00804                         eWishartCh W; 
    601 <a name="l00805"></a>00805                         <span class="keywordtype">int</span> p; 
    602 <a name="l00806"></a>00806                         <span class="keywordtype">double</span> delta; 
    603 <a name="l00807"></a>00807                 <span class="keyword">public</span>: 
    604 <a name="l00808"></a>00808                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0) { 
    605 <a name="l00809"></a>00809                                 delta = delta0; 
    606 <a name="l00810"></a>00810                                 W.set_parameters ( inv ( Y0 ),delta0 );  
    607 <a name="l00811"></a>00811                                 dim = W.dimension(); p=Y0.rows(); 
    608 <a name="l00812"></a>00812                         } 
    609 <a name="l00813"></a>00813                         vec sample()<span class="keyword"> const </span>{mat iCh; iCh=inv ( W.sample_mat() ); <span class="keywordflow">return</span> vec ( iCh._data(),<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );} 
    610 <a name="l00814"></a>00814                         <span class="keywordtype">void</span> _setY ( <span class="keyword">const</span> vec &amp;y0 ) 
    611 <a name="l00815"></a>00815                         { 
    612 <a name="l00816"></a>00816                                 mat Ch ( p,p ); 
    613 <a name="l00817"></a>00817                                 mat iCh ( p,p ); 
    614 <a name="l00818"></a>00818                                 copy_vector ( dim, y0._data(), Ch._data() ); 
    615 <a name="l00819"></a>00819                                  
    616 <a name="l00820"></a>00820                                 iCh=inv ( Ch ); 
    617 <a name="l00821"></a>00821                                 W.setY ( iCh ); 
    618 <a name="l00822"></a>00822                         } 
    619 <a name="l00823"></a>00823                         <span class="keyword">virtual</span> <span class="keywordtype">double</span> evallog ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{ 
    620 <a name="l00824"></a>00824                                 <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> X(p); 
    621 <a name="l00825"></a>00825                                 <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; Y=W.getY(); 
    622 <a name="l00826"></a>00826                                   
    623 <a name="l00827"></a>00827                                 copy_vector(p*p,val._data(),X._Ch()._data()); 
    624 <a name="l00828"></a>00828                                 <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> iX(p);X.inv(iX); 
    625 <a name="l00829"></a>00829                                 <span class="comment">// compute  </span> 
    626 <a name="l00830"></a>00830 <span class="comment">//                              \frac{ |\Psi|^{m/2}|X|^{-(m+p+1)/2}e^{-tr(\Psi X^{-1})/2} }{ 2^{mp/2}\Gamma_p(m/2)},</span> 
    627 <a name="l00831"></a>00831                                 mat M=Y.<a class="code" href="classchmat.html#045addd685f8d978efda232d7dcb070e" title="Conversion to full matrix.">to_mat</a>()*iX.to_mat(); 
     550<a name="l00744"></a><a class="code" href="classbdm_1_1mlognorm.html#9106d8fd8bdf2b6be675ffd8f3ca584e">00744</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 ) 
     551<a name="l00745"></a>00745                         { 
     552<a name="l00746"></a>00746                                 <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> 
     553<a name="l00747"></a>00747                         }; 
     554<a name="l00748"></a>00748         }; 
     555<a name="l00749"></a>00749  
     556<a name="l00753"></a><a class="code" href="classbdm_1_1eWishartCh.html">00753</a>         <span class="keyword">class </span><a class="code" href="classbdm_1_1eWishartCh.html">eWishartCh</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> 
     557<a name="l00754"></a>00754         { 
     558<a name="l00755"></a>00755                 <span class="keyword">protected</span>: 
     559<a name="l00757"></a><a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490">00757</a>                         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>; 
     560<a name="l00759"></a><a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f">00759</a>                         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>; 
     561<a name="l00761"></a><a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3">00761</a>                         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>; 
     562<a name="l00762"></a>00762                 <span class="keyword">public</span>: 
     563<a name="l00763"></a>00763                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0 ) {<a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>=<a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> ( Y0 );<a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>=delta0; <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>=<a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>(); <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>*<a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>; } 
     564<a name="l00764"></a>00764                         mat sample_mat()<span class="keyword"> const</span> 
     565<a name="l00765"></a>00765 <span class="keyword">                        </span>{ 
     566<a name="l00766"></a>00766                                 mat X=zeros ( <a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>,<a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a> ); 
     567<a name="l00767"></a>00767  
     568<a name="l00768"></a>00768                                 <span class="comment">//sample diagonal</span> 
     569<a name="l00769"></a>00769                                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1eWishartCh.html#b745c73faef785009484180582050a1f" title="dimension of matrix ">p</a>;i++ ) 
     570<a name="l00770"></a>00770                                 { 
     571<a name="l00771"></a>00771                                         GamRNG.<a class="code" href="classitpp_1_1Gamma__RNG.html#dfaae19411e39aa87e1f72e409b6babe" title="Set lambda.">setup</a> ( 0.5* ( <a class="code" href="classbdm_1_1eWishartCh.html#1879a14d7d2bb05062523b189baa11c3" title="degrees of freedom ">delta</a>-i ) , 0.5 ); <span class="comment">// no +1 !! index if from 0</span> 
     572<a name="l00772"></a>00772 <span class="preprocessor">#pragma omp critical</span> 
     573<a name="l00773"></a>00773 <span class="preprocessor"></span>                                        X ( i,i ) =sqrt ( GamRNG() ); 
     574<a name="l00774"></a>00774                                 } 
     575<a name="l00775"></a>00775                                 <span class="comment">//do the rest</span> 
     576<a name="l00776"></a>00776                                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;p;i++ ) 
     577<a name="l00777"></a>00777                                 { 
     578<a name="l00778"></a>00778                                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j=i+1;j&lt;p;j++ ) 
     579<a name="l00779"></a>00779                                         { 
     580<a name="l00780"></a>00780 <span class="preprocessor">#pragma omp critical</span> 
     581<a name="l00781"></a>00781 <span class="preprocessor"></span>                                                X ( i,j ) =NorRNG.sample(); 
     582<a name="l00782"></a>00782                                         } 
     583<a name="l00783"></a>00783                                 } 
     584<a name="l00784"></a>00784                                 <span class="keywordflow">return</span> X*<a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>();<span class="comment">// return upper triangular part of the decomposition</span> 
     585<a name="l00785"></a>00785                         } 
     586<a name="l00786"></a><a class="code" href="classbdm_1_1eWishartCh.html#8f2154b8b5be8f4c5788f261b6d57b9a">00786</a>                         vec <a class="code" href="classbdm_1_1eWishartCh.html#8f2154b8b5be8f4c5788f261b6d57b9a" title="Returns a sample,  from density .">sample</a> ()<span class="keyword"> const</span> 
     587<a name="l00787"></a>00787 <span class="keyword">                        </span>{ 
     588<a name="l00788"></a>00788                                 <span class="keywordflow">return</span> vec ( sample_mat()._data(),p*p ); 
     589<a name="l00789"></a>00789                         } 
     590<a name="l00791"></a><a class="code" href="classbdm_1_1eWishartCh.html#4eee757c0535c2a88bb20f0767c64981">00791</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#4eee757c0535c2a88bb20f0767c64981" title="fast access function y0 will be copied into Y.Ch.">setY</a> ( <span class="keyword">const</span> mat &amp;Ch0 ) {copy_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,Ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>()._data() );} 
     591<a name="l00793"></a><a class="code" href="classbdm_1_1eWishartCh.html#7eac414ec10b85aa5536b0092c57bc4a">00793</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eWishartCh.html#7eac414ec10b85aa5536b0092c57bc4a" title="fast access function y0 will be copied into Y.Ch.">_setY</a> ( <span class="keyword">const</span> vec &amp;ch0 ) {copy_vector ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, ch0._data(), <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>.<a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>()._data() ); } 
     592<a name="l00795"></a><a class="code" href="classbdm_1_1eWishartCh.html#1708cacb5d8cb1b96395d35f5327cb7e">00795</a>                         <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classbdm_1_1eWishartCh.html#1708cacb5d8cb1b96395d35f5327cb7e" title="access function">getY</a>()<span class="keyword">const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eWishartCh.html#1b42f9284a32f23b0b253a628cda7490" title="Upper-Triagle of Choleski decomposition of .">Y</a>;} 
     593<a name="l00796"></a>00796         }; 
     594<a name="l00797"></a>00797  
     595<a name="l00798"></a>00798         <span class="keyword">class </span>eiWishartCh: <span class="keyword">public</span> epdf 
     596<a name="l00799"></a>00799         { 
     597<a name="l00800"></a>00800                 <span class="keyword">protected</span>: 
     598<a name="l00801"></a>00801                         eWishartCh W; 
     599<a name="l00802"></a>00802                         <span class="keywordtype">int</span> p; 
     600<a name="l00803"></a>00803                         <span class="keywordtype">double</span> delta; 
     601<a name="l00804"></a>00804                 <span class="keyword">public</span>: 
     602<a name="l00805"></a>00805                         <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> mat &amp;Y0, <span class="keyword">const</span> <span class="keywordtype">double</span> delta0) { 
     603<a name="l00806"></a>00806                                 delta = delta0; 
     604<a name="l00807"></a>00807                                 W.set_parameters ( inv ( Y0 ),delta0 );  
     605<a name="l00808"></a>00808                                 dim = W.dimension(); p=Y0.rows(); 
     606<a name="l00809"></a>00809                         } 
     607<a name="l00810"></a>00810                         vec sample()<span class="keyword"> const </span>{mat iCh; iCh=inv ( W.sample_mat() ); <span class="keywordflow">return</span> vec ( iCh._data(),<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );} 
     608<a name="l00811"></a>00811                         <span class="keywordtype">void</span> _setY ( <span class="keyword">const</span> vec &amp;y0 ) 
     609<a name="l00812"></a>00812                         { 
     610<a name="l00813"></a>00813                                 mat Ch ( p,p ); 
     611<a name="l00814"></a>00814                                 mat iCh ( p,p ); 
     612<a name="l00815"></a>00815                                 copy_vector ( dim, y0._data(), Ch._data() ); 
     613<a name="l00816"></a>00816                                  
     614<a name="l00817"></a>00817                                 iCh=inv ( Ch ); 
     615<a name="l00818"></a>00818                                 W.setY ( iCh ); 
     616<a name="l00819"></a>00819                         } 
     617<a name="l00820"></a>00820                         <span class="keyword">virtual</span> <span class="keywordtype">double</span> evallog ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{ 
     618<a name="l00821"></a>00821                                 <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> X(p); 
     619<a name="l00822"></a>00822                                 <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; Y=W.getY(); 
     620<a name="l00823"></a>00823                                   
     621<a name="l00824"></a>00824                                 copy_vector(p*p,val._data(),X._Ch()._data()); 
     622<a name="l00825"></a>00825                                 <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> iX(p);X.inv(iX); 
     623<a name="l00826"></a>00826                                 <span class="comment">// compute  </span> 
     624<a name="l00827"></a>00827 <span class="comment">//                              \frac{ |\Psi|^{m/2}|X|^{-(m+p+1)/2}e^{-tr(\Psi X^{-1})/2} }{ 2^{mp/2}\Gamma_p(m/2)},</span> 
     625<a name="l00828"></a>00828                                 mat M=Y.<a class="code" href="classchmat.html#045addd685f8d978efda232d7dcb070e" title="Conversion to full matrix.">to_mat</a>()*iX.to_mat(); 
     626<a name="l00829"></a>00829                                  
     627<a name="l00830"></a>00830                                 <span class="keywordtype">double</span> log1 = 0.5*p*(2*Y.<a class="code" href="classchmat.html#b504ca818203b13e667cb3c503980382" title="Logarithm of a determinant.">logdet</a>())-0.5*(delta+p+1)*(2*X.logdet())-0.5*trace(M);  
     628<a name="l00831"></a>00831                                 <span class="comment">//Fixme! Multivariate gamma omitted!! it is ok for sampling, but not otherwise!!</span> 
    628629<a name="l00832"></a>00832                                  
    629 <a name="l00833"></a>00833                                 <span class="keywordtype">double</span> log1 = 0.5*p*(2*Y.<a class="code" href="classchmat.html#b504ca818203b13e667cb3c503980382" title="Logarithm of a determinant.">logdet</a>())-0.5*(delta+p+1)*(2*X.logdet())-0.5*trace(M);  
    630 <a name="l00834"></a>00834                                 <span class="comment">//Fixme! Multivariate gamma omitted!! it is ok for sampling, but not otherwise!!</span> 
    631 <a name="l00835"></a>00835                                  
    632 <a name="l00836"></a>00836 <span class="comment">/*                              if (0) {</span> 
    633 <a name="l00837"></a>00837 <span class="comment">                                        mat XX=X.to_mat();</span> 
    634 <a name="l00838"></a>00838 <span class="comment">                                        mat YY=Y.to_mat();</span> 
    635 <a name="l00839"></a>00839 <span class="comment">                                        </span> 
    636 <a name="l00840"></a>00840 <span class="comment">                                        double log2 = 0.5*p*log(det(YY))-0.5*(delta+p+1)*log(det(XX))-0.5*trace(YY*inv(XX)); </span> 
    637 <a name="l00841"></a>00841 <span class="comment">                                        cout &lt;&lt; log1 &lt;&lt; "," &lt;&lt; log2 &lt;&lt; endl;</span> 
    638 <a name="l00842"></a>00842 <span class="comment">                                }*/</span> 
    639 <a name="l00843"></a>00843                                 <span class="keywordflow">return</span> log1;                             
    640 <a name="l00844"></a>00844                         }; 
    641 <a name="l00845"></a>00845                          
    642 <a name="l00846"></a>00846         }; 
    643 <a name="l00847"></a>00847  
    644 <a name="l00848"></a>00848         <span class="keyword">class </span>rwiWishartCh : <span class="keyword">public</span> mpdf 
    645 <a name="l00849"></a>00849         { 
    646 <a name="l00850"></a>00850                 <span class="keyword">protected</span>: 
    647 <a name="l00851"></a>00851                         eiWishartCh eiW; 
    648 <a name="l00853"></a>00853                         <span class="keywordtype">double</span> sqd; 
    649 <a name="l00854"></a>00854                         <span class="comment">//reference point for diagonal</span> 
    650 <a name="l00855"></a>00855                         vec refl; 
    651 <a name="l00856"></a>00856                         <span class="keywordtype">double</span> l; 
    652 <a name="l00857"></a>00857                         <span class="keywordtype">int</span> p; 
    653 <a name="l00858"></a>00858                 <span class="keyword">public</span>: 
    654 <a name="l00859"></a>00859                         <span class="keywordtype">void</span> set_parameters ( <span class="keywordtype">int</span> p0, <span class="keywordtype">double</span> k, vec ref0, <span class="keywordtype">double</span> l0  ) 
    655 <a name="l00860"></a>00860                         { 
    656 <a name="l00861"></a>00861                                 p=p0; 
    657 <a name="l00862"></a>00862                                 <span class="keywordtype">double</span> delta = 2/(k*k)+p+3; 
    658 <a name="l00863"></a>00863                                 sqd=sqrt ( delta-p-1 ); 
    659 <a name="l00864"></a>00864                                 l=l0; 
    660 <a name="l00865"></a>00865                                 refl=pow(ref0,1-l); 
    661 <a name="l00866"></a>00866                                  
    662 <a name="l00867"></a>00867                                 eiW.set_parameters ( eye ( p ),delta ); 
    663 <a name="l00868"></a>00868                                 <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;eiW; 
    664 <a name="l00869"></a>00869                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=eiW.dimension(); 
    665 <a name="l00870"></a>00870                         } 
    666 <a name="l00871"></a>00871                         <span class="keywordtype">void</span> condition ( <span class="keyword">const</span> vec &amp;c ) { 
    667 <a name="l00872"></a>00872                                 vec z=c; 
    668 <a name="l00873"></a>00873                                 <span class="keywordtype">int</span> ri=0; 
    669 <a name="l00874"></a>00874                                 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;p*p;i+=(p+1)){<span class="comment">//trace diagonal element</span> 
    670 <a name="l00875"></a>00875                                         z(i) = pow(z(i),l)*refl(ri); 
    671 <a name="l00876"></a>00876                                         ri++; 
    672 <a name="l00877"></a>00877                                 } 
    673 <a name="l00878"></a>00878  
    674 <a name="l00879"></a>00879                                 eiW._setY ( sqd*z ); 
    675 <a name="l00880"></a>00880                         } 
    676 <a name="l00881"></a>00881         }; 
    677 <a name="l00882"></a>00882  
    678 <a name="l00884"></a>00884         <span class="keyword">enum</span> RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 }; 
    679 <a name="l00890"></a><a class="code" href="classbdm_1_1eEmp.html">00890</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> 
    680 <a name="l00891"></a>00891         { 
    681 <a name="l00892"></a>00892                 <span class="keyword">protected</span> : 
    682 <a name="l00894"></a><a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031">00894</a>                         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>; 
    683 <a name="l00896"></a><a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d">00896</a>                         vec <a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>; 
    684 <a name="l00898"></a><a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3">00898</a>                         Array&lt;vec&gt; <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>; 
    685 <a name="l00899"></a>00899                 <span class="keyword">public</span>: 
    686 <a name="l00902"></a>00902                         <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> ( ) {}; 
    687 <a name="l00903"></a>00903                         <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> ) {}; 
    688 <a name="l00905"></a>00905  
    689 <a name="l00907"></a>00907                         <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 ); 
    690 <a name="l00909"></a><a class="code" href="classbdm_1_1eEmp.html#cef74aa5f87d10d440b9b1e8bc78c1e7">00909</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#cef74aa5f87d10d440b9b1e8bc78c1e7" 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#cef74aa5f87d10d440b9b1e8bc78c1e7" title="Set samples and weights.">set_statistics</a> ( ones ( n ) /n,pdf0 );}; 
    691 <a name="l00911"></a>00911                         <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 ); 
    692 <a name="l00913"></a><a class="code" href="classbdm_1_1eEmp.html#c74c281d652356c19b6b079e42ca7ef1">00913</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 );}; 
    693 <a name="l00915"></a><a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef">00915</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>;}; 
    694 <a name="l00917"></a><a class="code" href="classbdm_1_1eEmp.html#b7d7106f486e3fad38590914a693d714">00917</a>                         <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1eEmp.html#b7d7106f486e3fad38590914a693d714" 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>;}; 
    695 <a name="l00919"></a><a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2">00919</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>;}; 
    696 <a name="l00921"></a><a class="code" href="classbdm_1_1eEmp.html#b59af0efdb009d98ea8ebfa965e74ae2">00921</a>                         <span class="keyword">const</span> Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#b59af0efdb009d98ea8ebfa965e74ae2" 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>;}; 
    697 <a name="l00923"></a>00923                         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 ); 
    698 <a name="l00925"></a><a class="code" href="classbdm_1_1eEmp.html#97f1e07b5ae6eebc91c7365f0f88d270">00925</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;} 
    699 <a name="l00927"></a><a class="code" href="classbdm_1_1eEmp.html#01654c014d3aa068f8d4ecba4be86d09">00927</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;} 
    700 <a name="l00928"></a><a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9">00928</a>                         vec <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>()<span class="keyword"> const</span> 
    701 <a name="l00929"></a>00929 <span class="keyword">                        </span>{ 
    702 <a name="l00930"></a>00930                                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
    703 <a name="l00931"></a>00931                                 <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 );} 
    704 <a name="l00932"></a>00932                                 <span class="keywordflow">return</span> pom; 
    705 <a name="l00933"></a>00933                         } 
    706 <a name="l00934"></a><a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87">00934</a>                         vec <a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const</span> 
    707 <a name="l00935"></a>00935 <span class="keyword">                        </span>{ 
    708 <a name="l00936"></a>00936                                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
    709 <a name="l00937"></a>00937                                 <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 );} 
    710 <a name="l00938"></a>00938                                 <span class="keywordflow">return</span> pom-pow ( <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>(),2 ); 
    711 <a name="l00939"></a>00939                         } 
    712 <a name="l00941"></a><a class="code" href="classbdm_1_1eEmp.html#b1c9df656144edf79ba2d885613f661f">00941</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> 
    713 <a name="l00942"></a>00942 <span class="keyword">                        </span>{ 
    714 <a name="l00943"></a>00943                                 <span class="comment">// lb in inf so than it will be pushed below;</span> 
    715 <a name="l00944"></a>00944                                 lb.set_size ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
    716 <a name="l00945"></a>00945                                 ub.set_size ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
    717 <a name="l00946"></a>00946                                 lb = std::numeric_limits&lt;double&gt;::infinity(); 
    718 <a name="l00947"></a>00947                                 ub = -std::numeric_limits&lt;double&gt;::infinity(); 
    719 <a name="l00948"></a>00948                                 <span class="keywordtype">int</span> j; 
    720 <a name="l00949"></a>00949                                 <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++ ) 
    721 <a name="l00950"></a>00950                                 { 
    722 <a name="l00951"></a>00951                                         <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++ ) 
    723 <a name="l00952"></a>00952                                         { 
    724 <a name="l00953"></a>00953                                                 <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 );} 
    725 <a name="l00954"></a>00954                                                 <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 );} 
    726 <a name="l00955"></a>00955                                         } 
    727 <a name="l00956"></a>00956                                 } 
    728 <a name="l00957"></a>00957                         } 
    729 <a name="l00958"></a>00958         }; 
     630<a name="l00833"></a>00833 <span class="comment">/*                              if (0) {</span> 
     631<a name="l00834"></a>00834 <span class="comment">                                        mat XX=X.to_mat();</span> 
     632<a name="l00835"></a>00835 <span class="comment">                                        mat YY=Y.to_mat();</span> 
     633<a name="l00836"></a>00836 <span class="comment">                                        </span> 
     634<a name="l00837"></a>00837 <span class="comment">                                        double log2 = 0.5*p*log(det(YY))-0.5*(delta+p+1)*log(det(XX))-0.5*trace(YY*inv(XX)); </span> 
     635<a name="l00838"></a>00838 <span class="comment">                                        cout &lt;&lt; log1 &lt;&lt; "," &lt;&lt; log2 &lt;&lt; endl;</span> 
     636<a name="l00839"></a>00839 <span class="comment">                                }*/</span> 
     637<a name="l00840"></a>00840                                 <span class="keywordflow">return</span> log1;                             
     638<a name="l00841"></a>00841                         }; 
     639<a name="l00842"></a>00842                          
     640<a name="l00843"></a>00843         }; 
     641<a name="l00844"></a>00844  
     642<a name="l00845"></a>00845         <span class="keyword">class </span>rwiWishartCh : <span class="keyword">public</span> mpdf 
     643<a name="l00846"></a>00846         { 
     644<a name="l00847"></a>00847                 <span class="keyword">protected</span>: 
     645<a name="l00848"></a>00848                         eiWishartCh eiW; 
     646<a name="l00850"></a>00850                         <span class="keywordtype">double</span> sqd; 
     647<a name="l00851"></a>00851                         <span class="comment">//reference point for diagonal</span> 
     648<a name="l00852"></a>00852                         vec refl; 
     649<a name="l00853"></a>00853                         <span class="keywordtype">double</span> l; 
     650<a name="l00854"></a>00854                         <span class="keywordtype">int</span> p; 
     651<a name="l00855"></a>00855                 <span class="keyword">public</span>: 
     652<a name="l00856"></a>00856                         <span class="keywordtype">void</span> set_parameters ( <span class="keywordtype">int</span> p0, <span class="keywordtype">double</span> k, vec ref0, <span class="keywordtype">double</span> l0  ) 
     653<a name="l00857"></a>00857                         { 
     654<a name="l00858"></a>00858                                 p=p0; 
     655<a name="l00859"></a>00859                                 <span class="keywordtype">double</span> delta = 2/(k*k)+p+3; 
     656<a name="l00860"></a>00860                                 sqd=sqrt ( delta-p-1 ); 
     657<a name="l00861"></a>00861                                 l=l0; 
     658<a name="l00862"></a>00862                                 refl=pow(ref0,1-l); 
     659<a name="l00863"></a>00863                                  
     660<a name="l00864"></a>00864                                 eiW.set_parameters ( eye ( p ),delta ); 
     661<a name="l00865"></a>00865                                 <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&amp;eiW; 
     662<a name="l00866"></a>00866                                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=eiW.dimension(); 
     663<a name="l00867"></a>00867                         } 
     664<a name="l00868"></a>00868                         <span class="keywordtype">void</span> condition ( <span class="keyword">const</span> vec &amp;c ) { 
     665<a name="l00869"></a>00869                                 vec z=c; 
     666<a name="l00870"></a>00870                                 <span class="keywordtype">int</span> ri=0; 
     667<a name="l00871"></a>00871                                 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;p*p;i+=(p+1)){<span class="comment">//trace diagonal element</span> 
     668<a name="l00872"></a>00872                                         z(i) = pow(z(i),l)*refl(ri); 
     669<a name="l00873"></a>00873                                         ri++; 
     670<a name="l00874"></a>00874                                 } 
     671<a name="l00875"></a>00875  
     672<a name="l00876"></a>00876                                 eiW._setY ( sqd*z ); 
     673<a name="l00877"></a>00877                         } 
     674<a name="l00878"></a>00878         }; 
     675<a name="l00879"></a>00879  
     676<a name="l00881"></a>00881         <span class="keyword">enum</span> RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 }; 
     677<a name="l00887"></a><a class="code" href="classbdm_1_1eEmp.html">00887</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> 
     678<a name="l00888"></a>00888         { 
     679<a name="l00889"></a>00889                 <span class="keyword">protected</span> : 
     680<a name="l00891"></a><a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031">00891</a>                         <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1eEmp.html#9798006271ca77629855113f1283a031" title="Number of particles.">n</a>; 
     681<a name="l00893"></a><a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d">00893</a>                         vec <a class="code" href="classbdm_1_1eEmp.html#9d39241aab7c4bbeb07c6d516421c67d" title="Sample weights .">w</a>; 
     682<a name="l00895"></a><a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3">00895</a>                         Array&lt;vec&gt; <a class="code" href="classbdm_1_1eEmp.html#73d819553a0f268b055a087d2d4486f3" title="Samples .">samples</a>; 
     683<a name="l00896"></a>00896                 <span class="keyword">public</span>: 
     684<a name="l00899"></a>00899                         <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> ( ) {}; 
     685<a name="l00900"></a>00900                         <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> ) {}; 
     686<a name="l00902"></a>00902  
     687<a name="l00904"></a>00904                         <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 ); 
     688<a name="l00906"></a><a class="code" href="classbdm_1_1eEmp.html#cef74aa5f87d10d440b9b1e8bc78c1e7">00906</a>                         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eEmp.html#cef74aa5f87d10d440b9b1e8bc78c1e7" 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#cef74aa5f87d10d440b9b1e8bc78c1e7" title="Set samples and weights.">set_statistics</a> ( ones ( n ) /n,pdf0 );}; 
     689<a name="l00908"></a>00908                         <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 ); 
     690<a name="l00910"></a><a class="code" href="classbdm_1_1eEmp.html#c74c281d652356c19b6b079e42ca7ef1">00910</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 );}; 
     691<a name="l00912"></a><a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef">00912</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>;}; 
     692<a name="l00914"></a><a class="code" href="classbdm_1_1eEmp.html#b7d7106f486e3fad38590914a693d714">00914</a>                         <span class="keyword">const</span> vec&amp; <a class="code" href="classbdm_1_1eEmp.html#b7d7106f486e3fad38590914a693d714" 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>;}; 
     693<a name="l00916"></a><a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2">00916</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>;}; 
     694<a name="l00918"></a><a class="code" href="classbdm_1_1eEmp.html#b59af0efdb009d98ea8ebfa965e74ae2">00918</a>                         <span class="keyword">const</span> Array&lt;vec&gt;&amp; <a class="code" href="classbdm_1_1eEmp.html#b59af0efdb009d98ea8ebfa965e74ae2" 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>;}; 
     695<a name="l00920"></a>00920                         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 ); 
     696<a name="l00922"></a><a class="code" href="classbdm_1_1eEmp.html#97f1e07b5ae6eebc91c7365f0f88d270">00922</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;} 
     697<a name="l00924"></a><a class="code" href="classbdm_1_1eEmp.html#01654c014d3aa068f8d4ecba4be86d09">00924</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;} 
     698<a name="l00925"></a><a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9">00925</a>                         vec <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>()<span class="keyword"> const</span> 
     699<a name="l00926"></a>00926 <span class="keyword">                        </span>{ 
     700<a name="l00927"></a>00927                                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
     701<a name="l00928"></a>00928                                 <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 );} 
     702<a name="l00929"></a>00929                                 <span class="keywordflow">return</span> pom; 
     703<a name="l00930"></a>00930                         } 
     704<a name="l00931"></a><a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87">00931</a>                         vec <a class="code" href="classbdm_1_1eEmp.html#05e9ebf467ede737cb6a3621d7fd3c87" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const</span> 
     705<a name="l00932"></a>00932 <span class="keyword">                        </span>{ 
     706<a name="l00933"></a>00933                                 vec pom=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
     707<a name="l00934"></a>00934                                 <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 );} 
     708<a name="l00935"></a>00935                                 <span class="keywordflow">return</span> pom-pow ( <a class="code" href="classbdm_1_1eEmp.html#bbfcb4f868c7381298c281a256d8c4b9" title="return expected value">mean</a>(),2 ); 
     709<a name="l00936"></a>00936                         } 
     710<a name="l00938"></a><a class="code" href="classbdm_1_1eEmp.html#b1c9df656144edf79ba2d885613f661f">00938</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> 
     711<a name="l00939"></a>00939 <span class="keyword">                        </span>{ 
     712<a name="l00940"></a>00940                                 <span class="comment">// lb in inf so than it will be pushed below;</span> 
     713<a name="l00941"></a>00941                                 lb.set_size ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
     714<a name="l00942"></a>00942                                 ub.set_size ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
     715<a name="l00943"></a>00943                                 lb = std::numeric_limits&lt;double&gt;::infinity(); 
     716<a name="l00944"></a>00944                                 ub = -std::numeric_limits&lt;double&gt;::infinity(); 
     717<a name="l00945"></a>00945                                 <span class="keywordtype">int</span> j; 
     718<a name="l00946"></a>00946                                 <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++ ) 
     719<a name="l00947"></a>00947                                 { 
     720<a name="l00948"></a>00948                                         <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++ ) 
     721<a name="l00949"></a>00949                                         { 
     722<a name="l00950"></a>00950                                                 <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 );} 
     723<a name="l00951"></a>00951                                                 <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 );} 
     724<a name="l00952"></a>00952                                         } 
     725<a name="l00953"></a>00953                                 } 
     726<a name="l00954"></a>00954                         } 
     727<a name="l00955"></a>00955         }; 
     728<a name="l00956"></a>00956  
     729<a name="l00957"></a>00957  
    730730<a name="l00959"></a>00959  
    731 <a name="l00960"></a>00960  
    732 <a name="l00962"></a>00962  
    733 <a name="l00963"></a>00963         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    734 <a name="l00964"></a>00964         <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 ) 
    735 <a name="l00965"></a>00965         { 
    736 <a name="l00966"></a>00966 <span class="comment">//Fixme test dimensions of mu0 and R0;</span> 
    737 <a name="l00967"></a>00967                 mu = mu0; 
    738 <a name="l00968"></a>00968                 R = R0; 
    739 <a name="l00969"></a>00969                 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = mu0.length(); 
    740 <a name="l00970"></a>00970         }; 
    741 <a name="l00971"></a>00971  
    742 <a name="l00972"></a>00972         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    743 <a name="l00973"></a><a class="code" href="classbdm_1_1enorm.html#d2e0d3a1e30ab3ab04df2d0c43ae74a2">00973</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#d2e0d3a1e30ab3ab04df2d0c43ae74a2" title="dupdate in exponential form (not really handy)">enorm&lt;sq_T&gt;::dupdate</a> ( mat &amp;v, <span class="keywordtype">double</span> nu ) 
    744 <a name="l00974"></a>00974         { 
    745 <a name="l00975"></a>00975                 <span class="comment">//</span> 
    746 <a name="l00976"></a>00976         }; 
    747 <a name="l00977"></a>00977  
    748 <a name="l00978"></a>00978 <span class="comment">// template&lt;class sq_T&gt;</span> 
    749 <a name="l00979"></a>00979 <span class="comment">// void enorm&lt;sq_T&gt;::tupdate ( double phi, mat &amp;vbar, double nubar ) {</span> 
    750 <a name="l00980"></a>00980 <span class="comment">//      //</span> 
    751 <a name="l00981"></a>00981 <span class="comment">// };</span> 
    752 <a name="l00982"></a>00982  
    753 <a name="l00983"></a>00983         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    754 <a name="l00984"></a><a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766">00984</a>         vec <a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766" title="Returns a sample,  from density .">enorm&lt;sq_T&gt;::sample</a>()<span class="keyword"> const</span> 
    755 <a name="l00985"></a>00985 <span class="keyword">        </span>{ 
    756 <a name="l00986"></a>00986                 vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
    757 <a name="l00987"></a>00987 <span class="preprocessor">#pragma omp critical</span> 
    758 <a name="l00988"></a>00988 <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 ); 
    759 <a name="l00989"></a>00989                 vec smp = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x ); 
    760 <a name="l00990"></a>00990  
    761 <a name="l00991"></a>00991                 smp += <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>; 
    762 <a name="l00992"></a>00992                 <span class="keywordflow">return</span> smp; 
    763 <a name="l00993"></a>00993         }; 
    764 <a name="l00994"></a>00994  
    765 <a name="l00995"></a>00995         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    766 <a name="l00996"></a>00996         mat <a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766" title="Returns a sample,  from density .">enorm&lt;sq_T&gt;::sample</a> ( <span class="keywordtype">int</span> N )<span class="keyword"> const</span> 
    767 <a name="l00997"></a>00997 <span class="keyword">        </span>{ 
    768 <a name="l00998"></a>00998                 mat X ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,N ); 
    769 <a name="l00999"></a>00999                 vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
    770 <a name="l01000"></a>01000                 vec pom; 
    771 <a name="l01001"></a>01001                 <span class="keywordtype">int</span> i; 
    772 <a name="l01002"></a>01002  
    773 <a name="l01003"></a>01003                 <span class="keywordflow">for</span> ( i=0;i&lt;N;i++ ) 
    774 <a name="l01004"></a>01004                 { 
    775 <a name="l01005"></a>01005 <span class="preprocessor">#pragma omp critical</span> 
    776 <a name="l01006"></a>01006 <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 ); 
    777 <a name="l01007"></a>01007                         pom = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x ); 
    778 <a name="l01008"></a>01008                         pom +=<a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>; 
    779 <a name="l01009"></a>01009                         X.set_col ( i, pom ); 
    780 <a name="l01010"></a>01010                 } 
     731<a name="l00960"></a>00960         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     732<a name="l00961"></a>00961         <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 ) 
     733<a name="l00962"></a>00962         { 
     734<a name="l00963"></a>00963 <span class="comment">//Fixme test dimensions of mu0 and R0;</span> 
     735<a name="l00964"></a>00964                 mu = mu0; 
     736<a name="l00965"></a>00965                 R = R0; 
     737<a name="l00966"></a>00966                 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = mu0.length(); 
     738<a name="l00967"></a>00967         }; 
     739<a name="l00968"></a>00968  
     740<a name="l00969"></a>00969         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     741<a name="l00970"></a><a class="code" href="classbdm_1_1enorm.html#d2e0d3a1e30ab3ab04df2d0c43ae74a2">00970</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#d2e0d3a1e30ab3ab04df2d0c43ae74a2" title="dupdate in exponential form (not really handy)">enorm&lt;sq_T&gt;::dupdate</a> ( mat &amp;v, <span class="keywordtype">double</span> nu ) 
     742<a name="l00971"></a>00971         { 
     743<a name="l00972"></a>00972                 <span class="comment">//</span> 
     744<a name="l00973"></a>00973         }; 
     745<a name="l00974"></a>00974  
     746<a name="l00975"></a>00975 <span class="comment">// template&lt;class sq_T&gt;</span> 
     747<a name="l00976"></a>00976 <span class="comment">// void enorm&lt;sq_T&gt;::tupdate ( double phi, mat &amp;vbar, double nubar ) {</span> 
     748<a name="l00977"></a>00977 <span class="comment">//      //</span> 
     749<a name="l00978"></a>00978 <span class="comment">// };</span> 
     750<a name="l00979"></a>00979  
     751<a name="l00980"></a>00980         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     752<a name="l00981"></a><a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766">00981</a>         vec <a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766" title="Returns a sample,  from density .">enorm&lt;sq_T&gt;::sample</a>()<span class="keyword"> const</span> 
     753<a name="l00982"></a>00982 <span class="keyword">        </span>{ 
     754<a name="l00983"></a>00983                 vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
     755<a name="l00984"></a>00984 <span class="preprocessor">#pragma omp critical</span> 
     756<a name="l00985"></a>00985 <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 ); 
     757<a name="l00986"></a>00986                 vec smp = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x ); 
     758<a name="l00987"></a>00987  
     759<a name="l00988"></a>00988                 smp += <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>; 
     760<a name="l00989"></a>00989                 <span class="keywordflow">return</span> smp; 
     761<a name="l00990"></a>00990         }; 
     762<a name="l00991"></a>00991  
     763<a name="l00992"></a>00992         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     764<a name="l00993"></a>00993         mat <a class="code" href="classbdm_1_1enorm.html#e1a48f52351ec3a349bd443b713b1766" title="Returns a sample,  from density .">enorm&lt;sq_T&gt;::sample</a> ( <span class="keywordtype">int</span> N )<span class="keyword"> const</span> 
     765<a name="l00994"></a>00994 <span class="keyword">        </span>{ 
     766<a name="l00995"></a>00995                 mat X ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>,N ); 
     767<a name="l00996"></a>00996                 vec x ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 
     768<a name="l00997"></a>00997                 vec pom; 
     769<a name="l00998"></a>00998                 <span class="keywordtype">int</span> i; 
     770<a name="l00999"></a>00999  
     771<a name="l01000"></a>01000                 <span class="keywordflow">for</span> ( i=0;i&lt;N;i++ ) 
     772<a name="l01001"></a>01001                 { 
     773<a name="l01002"></a>01002 <span class="preprocessor">#pragma omp critical</span> 
     774<a name="l01003"></a>01003 <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 ); 
     775<a name="l01004"></a>01004                         pom = <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.sqrt_mult ( x ); 
     776<a name="l01005"></a>01005                         pom +=<a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a>; 
     777<a name="l01006"></a>01006                         X.set_col ( i, pom ); 
     778<a name="l01007"></a>01007                 } 
     779<a name="l01008"></a>01008  
     780<a name="l01009"></a>01009                 <span class="keywordflow">return</span> X; 
     781<a name="l01010"></a>01010         }; 
    781782<a name="l01011"></a>01011  
    782 <a name="l01012"></a>01012                 <span class="keywordflow">return</span> X; 
    783 <a name="l01013"></a>01013         }; 
    784 <a name="l01014"></a>01014  
    785 <a name="l01015"></a>01015 <span class="comment">// template&lt;class sq_T&gt;</span> 
    786 <a name="l01016"></a>01016 <span class="comment">// double enorm&lt;sq_T&gt;::eval ( const vec &amp;val ) const {</span> 
    787 <a name="l01017"></a>01017 <span class="comment">//      double pdfl,e;</span> 
    788 <a name="l01018"></a>01018 <span class="comment">//      pdfl = evallog ( val );</span> 
    789 <a name="l01019"></a>01019 <span class="comment">//      e = exp ( pdfl );</span> 
    790 <a name="l01020"></a>01020 <span class="comment">//      return e;</span> 
    791 <a name="l01021"></a>01021 <span class="comment">// };</span> 
    792 <a name="l01022"></a>01022  
    793 <a name="l01023"></a>01023         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    794 <a name="l01024"></a><a class="code" href="classbdm_1_1enorm.html#e13aeed5b543b2179bacdc4fa2ae47a3">01024</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#e13aeed5b543b2179bacdc4fa2ae47a3" title="Evaluate normalized log-probability.">enorm&lt;sq_T&gt;::evallog_nn</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const</span> 
    795 <a name="l01025"></a>01025 <span class="keyword">        </span>{ 
    796 <a name="l01026"></a>01026                 <span class="comment">// 1.83787706640935 = log(2pi)</span> 
    797 <a name="l01027"></a>01027                 <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> 
    798 <a name="l01028"></a>01028                 <span class="keywordflow">return</span>  tmp; 
    799 <a name="l01029"></a>01029         }; 
    800 <a name="l01030"></a>01030  
    801 <a name="l01031"></a>01031         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    802 <a name="l01032"></a><a class="code" href="classbdm_1_1enorm.html#25785343aff102cc5df1cab08ba16d32">01032</a>         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#25785343aff102cc5df1cab08ba16d32" title="logarithm of the normalizing constant, ">enorm&lt;sq_T&gt;::lognc</a> ()<span class="keyword"> const</span> 
    803 <a name="l01033"></a>01033 <span class="keyword">        </span>{ 
    804 <a name="l01034"></a>01034                 <span class="comment">// 1.83787706640935 = log(2pi)</span> 
    805 <a name="l01035"></a>01035                 <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() ); 
    806 <a name="l01036"></a>01036                 <span class="keywordflow">return</span> tmp; 
    807 <a name="l01037"></a>01037         }; 
    808 <a name="l01038"></a>01038  
    809 <a name="l01039"></a>01039         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    810 <a name="l01040"></a><a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f">01040</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f" title="Set A and R.">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 ) 
    811 <a name="l01041"></a>01041         { 
    812 <a name="l01042"></a>01042                 it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> ); 
    813 <a name="l01043"></a>01043                 it_assert_debug ( A0.rows() ==R0.rows(),<span class="stringliteral">""</span> ); 
    814 <a name="l01044"></a>01044  
    815 <a name="l01045"></a>01045                 <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 ); 
    816 <a name="l01046"></a>01046                 A = A0; 
    817 <a name="l01047"></a>01047                 mu_const = mu0; 
    818 <a name="l01048"></a>01048                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=A0.cols(); 
    819 <a name="l01049"></a>01049         } 
    820 <a name="l01050"></a>01050  
    821 <a name="l01051"></a>01051 <span class="comment">// template&lt;class sq_T&gt;</span> 
    822 <a name="l01052"></a>01052 <span class="comment">// vec mlnorm&lt;sq_T&gt;::samplecond (const  vec &amp;cond, double &amp;lik ) {</span> 
    823 <a name="l01053"></a>01053 <span class="comment">//      this-&gt;condition ( cond );</span> 
    824 <a name="l01054"></a>01054 <span class="comment">//      vec smp = epdf.sample();</span> 
    825 <a name="l01055"></a>01055 <span class="comment">//      lik = epdf.eval ( smp );</span> 
    826 <a name="l01056"></a>01056 <span class="comment">//      return smp;</span> 
    827 <a name="l01057"></a>01057 <span class="comment">// }</span> 
    828 <a name="l01058"></a>01058  
    829 <a name="l01059"></a>01059 <span class="comment">// template&lt;class sq_T&gt;</span> 
    830 <a name="l01060"></a>01060 <span class="comment">// mat mlnorm&lt;sq_T&gt;::samplecond (const vec &amp;cond, vec &amp;lik, int n ) {</span> 
    831 <a name="l01061"></a>01061 <span class="comment">//      int i;</span> 
    832 <a name="l01062"></a>01062 <span class="comment">//      int dim = rv.count();</span> 
    833 <a name="l01063"></a>01063 <span class="comment">//      mat Smp ( dim,n );</span> 
    834 <a name="l01064"></a>01064 <span class="comment">//      vec smp ( dim );</span> 
    835 <a name="l01065"></a>01065 <span class="comment">//      this-&gt;condition ( cond );</span> 
    836 <a name="l01066"></a>01066 <span class="comment">//</span> 
    837 <a name="l01067"></a>01067 <span class="comment">//      for ( i=0; i&lt;n; i++ ) {</span> 
    838 <a name="l01068"></a>01068 <span class="comment">//              smp = epdf.sample();</span> 
    839 <a name="l01069"></a>01069 <span class="comment">//              lik ( i ) = epdf.eval ( smp );</span> 
    840 <a name="l01070"></a>01070 <span class="comment">//              Smp.set_col ( i ,smp );</span> 
    841 <a name="l01071"></a>01071 <span class="comment">//      }</span> 
    842 <a name="l01072"></a>01072 <span class="comment">//</span> 
    843 <a name="l01073"></a>01073 <span class="comment">//      return Smp;</span> 
    844 <a name="l01074"></a>01074 <span class="comment">// }</span> 
    845 <a name="l01075"></a>01075  
    846 <a name="l01076"></a>01076         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    847 <a name="l01077"></a><a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">01077</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">mlnorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> vec &amp;cond ) 
    848 <a name="l01078"></a>01078         { 
    849 <a name="l01079"></a>01079                 _mu = A*cond + mu_const; 
    850 <a name="l01080"></a>01080 <span class="comment">//R is already assigned;</span> 
    851 <a name="l01081"></a>01081         } 
    852 <a name="l01082"></a>01082  
    853 <a name="l01083"></a>01083         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    854 <a name="l01084"></a><a class="code" href="classbdm_1_1enorm.html#c2996bdaffad38fbe0fc776db54c9d80">01084</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_1enorm.html#c2996bdaffad38fbe0fc776db54c9d80" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">enorm&lt;sq_T&gt;::marginal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span> 
    855 <a name="l01085"></a>01085 <span class="keyword">        </span>{ 
    856 <a name="l01086"></a>01086                 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> ); 
    857 <a name="l01087"></a>01087                 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> ); 
    858 <a name="l01088"></a>01088  
    859 <a name="l01089"></a>01089                 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> 
    860 <a name="l01090"></a>01090  
    861 <a name="l01091"></a>01091                 <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>; 
    862 <a name="l01092"></a>01092                 tmp-&gt;<a class="code" href="classbdm_1_1epdf.html#f423e28448dbb69ef4905295ec8de8ff" title="Name its rv.">set_rv</a> ( rvn ); 
    863 <a name="l01093"></a>01093                 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 ); 
    864 <a name="l01094"></a>01094                 <span class="keywordflow">return</span> tmp; 
    865 <a name="l01095"></a>01095         } 
    866 <a name="l01096"></a>01096  
    867 <a name="l01097"></a>01097         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    868 <a name="l01098"></a><a class="code" href="classbdm_1_1enorm.html#baea4d49c657342b58297d68cda16d26">01098</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#baea4d49c657342b58297d68cda16d26" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">enorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span> 
    869 <a name="l01099"></a>01099 <span class="keyword">        </span>{ 
    870 <a name="l01100"></a>01100  
    871 <a name="l01101"></a>01101                 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> ); 
    872 <a name="l01102"></a>01102  
    873 <a name="l01103"></a>01103                 <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 ); 
    874 <a name="l01104"></a>01104                 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> ); 
    875 <a name="l01105"></a>01105                 <span class="comment">//Permutation vector of the new R</span> 
    876 <a name="l01106"></a>01106                 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> ); 
    877 <a name="l01107"></a>01107                 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> ); 
    878 <a name="l01108"></a>01108                 ivec perm=concat ( irvn , irvc ); 
    879 <a name="l01109"></a>01109                 sq_T Rn ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>,perm ); 
    880 <a name="l01110"></a>01110  
    881 <a name="l01111"></a>01111                 <span class="comment">//fixme - could this be done in general for all sq_T?</span> 
    882 <a name="l01112"></a>01112                 mat S=Rn.to_mat(); 
    883 <a name="l01113"></a>01113                 <span class="comment">//fixme</span> 
    884 <a name="l01114"></a>01114                 <span class="keywordtype">int</span> n=rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>()-1; 
    885 <a name="l01115"></a>01115                 <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; 
    886 <a name="l01116"></a>01116                 mat S11 = S.get ( 0,n, 0, n ); 
    887 <a name="l01117"></a>01117                 mat S12 = S.get ( 0, n , rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end ); 
    888 <a name="l01118"></a>01118                 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 ); 
    889 <a name="l01119"></a>01119  
    890 <a name="l01120"></a>01120                 vec mu1 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvn ); 
    891 <a name="l01121"></a>01121                 vec mu2 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvc ); 
    892 <a name="l01122"></a>01122                 mat A=S12*inv ( S22 ); 
    893 <a name="l01123"></a>01123                 sq_T R_n ( S11 - A *S12.T() ); 
    894 <a name="l01124"></a>01124  
    895 <a name="l01125"></a>01125                 <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> ( ); 
    896 <a name="l01126"></a>01126                 tmp-&gt;set_rv ( rvn ); tmp-&gt;set_rvc ( rvc ); 
    897 <a name="l01127"></a>01127                 tmp-&gt;set_parameters ( A,mu1-A*mu2,R_n ); 
    898 <a name="l01128"></a>01128                 <span class="keywordflow">return</span> tmp; 
    899 <a name="l01129"></a>01129         } 
    900 <a name="l01130"></a>01130  
    901 <a name="l01132"></a>01132  
    902 <a name="l01133"></a>01133         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
    903 <a name="l01134"></a>01134         std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_T&gt; &amp;ml ) 
    904 <a name="l01135"></a>01135         { 
    905 <a name="l01136"></a>01136                 os &lt;&lt; <span class="stringliteral">"A:"</span>&lt;&lt; ml.A&lt;&lt;endl; 
    906 <a name="l01137"></a>01137                 os &lt;&lt; <span class="stringliteral">"mu:"</span>&lt;&lt; ml.mu_const&lt;&lt;endl; 
    907 <a name="l01138"></a>01138                 os &lt;&lt; <span class="stringliteral">"R:"</span> &lt;&lt; ml.epdf._R().to_mat() &lt;&lt;endl; 
    908 <a name="l01139"></a>01139                 <span class="keywordflow">return</span> os; 
    909 <a name="l01140"></a>01140         }; 
    910 <a name="l01141"></a>01141  
    911 <a name="l01142"></a>01142 } 
    912 <a name="l01143"></a>01143 <span class="preprocessor">#endif //EF_H</span> 
     783<a name="l01012"></a>01012 <span class="comment">// template&lt;class sq_T&gt;</span> 
     784<a name="l01013"></a>01013 <span class="comment">// double enorm&lt;sq_T&gt;::eval ( const vec &amp;val ) const {</span> 
     785<a name="l01014"></a>01014 <span class="comment">//      double pdfl,e;</span> 
     786<a name="l01015"></a>01015 <span class="comment">//      pdfl = evallog ( val );</span> 
     787<a name="l01016"></a>01016 <span class="comment">//      e = exp ( pdfl );</span> 
     788<a name="l01017"></a>01017 <span class="comment">//      return e;</span> 
     789<a name="l01018"></a>01018 <span class="comment">// };</span> 
     790<a name="l01019"></a>01019  
     791<a name="l01020"></a>01020         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     792<a name="l01021"></a><a class="code" href="classbdm_1_1enorm.html#e13aeed5b543b2179bacdc4fa2ae47a3">01021</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#e13aeed5b543b2179bacdc4fa2ae47a3" title="Evaluate normalized log-probability.">enorm&lt;sq_T&gt;::evallog_nn</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const</span> 
     793<a name="l01022"></a>01022 <span class="keyword">        </span>{ 
     794<a name="l01023"></a>01023                 <span class="comment">// 1.83787706640935 = log(2pi)</span> 
     795<a name="l01024"></a>01024                 <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> 
     796<a name="l01025"></a>01025                 <span class="keywordflow">return</span>  tmp; 
     797<a name="l01026"></a>01026         }; 
     798<a name="l01027"></a>01027  
     799<a name="l01028"></a>01028         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     800<a name="l01029"></a><a class="code" href="classbdm_1_1enorm.html#25785343aff102cc5df1cab08ba16d32">01029</a>         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1enorm.html#25785343aff102cc5df1cab08ba16d32" title="logarithm of the normalizing constant, ">enorm&lt;sq_T&gt;::lognc</a> ()<span class="keyword"> const</span> 
     801<a name="l01030"></a>01030 <span class="keyword">        </span>{ 
     802<a name="l01031"></a>01031                 <span class="comment">// 1.83787706640935 = log(2pi)</span> 
     803<a name="l01032"></a>01032                 <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() ); 
     804<a name="l01033"></a>01033                 <span class="keywordflow">return</span> tmp; 
     805<a name="l01034"></a>01034         }; 
     806<a name="l01035"></a>01035  
     807<a name="l01036"></a>01036         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     808<a name="l01037"></a><a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f">01037</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f" title="Set A and R.">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 ) 
     809<a name="l01038"></a>01038         { 
     810<a name="l01039"></a>01039                 it_assert_debug ( A0.rows() ==mu0.length(),<span class="stringliteral">""</span> ); 
     811<a name="l01040"></a>01040                 it_assert_debug ( A0.rows() ==R0.rows(),<span class="stringliteral">""</span> ); 
     812<a name="l01041"></a>01041  
     813<a name="l01042"></a>01042                 <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 ); 
     814<a name="l01043"></a>01043                 A = A0; 
     815<a name="l01044"></a>01044                 mu_const = mu0; 
     816<a name="l01045"></a>01045                 <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a>=A0.cols(); 
     817<a name="l01046"></a>01046         } 
     818<a name="l01047"></a>01047  
     819<a name="l01048"></a>01048 <span class="comment">// template&lt;class sq_T&gt;</span> 
     820<a name="l01049"></a>01049 <span class="comment">// vec mlnorm&lt;sq_T&gt;::samplecond (const  vec &amp;cond, double &amp;lik ) {</span> 
     821<a name="l01050"></a>01050 <span class="comment">//      this-&gt;condition ( cond );</span> 
     822<a name="l01051"></a>01051 <span class="comment">//      vec smp = epdf.sample();</span> 
     823<a name="l01052"></a>01052 <span class="comment">//      lik = epdf.eval ( smp );</span> 
     824<a name="l01053"></a>01053 <span class="comment">//      return smp;</span> 
     825<a name="l01054"></a>01054 <span class="comment">// }</span> 
     826<a name="l01055"></a>01055  
     827<a name="l01056"></a>01056 <span class="comment">// template&lt;class sq_T&gt;</span> 
     828<a name="l01057"></a>01057 <span class="comment">// mat mlnorm&lt;sq_T&gt;::samplecond (const vec &amp;cond, vec &amp;lik, int n ) {</span> 
     829<a name="l01058"></a>01058 <span class="comment">//      int i;</span> 
     830<a name="l01059"></a>01059 <span class="comment">//      int dim = rv.count();</span> 
     831<a name="l01060"></a>01060 <span class="comment">//      mat Smp ( dim,n );</span> 
     832<a name="l01061"></a>01061 <span class="comment">//      vec smp ( dim );</span> 
     833<a name="l01062"></a>01062 <span class="comment">//      this-&gt;condition ( cond );</span> 
     834<a name="l01063"></a>01063 <span class="comment">//</span> 
     835<a name="l01064"></a>01064 <span class="comment">//      for ( i=0; i&lt;n; i++ ) {</span> 
     836<a name="l01065"></a>01065 <span class="comment">//              smp = epdf.sample();</span> 
     837<a name="l01066"></a>01066 <span class="comment">//              lik ( i ) = epdf.eval ( smp );</span> 
     838<a name="l01067"></a>01067 <span class="comment">//              Smp.set_col ( i ,smp );</span> 
     839<a name="l01068"></a>01068 <span class="comment">//      }</span> 
     840<a name="l01069"></a>01069 <span class="comment">//</span> 
     841<a name="l01070"></a>01070 <span class="comment">//      return Smp;</span> 
     842<a name="l01071"></a>01071 <span class="comment">// }</span> 
     843<a name="l01072"></a>01072  
     844<a name="l01073"></a>01073         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     845<a name="l01074"></a><a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">01074</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#0dafc0196e7e07fd06dc6716e0e18bc2">mlnorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> vec &amp;cond ) 
     846<a name="l01075"></a>01075         { 
     847<a name="l01076"></a>01076                 _mu = A*cond + mu_const; 
     848<a name="l01077"></a>01077 <span class="comment">//R is already assigned;</span> 
     849<a name="l01078"></a>01078         } 
     850<a name="l01079"></a>01079  
     851<a name="l01080"></a>01080         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     852<a name="l01081"></a><a class="code" href="classbdm_1_1enorm.html#c2996bdaffad38fbe0fc776db54c9d80">01081</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_1enorm.html#c2996bdaffad38fbe0fc776db54c9d80" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">enorm&lt;sq_T&gt;::marginal</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span> 
     853<a name="l01082"></a>01082 <span class="keyword">        </span>{ 
     854<a name="l01083"></a>01083                 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> ); 
     855<a name="l01084"></a>01084                 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> ); 
     856<a name="l01085"></a>01085  
     857<a name="l01086"></a>01086                 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> 
     858<a name="l01087"></a>01087  
     859<a name="l01088"></a>01088                 <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>; 
     860<a name="l01089"></a>01089                 tmp-&gt;<a class="code" href="classbdm_1_1epdf.html#f423e28448dbb69ef4905295ec8de8ff" title="Name its rv.">set_rv</a> ( rvn ); 
     861<a name="l01090"></a>01090                 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 ); 
     862<a name="l01091"></a>01091                 <span class="keywordflow">return</span> tmp; 
     863<a name="l01092"></a>01092         } 
     864<a name="l01093"></a>01093  
     865<a name="l01094"></a>01094         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     866<a name="l01095"></a><a class="code" href="classbdm_1_1enorm.html#baea4d49c657342b58297d68cda16d26">01095</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#baea4d49c657342b58297d68cda16d26" title="Return conditional density on the given RV, the remaining rvs will be in conditioning...">enorm&lt;sq_T&gt;::condition</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvn )<span class="keyword"> const</span> 
     867<a name="l01096"></a>01096 <span class="keyword">        </span>{ 
     868<a name="l01097"></a>01097  
     869<a name="l01098"></a>01098                 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> ); 
     870<a name="l01099"></a>01099  
     871<a name="l01100"></a>01100                 <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 ); 
     872<a name="l01101"></a>01101                 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> ); 
     873<a name="l01102"></a>01102                 <span class="comment">//Permutation vector of the new R</span> 
     874<a name="l01103"></a>01103                 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> ); 
     875<a name="l01104"></a>01104                 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> ); 
     876<a name="l01105"></a>01105                 ivec perm=concat ( irvn , irvc ); 
     877<a name="l01106"></a>01106                 sq_T Rn ( <a class="code" href="classbdm_1_1enorm.html#2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>,perm ); 
     878<a name="l01107"></a>01107  
     879<a name="l01108"></a>01108                 <span class="comment">//fixme - could this be done in general for all sq_T?</span> 
     880<a name="l01109"></a>01109                 mat S=Rn.to_mat(); 
     881<a name="l01110"></a>01110                 <span class="comment">//fixme</span> 
     882<a name="l01111"></a>01111                 <span class="keywordtype">int</span> n=rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>()-1; 
     883<a name="l01112"></a>01112                 <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; 
     884<a name="l01113"></a>01113                 mat S11 = S.get ( 0,n, 0, n ); 
     885<a name="l01114"></a>01114                 mat S12 = S.get ( 0, n , rvn.<a class="code" href="classbdm_1_1RV.html#de30156104f61d86c94f758861418089">_dsize</a>(), end ); 
     886<a name="l01115"></a>01115                 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 ); 
     887<a name="l01116"></a>01116  
     888<a name="l01117"></a>01117                 vec mu1 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvn ); 
     889<a name="l01118"></a>01118                 vec mu2 = <a class="code" href="classbdm_1_1enorm.html#c702a194720853570d08b65482f842c7" title="mean value">mu</a> ( irvc ); 
     890<a name="l01119"></a>01119                 mat A=S12*inv ( S22 ); 
     891<a name="l01120"></a>01120                 sq_T R_n ( S11 - A *S12.T() ); 
     892<a name="l01121"></a>01121  
     893<a name="l01122"></a>01122                 <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> ( ); 
     894<a name="l01123"></a>01123                 tmp-&gt;set_rv ( rvn ); tmp-&gt;set_rvc ( rvc ); 
     895<a name="l01124"></a>01124                 tmp-&gt;set_parameters ( A,mu1-A*mu2,R_n ); 
     896<a name="l01125"></a>01125                 <span class="keywordflow">return</span> tmp; 
     897<a name="l01126"></a>01126         } 
     898<a name="l01127"></a>01127  
     899<a name="l01129"></a>01129  
     900<a name="l01130"></a>01130         <span class="keyword">template</span>&lt;<span class="keyword">class</span> sq_T&gt; 
     901<a name="l01131"></a>01131         std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os,  mlnorm&lt;sq_T&gt; &amp;ml ) 
     902<a name="l01132"></a>01132         { 
     903<a name="l01133"></a>01133                 os &lt;&lt; <span class="stringliteral">"A:"</span>&lt;&lt; ml.A&lt;&lt;endl; 
     904<a name="l01134"></a>01134                 os &lt;&lt; <span class="stringliteral">"mu:"</span>&lt;&lt; ml.mu_const&lt;&lt;endl; 
     905<a name="l01135"></a>01135                 os &lt;&lt; <span class="stringliteral">"R:"</span> &lt;&lt; ml.epdf._R().to_mat() &lt;&lt;endl; 
     906<a name="l01136"></a>01136                 <span class="keywordflow">return</span> os; 
     907<a name="l01137"></a>01137         }; 
     908<a name="l01138"></a>01138  
     909<a name="l01139"></a>01139 } 
     910<a name="l01140"></a>01140 <span class="preprocessor">#endif //EF_H</span> 
    913911</pre></div></div> 
    914 <hr size="1"><address style="text-align: right;"><small>Generated on Wed Apr 8 16:12:31 2009 for mixpp by&nbsp; 
     912<hr size="1"><address style="text-align: right;"><small>Generated on Thu Apr 9 14:33:20 2009 for mixpp by&nbsp; 
    915913<a href="http://www.doxygen.org/index.html"> 
    916914<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>