Show
Ignore:
Timestamp:
09/12/09 11:41:43 (15 years ago)
Author:
smidl
Message:

doc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/html/emix_8h_source.html

    r591 r608  
    9191<a name="l00055"></a>00055                 <span class="comment">// adjust rv and rvc</span> 
    9292<a name="l00056"></a>00056                 <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a> = nom0-&gt;<a class="code" href="classbdm_1_1epdf.html#aa4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>().<a class="code" href="classbdm_1_1RV.html#aaec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> ( rv ); 
    93 <a name="l00057"></a>00057                 <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>._dsize(); 
     93<a name="l00057"></a>00057                 <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(); 
    9494<a name="l00058"></a>00058                 <a class="code" href="classbdm_1_1mpdf.html#a147afacb393324bb3f9a7a89e33f835e" title="set internal pointer ep to point to given iepdf ">set_ep</a> ( <a class="code" href="classbdm_1_1mratio.html#a7a676422bc6cc426ffa6fddf52672409" title="dummy epdf that stores only rv and dim">iepdf</a> ); 
    95 <a name="l00059"></a>00059                 <a class="code" href="classbdm_1_1mratio.html#a7a676422bc6cc426ffa6fddf52672409" title="dummy epdf that stores only rv and dim">iepdf</a>.set_parameters ( rv._dsize() ); 
     95<a name="l00059"></a>00059                 <a class="code" href="classbdm_1_1mratio.html#a7a676422bc6cc426ffa6fddf52672409" title="dummy epdf that stores only rv and dim">iepdf</a>.set_parameters ( rv.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() ); 
    9696<a name="l00060"></a>00060                 <a class="code" href="classbdm_1_1mratio.html#a7a676422bc6cc426ffa6fddf52672409" title="dummy epdf that stores only rv and dim">iepdf</a>.<a class="code" href="classbdm_1_1epdf.html#af423e28448dbb69ef4905295ec8de8ff" title="Name its rv.">set_rv</a> ( rv ); 
    9797<a name="l00061"></a>00061  
     
    104104<a name="l00068"></a>00068                         <a class="code" href="classbdm_1_1mratio.html#a51bfe6675e724f7fbeaaeacce5a9f9b8" title="flag for destructor">destroynom</a> = <span class="keyword">false</span>; 
    105105<a name="l00069"></a>00069                 } 
    106 <a name="l00070"></a>00070                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.length() &gt; 0, <span class="stringliteral">&quot;Makes no sense to use this object!&quot;</span> ); 
     106<a name="l00070"></a>00070                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.<a class="code" href="classbdm_1_1RV.html#ae9ec8c3e756651ff352ab5e3d3acda4b" title="Number of named parts.">length</a>() &gt; 0, <span class="stringliteral">&quot;Makes no sense to use this object!&quot;</span> ); 
    107107<a name="l00071"></a>00071  
    108108<a name="l00072"></a>00072                 <span class="comment">// build denominator</span> 
     
    114114<a name="l00078"></a>00078                 vec nom_val ( dimension() + <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> ); 
    115115<a name="l00079"></a>00079                 <a class="code" href="classbdm_1_1mratio.html#acda5bd23ba60146d69e1f804ff7710c7" title="datalink between conditional and nom">dl</a>.<a class="code" href="classbdm_1_1datalink__m2e.html#ab29bc3c7bf2a1d87e77ccaa793d097d5" title="Copy corresponding values to Up.condition.">pushup_cond</a> ( nom_val, val, cond ); 
    116 <a name="l00080"></a>00080                 tmp = exp ( <a class="code" href="classbdm_1_1mratio.html#af31caba90a2aa10fbf7631832404fe54" title="Nominator in the form of mpdf.">nom</a>-&gt;<a class="code" href="classbdm_1_1epdf.html#adeab266d63c236c277538867d5c3f249">evallog</a> ( nom_val ) - <a class="code" href="classbdm_1_1mratio.html#a873598797f36eddab44e342e14563fcb" title="Denominator in the form of epdf.">den</a>-&gt;evallog ( cond ) ); 
     116<a name="l00080"></a>00080                 tmp = exp ( <a class="code" href="classbdm_1_1mratio.html#af31caba90a2aa10fbf7631832404fe54" title="Nominator in the form of mpdf.">nom</a>-&gt;<a class="code" href="classbdm_1_1epdf.html#adeab266d63c236c277538867d5c3f249" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( nom_val ) - <a class="code" href="classbdm_1_1mratio.html#a873598797f36eddab44e342e14563fcb" title="Denominator in the form of epdf.">den</a>-&gt;evallog ( cond ) ); 
    117117<a name="l00081"></a>00081                 <span class="keywordflow">return</span> tmp; 
    118118<a name="l00082"></a>00082         } 
     
    161161<a name="l00146"></a>00146                 <span class="keywordflow">return</span> mom2 - pow ( <a class="code" href="classbdm_1_1emix.html#aa3a5390bc56e81ef3b0debc0f185fa8a" title="return expected value">mean</a>(), 2 ); 
    162162<a name="l00147"></a>00147         } 
    163 <a name="l00148"></a><a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">00148</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{ 
     163<a name="l00148"></a><a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">00148</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{ 
    164164<a name="l00149"></a>00149                 <span class="keywordtype">int</span> i; 
    165165<a name="l00150"></a>00150                 <span class="keywordtype">double</span> sum = 0.0; 
    166166<a name="l00151"></a>00151                 <span class="keywordflow">for</span> ( i = 0; i &lt; <a class="code" href="classbdm_1_1emix.html#abb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length(); i++ ) { 
    167 <a name="l00152"></a>00152                         sum += <a class="code" href="classbdm_1_1emix.html#abb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * exp ( <a class="code" href="classbdm_1_1emix.html#a866e75dacba151942ead95104e57a897" title="Component (epdfs).">Coms</a> ( i )-&gt;<a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">evallog</a> ( val ) ); 
     167<a name="l00152"></a>00152                         sum += <a class="code" href="classbdm_1_1emix.html#abb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * exp ( <a class="code" href="classbdm_1_1emix.html#a866e75dacba151942ead95104e57a897" title="Component (epdfs).">Coms</a> ( i )-&gt;<a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( val ) ); 
    168168<a name="l00153"></a>00153                 } 
    169169<a name="l00154"></a>00154                 <span class="keywordflow">if</span> ( sum == 0.0 ) { 
     
    356356<a name="l00389"></a>00389                                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( independent, <span class="stringliteral">&quot;eprod:: given components are not independent.&quot;</span> ); 
    357357<a name="l00390"></a>00390                         } 
    358 <a name="l00391"></a>00391                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>._dsize(); 
     358<a name="l00391"></a>00391                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(); 
    359359<a name="l00392"></a>00392                 } <span class="keywordflow">else</span> { 
    360360<a name="l00393"></a>00393                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = 0; 
     
    403403<a name="l00436"></a>00436                 <span class="keywordflow">return</span> tmp; 
    404404<a name="l00437"></a>00437         } 
    405 <a name="l00438"></a><a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2">00438</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{ 
     405<a name="l00438"></a><a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2">00438</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{ 
    406406<a name="l00439"></a>00439                 <span class="keywordtype">double</span> tmp = 0; 
    407407<a name="l00440"></a>00440                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) { 
     
    440440<a name="l00484"></a>00484                         <a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>.set_parameters(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rv()._dsize()); 
    441441<a name="l00485"></a>00485                         set_rvc(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rvc()); 
    442 <a name="l00486"></a>00486                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>._dsize(); 
     442<a name="l00486"></a>00486                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(); 
    443443<a name="l00487"></a>00487                 } 
    444444<a name="l00488"></a>00488         } 
     
    458458<a name="l00502"></a>00502 <span class="preprocessor">#endif //MX_H</span> 
    459459</pre></div></div> 
    460 <hr size="1"/><address style="text-align: right;"><small>Generated on Sun Aug 30 22:10:49 2009 for mixpp by&nbsp; 
     460<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Sep 8 22:11:32 2009 for mixpp by&nbsp; 
    461461<a href="http://www.doxygen.org/index.html"> 
    462462<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>