Changeset 608 for library/doc/html/exp__family_8h_source.html
- Timestamp:
- 09/12/09 11:41:43 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/doc/html/exp__family_8h_source.html
r591 r608 156 156 <a name="l00134"></a>00134 <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a> (<span class="keyword">const</span> vec &<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>, <span class="keyword">const</span> sq_T &<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>) {set_parameters (mu, R);} 157 157 <a name="l00135"></a>00135 <span class="keywordtype">void</span> set_parameters (<span class="keyword">const</span> vec &<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>, <span class="keyword">const</span> sq_T &<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>); 158 <a name="l00136"></a>00136 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" >from_setting</a> (<span class="keyword">const</span> Setting &root);158 <a name="l00136"></a>00136 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" title="Load from structure with elements:.">from_setting</a> (<span class="keyword">const</span> Setting &root); 159 159 <a name="l00137"></a><a class="code" href="classbdm_1_1enorm.html#a38eb17ecb75d94a50b6782fcf735cfea">00137</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a38eb17ecb75d94a50b6782fcf735cfea" title="This method TODO.">validate</a>() { 160 160 <a name="l00138"></a>00138 <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_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>.length() == <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.rows(), <span class="stringliteral">"parameters mismatch"</span>); … … 242 242 <a name="l00247"></a>00247 <span class="keywordtype">double</span>& _nu() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egiw.html#a447eacf19d4f4083872686f044814dc4" title="Number of data records (degrees of freedom) of sufficient statistics.">nu</a>;} 243 243 <a name="l00248"></a>00248 <span class="keyword">const</span> <span class="keywordtype">double</span>& _nu()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egiw.html#a447eacf19d4f4083872686f044814dc4" title="Number of data records (degrees of freedom) of sufficient statistics.">nu</a>;} 244 <a name="l00249"></a><a class="code" href="classbdm_1_1egiw.html#a55b76ec75bd2df5ef9cab3be20a33bbb">00249</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiw.html#a55b76ec75bd2df5ef9cab3be20a33bbb" >from_setting</a> (<span class="keyword">const</span> Setting &<span class="keyword">set</span>) {244 <a name="l00249"></a><a class="code" href="classbdm_1_1egiw.html#a55b76ec75bd2df5ef9cab3be20a33bbb">00249</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiw.html#a55b76ec75bd2df5ef9cab3be20a33bbb" title="Load from structure with elements:.">from_setting</a> (<span class="keyword">const</span> Setting &<span class="keyword">set</span>) { 245 245 <a name="l00250"></a>00250 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1egiw.html#a447eacf19d4f4083872686f044814dc4" title="Number of data records (degrees of freedom) of sufficient statistics.">nu</a>, <span class="keyword">set</span>, <span class="stringliteral">"nu"</span>, UI::compulsory); 246 246 <a name="l00251"></a>00251 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1egiw.html#a23e4d78bea7e98840f3da30e76a2b57a" title="Dimension of the output.">dimx</a>, <span class="keyword">set</span>, <span class="stringliteral">"dimx"</span>, UI::compulsory); … … 414 414 <a name="l00498"></a>00498 } 415 415 <a name="l00500"></a>00500 416 <a name="l00501"></a><a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81">00501</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81" >evallog</a> (<span class="keyword">const</span> vec &val)<span class="keyword"> const </span>{416 <a name="l00501"></a><a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81">00501</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1euni.html#acaa07b8307bd793d5339d6583e0aba81" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> (<span class="keyword">const</span> vec &val)<span class="keyword"> const </span>{ 417 417 <a name="l00502"></a>00502 <span class="keywordflow">if</span> (any (val < <a class="code" href="classbdm_1_1euni.html#aff7ce6a2ef5ef0015bbd1398bed12f32" title="lower bound on support">low</a>) && any (val > <a class="code" href="classbdm_1_1euni.html#acfad2dea4a62db6872bda8abd75f0de1" title="upper bound on support">high</a>)) {<span class="keywordflow">return</span> inf;} 418 418 <a name="l00503"></a>00503 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1euni.html#a3e63be48dd58659663ca60cd18700476" title="cache of log( nk )">lnk</a>; … … 462 462 <a name="l00568"></a>00568 } 463 463 <a name="l00569"></a>00569 464 <a name="l00571"></a><a class="code" href="classbdm_1_1mlnorm.html#a 6332e5200f3afa15db3f7f4bca09b17f">00571</a> vec& <a class="code" href="classbdm_1_1mlnorm.html#a6332e5200f3afa15db3f7f4bca09b17f" title="access function">_mu_const</a>(){<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;}465 <a name="l00573"></a><a class="code" href="classbdm_1_1mlnorm.html#a b256b547c5156b5898a3a1e5462f9540">00573</a> mat& <a class="code" href="classbdm_1_1mlnorm.html#ab256b547c5156b5898a3a1e5462f9540" title="access function">_A</a>(){<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>;}466 <a name="l00575"></a><a class="code" href="classbdm_1_1mlnorm.html#a 564715dea56f7bbff0083aec295ce97e">00575</a> mat <a class="code" href="classbdm_1_1mlnorm.html#a564715dea56f7bbff0083aec295ce97e" title="access function">_R</a>(){ <span class="keywordflow">return</span> this-><a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._R().to_mat(); }464 <a name="l00571"></a><a class="code" href="classbdm_1_1mlnorm.html#af6b0b4b0b17271525ad02660a4087cf7">00571</a> <span class="keyword">const</span> vec& <a class="code" href="classbdm_1_1mlnorm.html#af6b0b4b0b17271525ad02660a4087cf7" title="access function">_mu_const</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#a831b50121cad10aa03a16682bd0c3ed6" title="Constant additive term.">mu_const</a>;} 465 <a name="l00573"></a><a class="code" href="classbdm_1_1mlnorm.html#a55e1bd7fa70b852bd7fe50ce72fb8f23">00573</a> <span class="keyword">const</span> mat& <a class="code" href="classbdm_1_1mlnorm.html#a55e1bd7fa70b852bd7fe50ce72fb8f23" title="access function">_A</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>;} 466 <a name="l00575"></a><a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43">00575</a> mat <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-><a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._R().to_mat(); } 467 467 <a name="l00576"></a>00576 468 468 <a name="l00578"></a>00578 <span class="keyword">template</span><<span class="keyword">typename</span> sq_M> 469 469 <a name="l00579"></a>00579 <span class="keyword">friend</span> std::ostream &operator<< (std::ostream &os, mlnorm<sq_M, enorm> &ml); 470 470 <a name="l00580"></a>00580 471 <a name="l00581"></a><a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564">00581</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" >from_setting</a> (<span class="keyword">const</span> Setting &<span class="keyword">set</span>) {472 <a name="l00582"></a>00582 <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" >mpdf::from_setting</a> (<span class="keyword">set</span>);471 <a name="l00581"></a><a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564">00581</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" title="Load from structure with elements:.">from_setting</a> (<span class="keyword">const</span> Setting &<span class="keyword">set</span>) { 472 <a name="l00582"></a>00582 <a class="code" href="classbdm_1_1mlnorm.html#a52980f13d80162d00b30d5864343f564" title="Load from structure with elements:.">mpdf::from_setting</a> (<span class="keyword">set</span>); 473 473 <a name="l00583"></a>00583 474 474 <a name="l00584"></a>00584 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1mlnorm.html#ac71bbf59fc732beb2b459d7117bd6e42" title="Internal epdf that arise by conditioning on rvc.">A</a>, <span class="keyword">set</span>, <span class="stringliteral">"A"</span>, UI::compulsory); … … 496 496 <a name="l00608"></a><a class="code" href="classbdm_1_1mgnorm.html#a1b014915d74470d3efab74e07cacb97d">00608</a> <a class="code" href="classbdm_1_1mgnorm.html#a1b014915d74470d3efab74e07cacb97d" title="default constructor">mgnorm</a>() : <a class="code" href="classbdm_1_1mpdf__internal.html" title="Mpdf with internal epdf that is modified by function condition.">mpdf_internal</a><<a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a><sq_T> >() { } 497 497 <a name="l00610"></a>00610 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab736332d20e418bf50d45836e129f339" title="set mean function">set_parameters</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr<fnc></a> &g0, <span class="keyword">const</span> sq_T &R0); 498 <a name="l00611"></a>00611 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" >condition</a> (<span class="keyword">const</span> vec &cond);498 <a name="l00611"></a>00611 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &cond); 499 499 <a name="l00612"></a>00612 500 500 <a name="l00613"></a>00613 … … 521 521 <a name="l00668"></a>00668 <span class="keyword">protected</span>: 522 522 <a name="l00670"></a><a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657">00670</a> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable from theory.">Lambda</a>; 523 <a name="l00672"></a><a class="code" href="classbdm_1_1mlstudent.html#a72e9bda4d6684e07faafc4b2192daf39">00672</a> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &<a class="code" href="classbdm_1_1mlnorm.html#a 564715dea56f7bbff0083aec295ce97e" title="access function">_R</a>;523 <a name="l00672"></a><a class="code" href="classbdm_1_1mlstudent.html#a72e9bda4d6684e07faafc4b2192daf39">00672</a> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &<a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>; 524 524 <a name="l00674"></a><a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8">00674</a> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a>; 525 525 <a name="l00675"></a>00675 <span class="keyword">public</span>: 526 526 <a name="l00676"></a>00676 <a class="code" href="classbdm_1_1mlstudent.html">mlstudent</a> () : <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm</a><<a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>, <a class="code" href="classbdm_1_1enorm.html" title="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</a>> (), 527 <a name="l00677"></a>00677 <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable from theory.">Lambda</a> (), <a class="code" href="classbdm_1_1mlnorm.html#a 564715dea56f7bbff0083aec295ce97e" title="access function">_R</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1mlnorm.html#a564715dea56f7bbff0083aec295ce97e" title="access function">_R</a>()) {}527 <a name="l00677"></a>00677 <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable from theory.">Lambda</a> (), <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> (<a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a>()) {} 528 528 <a name="l00679"></a><a class="code" href="classbdm_1_1mlstudent.html#a4cdf79aac1b2165c0290e73810a0e4a3">00679</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlstudent.html#a4cdf79aac1b2165c0290e73810a0e4a3" title="constructor function">set_parameters</a> (<span class="keyword">const</span> mat &A0, <span class="keyword">const</span> vec &mu0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a> &R0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1ldmat.html" title="Matrix stored in LD form, (commonly known as UD).">ldmat</a>& Lambda0) { 529 529 <a name="l00680"></a>00680 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (A0.rows() == mu0.length(), <span class="stringliteral">"mlstudent: A vs. mu mismatch"</span>); … … 545 545 <a name="l00696"></a>00696 zeta = <a class="code" href="classbdm_1_1mlstudent.html#a41595144a79594acbe288c6b59412657" title="Variable from theory.">Lambda</a>.<a class="code" href="classbdm_1_1ldmat.html#af743de194aadb8515cf18226fadf365f" title="Evaluates quadratic form ;.">invqform</a> (cond); 546 546 <a name="l00697"></a>00697 } 547 <a name="l00698"></a>00698 <a class="code" href="classbdm_1_1mlnorm.html#a 564715dea56f7bbff0083aec295ce97e" title="access function">_R</a> = <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a>;548 <a name="l00699"></a>00699 <a class="code" href="classbdm_1_1mlnorm.html#a 564715dea56f7bbff0083aec295ce97e" title="access function">_R</a> *= (1 + zeta);<span class="comment">// / ( nu ); << nu is in Re!!!!!!</span>547 <a name="l00698"></a>00698 <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> = <a class="code" href="classbdm_1_1mlstudent.html#a1c063ad6cb6e079ee11bc4128c2c9fe8" title="Variable .">Re</a>; 548 <a name="l00699"></a>00699 <a class="code" href="classbdm_1_1mlnorm.html#a9af0714b7b29ab1162ebc3291b7c4a43" title="access function">_R</a> *= (1 + zeta);<span class="comment">// / ( nu ); << nu is in Re!!!!!!</span> 549 549 <a name="l00700"></a>00700 }; 550 550 <a name="l00701"></a>00701 … … 565 565 <a name="l00729"></a>00729 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#aa0f21c2557b233a85838b497d040ab14" title="Set value of k.">set_parameters</a> (<span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a>, <span class="keyword">const</span> vec &beta0); 566 566 <a name="l00730"></a>00730 567 <a name="l00731"></a><a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff">00731</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff" >condition</a> (<span class="keyword">const</span> vec &val) {<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / val;};567 <a name="l00731"></a><a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff">00731</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#a8996500f1885e39cde30221b20900bff" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &val) {<a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / val;}; 568 568 <a name="l00741"></a><a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">00741</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">from_setting</a> (<span class="keyword">const</span> Setting &<span class="keyword">set</span>) { 569 569 <a name="l00742"></a>00742 <a class="code" href="classbdm_1_1mgamma.html#ada2af0f327e5452bee71d1bf97452ae4">mpdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">// reads rv and rvc</span> … … 604 604 <a name="l00793"></a>00793 <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = dimension(); 605 605 <a name="l00794"></a>00794 }; 606 <a name="l00795"></a><a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c">00795</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c" >condition</a> (<span class="keyword">const</span> vec &val) {606 <a name="l00795"></a><a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c">00795</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma.html#a7a34b1e2e3aa2250d7c0ed7df1665b8c" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &val) { 607 607 <a name="l00796"></a>00796 <a class="code" href="classbdm_1_1migamma.html#a0d854c047001b5465cf1ba21f52904b5" title="cache of iepdf.beta">_beta</a> = elem_mult (val, (<a class="code" href="classbdm_1_1migamma.html#ac9847093da59a9ba0ebb68d2c592f5dc" title="cache of iepdf.alpha">_alpha</a> - 1.0)); 608 608 <a name="l00797"></a>00797 }; … … 623 623 <a name="l00827"></a>00827 }; 624 624 <a name="l00828"></a>00828 625 <a name="l00829"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7">00829</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7" >condition</a> (<span class="keyword">const</span> vec &val) {vec mean = elem_mult (<a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>, pow (val, <a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>)); <a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / mean;};625 <a name="l00829"></a><a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7">00829</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgamma__fix.html#a1d539591deb7a38bb3403c2b396c8ff7" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &val) {vec mean = elem_mult (<a class="code" href="classbdm_1_1mgamma__fix.html#a018c6f901a04e419455308a07eb3b0b2" title="reference vector">refl</a>, pow (val, <a class="code" href="classbdm_1_1mgamma__fix.html#a1eb701506aabb2e6af007e487212d6fa" title="parameter l">l</a>)); <a class="code" href="classbdm_1_1mgamma.html#a3d95f4dde9214ff6dba265e18af60312" title="cache of iepdf.beta">_beta</a> = <a class="code" href="classbdm_1_1mgamma.html#ab20cf88cca1fe9b0b8f2a412608bfd09" title="Constant .">k</a> / mean;}; 626 626 <a name="l00830"></a>00830 }; 627 627 <a name="l00831"></a>00831 … … 641 641 <a name="l00861"></a>00861 }; 642 642 <a name="l00862"></a>00862 643 <a name="l00863"></a><a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a">00863</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" >condition</a> (<span class="keyword">const</span> vec &val) {643 <a name="l00863"></a><a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a">00863</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &val) { 644 644 <a name="l00864"></a>00864 vec mean = elem_mult (<a class="code" href="classbdm_1_1migamma__ref.html#a3692dc67caf4367e15564d37f45476f6" title="reference vector">refl</a>, pow (val, <a class="code" href="classbdm_1_1migamma__ref.html#acdc1345ba8375fbdb18a69322d2f841d" title="parameter l">l</a>)); 645 <a name="l00865"></a>00865 <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" >migamma::condition</a> (mean);645 <a name="l00865"></a>00865 <a class="code" href="classbdm_1_1migamma__ref.html#aae86b2e4ff963d62e05d4e130514634a" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">migamma::condition</a> (mean); 646 646 <a name="l00866"></a>00866 }; 647 647 <a name="l00867"></a>00867 … … 682 682 <a name="l00946"></a>00946 }; 683 683 <a name="l00947"></a>00947 684 <a name="l00948"></a><a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e">00948</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e" >condition</a> (<span class="keyword">const</span> vec &val) {684 <a name="l00948"></a><a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e">00948</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mlognorm.html#a9106d8fd8bdf2b6be675ffd8f3ca584e" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &val) { 685 685 <a name="l00949"></a>00949 <a class="code" href="classbdm_1_1mlognorm.html#a7d0063f77d899ef22e8c5edd642176d2" title="access">mu</a> = log (val) - <a class="code" href="classbdm_1_1mlognorm.html#aa51128a2e503b8b2ce698244b9e0db1a" title="parameter 1/2*sigma^2">sig2</a>;<span class="comment">//elem_mult ( refl,pow ( val,l ) );</span> 686 686 <a name="l00950"></a>00950 }; … … 751 751 <a name="l01051"></a>01051 <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a4eee757c0535c2a88bb20f0767c64981" title="fast access function y0 will be copied into Y.Ch.">setY</a> (iCh); 752 752 <a name="l01052"></a>01052 } 753 <a name="l01053"></a><a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb">01053</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb" >evallog</a> (<span class="keyword">const</span> vec &val)<span class="keyword"> const </span>{753 <a name="l01053"></a><a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb">01053</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eiWishartCh.html#aa6ddbd815b8b666dd542e97f009f89bb" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> (<span class="keyword">const</span> vec &val)<span class="keyword"> const </span>{ 754 754 <a name="l01054"></a>01054 <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> X (<a class="code" href="classbdm_1_1eiWishartCh.html#ac11f1c41183f743b97fbb73a4e9ba6cd" title="size of Ch">p</a>); 755 755 <a name="l01055"></a>01055 <span class="keyword">const</span> <a class="code" href="classbdm_1_1chmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>& Y = <a class="code" href="classbdm_1_1eiWishartCh.html#ac6b684b52dc62b8d46e67d5992f98b9a" title="Internal instance of Wishart density.">W</a>.<a class="code" href="classbdm_1_1eWishartCh.html#a1708cacb5d8cb1b96395d35f5327cb7e" title="access function">getY</a>(); … … 796 796 <a name="l01102"></a>01102 <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>.<a class="code" href="classbdm_1_1epdf.html#a7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>(); 797 797 <a name="l01103"></a>01103 } 798 <a name="l01104"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6">01104</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6" >condition</a> (<span class="keyword">const</span> vec &c) {798 <a name="l01104"></a><a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6">01104</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1rwiWishartCh.html#aac087ba6c885d3faeda9171229f9b4e6" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">condition</a> (<span class="keyword">const</span> vec &c) { 799 799 <a name="l01105"></a>01105 vec z = c; 800 800 <a name="l01106"></a>01106 <span class="keywordtype">int</span> ri = 0; … … 884 884 <a name="l01217"></a>01217 885 885 <a name="l01218"></a>01218 <span class="keyword">template</span><<span class="keyword">class</span> sq_T> 886 <a name="l01219"></a><a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6">01219</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" >enorm<sq_T>::from_setting</a> (<span class="keyword">const</span> Setting &<span class="keyword">set</span>)886 <a name="l01219"></a><a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6">01219</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" title="Load from structure with elements:.">enorm<sq_T>::from_setting</a> (<span class="keyword">const</span> Setting &<span class="keyword">set</span>) 887 887 <a name="l01220"></a>01220 { 888 <a name="l01221"></a>01221 <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" >epdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">//reads rv</span>888 <a name="l01221"></a>01221 <a class="code" href="classbdm_1_1enorm.html#a61bd470764020bea6e1ed35000f259e6" title="Load from structure with elements:.">epdf::from_setting</a> (<span class="keyword">set</span>); <span class="comment">//reads rv</span> 889 889 <a name="l01222"></a>01222 890 890 <a name="l01223"></a>01223 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> (<a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a>, <span class="keyword">set</span>, <span class="stringliteral">"mu"</span>, UI::compulsory); … … 982 982 <a name="l01315"></a>01315 <span class="keyword"></span>{ 983 983 <a name="l01316"></a>01316 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> (<a class="code" href="classbdm_1_1epdf.html#ac4b863ff84c7a4882fb3ad18556027f9" title="True if rv is assigned.">isnamed</a>(), <span class="stringliteral">"rv description is not assigned"</span>); 984 <a name="l01317"></a>01317 ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" >dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);984 <a name="l01317"></a>01317 ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>); 985 985 <a name="l01318"></a>01318 986 986 <a name="l01319"></a>01319 sq_T Rn (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>, irvn); <span class="comment">// select rows and columns of R</span> … … 1008 1008 <a name="l01341"></a>01341 1009 1009 <a name="l01342"></a>01342 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvc = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#aaec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> (rvn); 1010 <a name="l01343"></a>01343 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( (rvc. _dsize() + rvn._dsize() == <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>._dsize()), <span class="stringliteral">"wrong rvn"</span>);1010 <a name="l01343"></a>01343 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( (rvc.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() + rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() == <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>()), <span class="stringliteral">"wrong rvn"</span>); 1011 1011 <a name="l01344"></a>01344 <span class="comment">//Permutation vector of the new R</span> 1012 <a name="l01345"></a>01345 ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" >dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);1013 <a name="l01346"></a>01346 ivec irvc = rvc.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" >dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>);1012 <a name="l01345"></a>01345 ivec irvn = rvn.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>); 1013 <a name="l01346"></a>01346 ivec irvc = rvc.<a class="code" href="classbdm_1_1RV.html#acbebdb5e0d30101a6eb63550ef701c55" title="when this rv is a part of bigger rv, this function returns indices of self in the...">dataind</a> (<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>); 1014 1014 <a name="l01347"></a>01347 ivec perm = concat (irvn , irvc); 1015 1015 <a name="l01348"></a>01348 sq_T Rn (<a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>, perm); … … 1018 1018 <a name="l01351"></a>01351 mat S = Rn.to_mat(); 1019 1019 <a name="l01352"></a>01352 <span class="comment">//fixme</span> 1020 <a name="l01353"></a>01353 <span class="keywordtype">int</span> n = rvn. _dsize() - 1;1020 <a name="l01353"></a>01353 <span class="keywordtype">int</span> n = rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>() - 1; 1021 1021 <a name="l01354"></a>01354 <span class="keywordtype">int</span> end = <a class="code" href="classbdm_1_1enorm.html#a2d92dde696b2a7a5b10ddef5d22ba2c2" title="Covariance matrix in decomposed form.">R</a>.rows() - 1; 1022 1022 <a name="l01355"></a>01355 mat S11 = S.get (0, n, 0, n); 1023 <a name="l01356"></a>01356 mat S12 = S.get (0, n , rvn. _dsize(), end);1024 <a name="l01357"></a>01357 mat S22 = S.get (rvn. _dsize(), end, rvn._dsize(), end);1023 <a name="l01356"></a>01356 mat S12 = S.get (0, n , rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end); 1024 <a name="l01357"></a>01357 mat S22 = S.get (rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end, rvn.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>(), end); 1025 1025 <a name="l01358"></a>01358 1026 1026 <a name="l01359"></a>01359 vec mu1 = <a class="code" href="classbdm_1_1enorm.html#ac702a194720853570d08b65482f842c7" title="mean value">mu</a> (irvn); … … 1041 1041 <a name="l01376"></a>01376 1042 1042 <a name="l01377"></a>01377 <span class="keyword">template</span><<span class="keyword">class</span> sq_T> 1043 <a name="l01378"></a><a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d">01378</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" >mgnorm<sq_T >::condition</a> (<span class="keyword">const</span> vec &cond) {this-><a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = g->eval (cond);};1043 <a name="l01378"></a><a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d">01378</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mgnorm.html#ab31d63472cf6a1030cd8dbd8094c1f6d" title="Update iepdf so that it represents this mpdf conditioned on rvc = cond This function...">mgnorm<sq_T >::condition</a> (<span class="keyword">const</span> vec &cond) {this-><a class="code" href="classbdm_1_1mpdf__internal.html#a47bab632af15120c88aad647ae129468" title="Internal epdf used for sampling.">iepdf</a>._mu() = g->eval (cond);}; 1044 1044 <a name="l01379"></a>01379 1045 1045 <a name="l01381"></a>01381 <span class="keyword">template</span><<span class="keyword">class</span> sq_T> … … 1055 1055 <a name="l01391"></a>01391 <span class="preprocessor">#endif //EF_H</span> 1056 1056 </pre></div></div> 1057 <hr size="1"/><address style="text-align: right;"><small>Generated on Sun Aug 30 22:10:492009 for mixpp by 1057 <hr size="1"/><address style="text-align: right;"><small>Generated on Tue Sep 8 22:11:32 2009 for mixpp by 1058 1058 <a href="http://www.doxygen.org/index.html"> 1059 1059 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>