Index: doc/html/merger_8h-source.html
===================================================================
--- doc/html/merger_8h-source.html (revision 287)
+++ doc/html/merger_8h-source.html (revision 290)
@@ -2,8 +2,8 @@
 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
 <title>mixpp: merger.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css">
 <link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
 </head><body>
-<!-- Generated by Doxygen 1.5.6 -->
+<!-- Generated by Doxygen 1.5.8 -->
 <script type="text/javascript">
 <!--
@@ -53,6 +53,12 @@
       <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
       <li><a href="modules.html"><span>Modules</span></a></li>
-      <li><a href="classes.html"><span>Classes</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
       <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
+      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
     </ul>
   </div>
@@ -84,89 +90,91 @@
 <a name="l00052"></a>00052                         <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a> ( Array&lt;<a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>*&gt; ( 0 ),vec ( 0 ) ), <a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>() {
 <a name="l00053"></a>00053                 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> ztmp;
-<a name="l00054"></a>00054                 <span class="comment">// Extend rv by rvc!</span>
-<a name="l00055"></a>00055                 <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_1compositepdf.html#c71fc2c51f49d797e61f479f543c75ce" title="common rvc of all mpdfs is written to rvc">setrvc</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>,rvc );
-<a name="l00056"></a>00056                 <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#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( rvc );
-<a name="l00057"></a>00057                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>;i++ ) {
-<a name="l00058"></a>00058                         <span class="comment">//Establich connection between mpdfs and merger</span>
-<a name="l00059"></a>00059                         <a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a> ( i ) = <span class="keyword">new</span> <a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a> ( <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;<a class="code" href="classbdm_1_1epdf.html#a4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>(), <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;_rvc(), <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
-<a name="l00060"></a>00060                         <span class="comment">// find out what is missing in each mpdf</span>
-<a name="l00061"></a>00061                         ztmp= <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;_rv();
-<a name="l00062"></a>00062                         ztmp.<a class="code" href="classbdm_1_1RV.html#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;_rvc() );
-<a name="l00063"></a>00063                         <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ) =<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> ( ztmp );
-<a name="l00064"></a>00064                         <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i ) = <span class="keyword">new</span> <a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a> ( <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ), ztmp, <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> ) ;
-<a name="l00065"></a>00065                 };
-<a name="l00066"></a>00066                 <span class="comment">//Set Default values of parameters</span>
-<a name="l00067"></a>00067                 <a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d" title="Prior on the log-normal merging model.">beta</a>=2.0;
-<a name="l00068"></a>00068                 <a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>=100;
-<a name="l00069"></a>00069                 <a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d" title="Number of components in a mixture.">Nc</a>=10;
-<a name="l00070"></a>00070                 <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577" title="Set which method is to be used.">set_method</a> ( EM );
-<a name="l00071"></a>00071         }
-<a name="l00073"></a><a class="code" href="classbdm_1_1merger.html#bc867c8e2b4709041bf8802ae9c78e37">00073</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#bc867c8e2b4709041bf8802ae9c78e37" title="Set internal parameters used in approximation.">set_parameters</a> ( <span class="keywordtype">double</span> beta0, <span class="keywordtype">int</span> Ns0, <span class="keywordtype">int</span> Nc0 ) {<a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d" title="Prior on the log-normal merging model.">beta</a>=beta0;<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>=Ns0;<a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d" title="Number of components in a mixture.">Nc</a>=Nc0;<a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c74c281d652356c19b6b079e42ca7ef1" title="Set sample.">set_parameters</a>(Ns0,<span class="keyword">false</span>);}
-<a name="l00075"></a><a class="code" href="classbdm_1_1merger.html#8ae79a651e93d6e2d611556001af8aa8">00075</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#8ae79a651e93d6e2d611556001af8aa8" title="Initialize the proposal density. This function must be called before merge()!">init</a>() { 
-<a name="l00076"></a>00076                 Array&lt;vec&gt; Smps ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> );
-<a name="l00077"></a>00077                 <span class="comment">//Gibbs sampling</span>
-<a name="l00078"></a>00078                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>;i++ ) {Smps ( i ) =zeros ( 0 );}
-<a name="l00079"></a>00079         }
-<a name="l00081"></a>00081         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</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>* g0 );
-<a name="l00083"></a><a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2">00083</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</a> () {<a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</a> ( &amp; ( <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#4830916adef7891a207e42f39aaf787b">posterior</a>() ) );};
-<a name="l00084"></a>00084 
-<a name="l00086"></a>00086         vec <a class="code" href="classbdm_1_1merger.html#b90f1b8a21a693176dd953a3b983aa0b" title="Merge log-likelihood values.">lognorm_merge</a> ( mat &amp;lW );
-<a name="l00089"></a><a class="code" href="classbdm_1_1merger.html#0ef73e76eeee44c8e3896e3a271ad974">00089</a>         vec <a class="code" href="classbdm_1_1merger.html#0ef73e76eeee44c8e3896e3a271ad974">sample</a> ( )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#4830916adef7891a207e42f39aaf787b">posterior</a>().<a class="code" href="classbdm_1_1epdf.html#75ba57a89681a8efec488f5796c7cc1b" title="Returns a sample,  from density .">sample</a>();}
-<a name="l00090"></a><a class="code" href="classbdm_1_1merger.html#c47543661897638cab9f506c76a1f92f">00090</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1merger.html#c47543661897638cab9f506c76a1f92f" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &amp;dt )<span class="keyword"> const </span>{
-<a name="l00091"></a>00091                 vec dtf=ones ( dt.length() +1 );
-<a name="l00092"></a>00092                 dtf.set_subvector ( 0,dt );
-<a name="l00093"></a>00093                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#da724da464a75e07521941e430929efa">logpred</a> ( dtf );
-<a name="l00094"></a>00094         }
-<a name="l00095"></a><a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5">00095</a>         vec <a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5" title="return expected value">mean</a>()<span class="keyword"> const </span>{
-<a name="l00096"></a>00096                 <span class="keyword">const</span> Vec&lt;double&gt; &amp;w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>();
-<a name="l00097"></a>00097                 <span class="keyword">const</span> Array&lt;vec&gt; &amp;S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>();
-<a name="l00098"></a>00098                 vec tmp=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>); 
-<a name="l00099"></a>00099                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>; i++ ) {
-<a name="l00100"></a>00100                         tmp+=w ( i ) *S ( i );
-<a name="l00101"></a>00101                 }
-<a name="l00102"></a>00102                 <span class="keywordflow">return</span> tmp;
-<a name="l00103"></a>00103         }
-<a name="l00104"></a>00104         mat covariance()<span class="keyword"> const </span>{
-<a name="l00105"></a>00105                 <span class="keyword">const</span> vec &amp;w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>();
-<a name="l00106"></a>00106                 <span class="keyword">const</span> Array&lt;vec&gt; &amp;S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>();
-<a name="l00107"></a>00107                 
-<a name="l00108"></a>00108                 vec mea = <a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5" title="return expected value">mean</a>(); 
+<a name="l00054"></a>00054                 <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> = <a class="code" href="classbdm_1_1compositepdf.html#c73d39acc4378eee6a63155c3517d3c9" title="find common rv, flag">getrv</a>(<span class="keyword">false</span>);
+<a name="l00055"></a>00055                 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</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>();
+<a name="l00056"></a>00056                 <span class="comment">// Extend rv by rvc!</span>
+<a name="l00057"></a>00057                 <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_1compositepdf.html#c71fc2c51f49d797e61f479f543c75ce" title="common rvc of all mpdfs is written to rvc">setrvc</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>,rvc );
+<a name="l00058"></a>00058                 <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#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( rvc );
+<a name="l00059"></a>00059                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>;i++ ) {
+<a name="l00060"></a>00060                         <span class="comment">//Establich connection between mpdfs and merger</span>
+<a name="l00061"></a>00061                         <a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a> ( i ) = <span class="keyword">new</span> <a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a>;<a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a>(i)-&gt;set_connection( <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;<a class="code" href="classbdm_1_1epdf.html#a4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>(), <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;_rvc(), <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
+<a name="l00062"></a>00062                         <span class="comment">// find out what is missing in each mpdf</span>
+<a name="l00063"></a>00063                         ztmp= <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;_rv();
+<a name="l00064"></a>00064                         ztmp.<a class="code" href="classbdm_1_1RV.html#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )-&gt;_rvc() );
+<a name="l00065"></a>00065                         <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ) =<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> ( ztmp );
+<a name="l00066"></a>00066                         <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i ) = <span class="keyword">new</span> <a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a>; <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a>(i)-&gt;set_connection ( <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ), ztmp, <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> ) ;
+<a name="l00067"></a>00067                 };
+<a name="l00068"></a>00068                 <span class="comment">//Set Default values of parameters</span>
+<a name="l00069"></a>00069                 <a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d" title="Prior on the log-normal merging model.">beta</a>=2.0;
+<a name="l00070"></a>00070                 <a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>=100;
+<a name="l00071"></a>00071                 <a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d" title="Number of components in a mixture.">Nc</a>=10;
+<a name="l00072"></a>00072                 <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577" title="Set which method is to be used.">set_method</a> ( EM );
+<a name="l00073"></a>00073         }
+<a name="l00075"></a><a class="code" href="classbdm_1_1merger.html#bc867c8e2b4709041bf8802ae9c78e37">00075</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#bc867c8e2b4709041bf8802ae9c78e37" title="Set internal parameters used in approximation.">set_parameters</a> ( <span class="keywordtype">double</span> beta0, <span class="keywordtype">int</span> Ns0, <span class="keywordtype">int</span> Nc0 ) {<a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d" title="Prior on the log-normal merging model.">beta</a>=beta0;<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>=Ns0;<a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d" title="Number of components in a mixture.">Nc</a>=Nc0;<a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c74c281d652356c19b6b079e42ca7ef1" title="Set sample.">set_parameters</a>(Ns0,<span class="keyword">false</span>);}
+<a name="l00077"></a><a class="code" href="classbdm_1_1merger.html#8ae79a651e93d6e2d611556001af8aa8">00077</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#8ae79a651e93d6e2d611556001af8aa8" title="Initialize the proposal density. This function must be called before merge()!">init</a>() { 
+<a name="l00078"></a>00078                 Array&lt;vec&gt; Smps ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> );
+<a name="l00079"></a>00079                 <span class="comment">//Gibbs sampling</span>
+<a name="l00080"></a>00080                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>;i++ ) {Smps ( i ) =zeros ( 0 );}
+<a name="l00081"></a>00081         }
+<a name="l00083"></a>00083         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</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>* g0 );
+<a name="l00085"></a><a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2">00085</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</a> () {<a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</a> ( &amp; ( <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#4830916adef7891a207e42f39aaf787b">posterior</a>() ) );};
+<a name="l00086"></a>00086 
+<a name="l00088"></a>00088         vec <a class="code" href="classbdm_1_1merger.html#b90f1b8a21a693176dd953a3b983aa0b" title="Merge log-likelihood values.">lognorm_merge</a> ( mat &amp;lW );
+<a name="l00091"></a><a class="code" href="classbdm_1_1merger.html#0ef73e76eeee44c8e3896e3a271ad974">00091</a>         vec <a class="code" href="classbdm_1_1merger.html#0ef73e76eeee44c8e3896e3a271ad974">sample</a> ( )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#4830916adef7891a207e42f39aaf787b">posterior</a>().<a class="code" href="classbdm_1_1epdf.html#75ba57a89681a8efec488f5796c7cc1b" title="Returns a sample,  from density .">sample</a>();}
+<a name="l00092"></a><a class="code" href="classbdm_1_1merger.html#c47543661897638cab9f506c76a1f92f">00092</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1merger.html#c47543661897638cab9f506c76a1f92f" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &amp;dt )<span class="keyword"> const </span>{
+<a name="l00093"></a>00093                 vec dtf=ones ( dt.length() +1 );
+<a name="l00094"></a>00094                 dtf.set_subvector ( 0,dt );
+<a name="l00095"></a>00095                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#da724da464a75e07521941e430929efa">logpred</a> ( dtf );
+<a name="l00096"></a>00096         }
+<a name="l00097"></a><a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5">00097</a>         vec <a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5" title="return expected value">mean</a>()<span class="keyword"> const </span>{
+<a name="l00098"></a>00098                 <span class="keyword">const</span> Vec&lt;double&gt; &amp;w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>();
+<a name="l00099"></a>00099                 <span class="keyword">const</span> Array&lt;vec&gt; &amp;S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>();
+<a name="l00100"></a>00100                 vec tmp=zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>); 
+<a name="l00101"></a>00101                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>; i++ ) {
+<a name="l00102"></a>00102                         tmp+=w ( i ) *S ( i );
+<a name="l00103"></a>00103                 }
+<a name="l00104"></a>00104                 <span class="keywordflow">return</span> tmp;
+<a name="l00105"></a>00105         }
+<a name="l00106"></a>00106         mat covariance()<span class="keyword"> const </span>{
+<a name="l00107"></a>00107                 <span class="keyword">const</span> vec &amp;w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>();
+<a name="l00108"></a>00108                 <span class="keyword">const</span> Array&lt;vec&gt; &amp;S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>();
 <a name="l00109"></a>00109                 
-<a name="l00110"></a>00110                 cout &lt;&lt; sum(w) &lt;&lt; <span class="stringliteral">","</span> &lt;&lt; w*w &lt;&lt;endl;
+<a name="l00110"></a>00110                 vec mea = <a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5" title="return expected value">mean</a>(); 
 <a name="l00111"></a>00111                 
-<a name="l00112"></a>00112                 mat Tmp=zeros(<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l00113"></a>00113                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>; i++ ) {
-<a name="l00114"></a>00114                         Tmp+=w ( i ) *outer_product(S ( i ), S(i));
-<a name="l00115"></a>00115                 }
-<a name="l00116"></a>00116                 <span class="keywordflow">return</span> Tmp-outer_product(mea,mea);
-<a name="l00117"></a>00117         }
-<a name="l00118"></a><a class="code" href="classbdm_1_1merger.html#bcef70ece256b1ab1fa7a3a354eb1cc4">00118</a>         vec <a class="code" href="classbdm_1_1merger.html#bcef70ece256b1ab1fa7a3a354eb1cc4" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
-<a name="l00119"></a>00119                 <span class="keyword">const</span> vec &amp;w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>();
-<a name="l00120"></a>00120                 <span class="keyword">const</span> Array&lt;vec&gt; &amp;S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>();
-<a name="l00121"></a>00121                 
-<a name="l00122"></a>00122                 vec tmp=zeros(<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
-<a name="l00123"></a>00123                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;Ns; i++ ) {
-<a name="l00124"></a>00124                         tmp+=w ( i ) *pow(S ( i ),2);
-<a name="l00125"></a>00125                 }
-<a name="l00126"></a>00126                 <span class="keywordflow">return</span> tmp-pow(<a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5" title="return expected value">mean</a>(),2);
-<a name="l00127"></a>00127         }
-<a name="l00129"></a><a class="code" href="classbdm_1_1merger.html#febef179bb5e074ae6e34d15b4596273">00129</a>         <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1merger.html#febef179bb5e074ae6e34d15b4596273" title="for future use">~merger</a>() {
-<a name="l00130"></a>00130                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>; i++ ) {
-<a name="l00131"></a>00131                         <span class="keyword">delete</span> <a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a> ( i );
-<a name="l00132"></a>00132                         <span class="keyword">delete</span> <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i );
-<a name="l00133"></a>00133                 }
-<a name="l00134"></a>00134         };
-<a name="l00135"></a>00135 
-<a name="l00137"></a><a class="code" href="classbdm_1_1merger.html#13f8534f626a37bed91a6d9db54d6d2f">00137</a>         <a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>&amp; <a class="code" href="classbdm_1_1merger.html#13f8534f626a37bed91a6d9db54d6d2f" title="Access function.">_Mix</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>;}
-<a name="l00139"></a><a class="code" href="classbdm_1_1merger.html#23f5f8b80df579b05681006fbcfe3699">00139</a>         <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a>&amp; <a class="code" href="classbdm_1_1merger.html#23f5f8b80df579b05681006fbcfe3699" title="Access function.">_Smp</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>;}
-<a name="l00140"></a>00140 };
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142 }
+<a name="l00112"></a>00112                 cout &lt;&lt; sum(w) &lt;&lt; <span class="stringliteral">","</span> &lt;&lt; w*w &lt;&lt;endl;
+<a name="l00113"></a>00113                 
+<a name="l00114"></a>00114                 mat Tmp=zeros(<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l00115"></a>00115                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>; i++ ) {
+<a name="l00116"></a>00116                         Tmp+=w ( i ) *outer_product(S ( i ), S(i));
+<a name="l00117"></a>00117                 }
+<a name="l00118"></a>00118                 <span class="keywordflow">return</span> Tmp-outer_product(mea,mea);
+<a name="l00119"></a>00119         }
+<a name="l00120"></a><a class="code" href="classbdm_1_1merger.html#bcef70ece256b1ab1fa7a3a354eb1cc4">00120</a>         vec <a class="code" href="classbdm_1_1merger.html#bcef70ece256b1ab1fa7a3a354eb1cc4" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
+<a name="l00121"></a>00121                 <span class="keyword">const</span> vec &amp;w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>();
+<a name="l00122"></a>00122                 <span class="keyword">const</span> Array&lt;vec&gt; &amp;S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>();
+<a name="l00123"></a>00123                 
+<a name="l00124"></a>00124                 vec tmp=zeros(<a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>);
+<a name="l00125"></a>00125                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;Ns; i++ ) {
+<a name="l00126"></a>00126                         tmp+=w ( i ) *pow(S ( i ),2);
+<a name="l00127"></a>00127                 }
+<a name="l00128"></a>00128                 <span class="keywordflow">return</span> tmp-pow(<a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5" title="return expected value">mean</a>(),2);
+<a name="l00129"></a>00129         }
+<a name="l00131"></a><a class="code" href="classbdm_1_1merger.html#febef179bb5e074ae6e34d15b4596273">00131</a>         <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1merger.html#febef179bb5e074ae6e34d15b4596273" title="for future use">~merger</a>() {
+<a name="l00132"></a>00132                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i&lt;<a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>; i++ ) {
+<a name="l00133"></a>00133                         <span class="keyword">delete</span> <a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a> ( i );
+<a name="l00134"></a>00134                         <span class="keyword">delete</span> <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i );
+<a name="l00135"></a>00135                 }
+<a name="l00136"></a>00136         };
+<a name="l00137"></a>00137 
+<a name="l00139"></a><a class="code" href="classbdm_1_1merger.html#13f8534f626a37bed91a6d9db54d6d2f">00139</a>         <a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>&amp; <a class="code" href="classbdm_1_1merger.html#13f8534f626a37bed91a6d9db54d6d2f" title="Access function.">_Mix</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>;}
+<a name="l00141"></a><a class="code" href="classbdm_1_1merger.html#23f5f8b80df579b05681006fbcfe3699">00141</a>         <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a>&amp; <a class="code" href="classbdm_1_1merger.html#23f5f8b80df579b05681006fbcfe3699" title="Access function.">_Smp</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>;}
+<a name="l00142"></a>00142 };
 <a name="l00143"></a>00143 
-<a name="l00144"></a>00144 <span class="preprocessor">#endif // MER_H</span>
+<a name="l00144"></a>00144 }
+<a name="l00145"></a>00145 
+<a name="l00146"></a>00146 <span class="preprocessor">#endif // MER_H</span>
 </pre></div></div>
-<hr size="1"><address style="text-align: right;"><small>Generated on Wed Mar 4 18:50:11 2009 for mixpp by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 6 15:01:36 2009 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
+<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
 </body>
 </html>
