[651] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
[259] | 3 | <title>mixpp: bdm::mratio Class Reference</title> |
---|
[651] | 4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
| 5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 6 | </head><body> |
---|
| 7 | <!-- Generated by Doxygen 1.5.9 --> |
---|
[271] | 8 | <script type="text/javascript"> |
---|
| 9 | <!-- |
---|
| 10 | function changeDisplayState (e){ |
---|
| 11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
| 12 | var button=this.firstChild; |
---|
| 13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
| 14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
| 15 | sectionDiv.style.display='block'; |
---|
| 16 | button.src='open.gif'; |
---|
| 17 | }else{ |
---|
| 18 | sectionDiv.style.display='none'; |
---|
| 19 | button.src='closed.gif'; |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | function initDynSections(){ |
---|
| 23 | var divs=document.getElementsByTagName('div'); |
---|
| 24 | var sectionCounter=1; |
---|
| 25 | for(var i=0;i<divs.length-1;i++){ |
---|
| 26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
| 27 | var header=divs[i]; |
---|
| 28 | var section=divs[i+1]; |
---|
| 29 | var button=header.firstChild; |
---|
| 30 | if (button!='IMG'){ |
---|
| 31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
| 32 | button=document.createElement('img'); |
---|
| 33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
| 34 | } |
---|
| 35 | header.style.cursor='pointer'; |
---|
| 36 | header.onclick=changeDisplayState; |
---|
| 37 | header.id='dynheader'+sectionCounter; |
---|
| 38 | button.src='closed.gif'; |
---|
| 39 | section.id='dynsection'+sectionCounter; |
---|
| 40 | section.style.display='none'; |
---|
| 41 | section.style.marginLeft='14px'; |
---|
| 42 | sectionCounter++; |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | window.onload = initDynSections; |
---|
| 47 | --> |
---|
| 48 | </script> |
---|
[259] | 49 | <div class="navigation" id="top"> |
---|
| 50 | <div class="tabs"> |
---|
| 51 | <ul> |
---|
[271] | 52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
[259] | 53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
[290] | 54 | <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
---|
[259] | 55 | <li><a href="files.html"><span>Files</span></a></li> |
---|
| 56 | </ul> |
---|
| 57 | </div> |
---|
| 58 | <div class="tabs"> |
---|
| 59 | <ul> |
---|
| 60 | <li><a href="annotated.html"><span>Class List</span></a></li> |
---|
[290] | 61 | <li><a href="classes.html"><span>Class Index</span></a></li> |
---|
[259] | 62 | <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
---|
| 63 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
| 64 | </ul> |
---|
| 65 | </div> |
---|
[271] | 66 | <div class="navpath"><b>bdm</b>::<a class="el" href="classbdm_1_1mratio.html">mratio</a> |
---|
[259] | 67 | </div> |
---|
| 68 | </div> |
---|
| 69 | <div class="contents"> |
---|
[651] | 70 | <h1>bdm::mratio Class Reference</h1><!-- doxytag: class="bdm::mratio" --><!-- doxytag: inherits="bdm::mpdf" -->Class representing ratio of two densities which arise e.g. by applying the Bayes rule. It represents density in the form: <p class="formulaDsp"> |
---|
| 71 | <img class="formulaDsp" alt="\[ f(rv|rvc) = \frac{f(rv,rvc)}{f(rvc)} \]" src="form_70.png"> |
---|
| 72 | <p> |
---|
| 73 | where <img class="formulaInl" alt="$ f(rvc) = \int f(rv,rvc) d\ rv $" src="form_71.png">. |
---|
| 74 | <a href="#_details">More...</a> |
---|
| 75 | <p> |
---|
| 76 | <code>#include <<a class="el" href="emix_8h_source.html">emix.h</a>></code> |
---|
| 77 | <p> |
---|
[290] | 78 | |
---|
[651] | 79 | <p> |
---|
| 80 | <a href="classbdm_1_1mratio-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
---|
| 81 | <tr><td></td></tr> |
---|
| 82 | <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
---|
| 83 | <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#0ff56d13f9515d7e5f23b7a4cc5529b4">mratio</a> (const <a class="el" href="classbdm_1_1epdf.html">epdf</a> *nom0, const <a class="el" href="classbdm_1_1RV.html">RV</a> &rv, bool copy=false)</td></tr> |
---|
[259] | 84 | |
---|
[651] | 85 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3a2cbce8c61ca9f592d9c2220f7c1204"></a><!-- doxytag: member="bdm::mratio::evallogcond" ref="3a2cbce8c61ca9f592d9c2220f7c1204" args="(const vec &val, const vec &cond)" --> |
---|
| 86 | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#3a2cbce8c61ca9f592d9c2220f7c1204">evallogcond</a> (const vec &val, const vec &cond)</td></tr> |
---|
| 87 | |
---|
| 88 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Shortcut for conditioning and evaluation of the internal <a class="el" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>. In some cases, this operation can be implemented efficiently. <br></td></tr> |
---|
| 89 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c8b39fea586d4258bb3c881406edaf15"></a><!-- doxytag: member="bdm::mratio::ownnom" ref="c8b39fea586d4258bb3c881406edaf15" args="()" --> |
---|
| 90 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#c8b39fea586d4258bb3c881406edaf15">ownnom</a> ()</td></tr> |
---|
| 91 | |
---|
| 92 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Object takes ownership of nom and will destroy it. <br></td></tr> |
---|
| 93 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c0cc0b25dbdc54751466616655454c5c"></a><!-- doxytag: member="bdm::mratio::~mratio" ref="c0cc0b25dbdc54751466616655454c5c" args="()" --> |
---|
| 94 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#c0cc0b25dbdc54751466616655454c5c">~mratio</a> ()</td></tr> |
---|
| 95 | |
---|
| 96 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Default destructor. <br></td></tr> |
---|
| 97 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#30a0bceb948e287d497c578e371b1667">from_setting</a> (const Setting &set)</td></tr> |
---|
| 98 | |
---|
| 99 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Load from structure with elements:. <a href="#30a0bceb948e287d497c578e371b1667"></a><br></td></tr> |
---|
| 100 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="af0e6941ba5919cae1bc530e2181b109"></a><!-- doxytag: member="bdm::mratio::to_string" ref="af0e6941ba5919cae1bc530e2181b109" args="()" --> |
---|
| 101 | virtual string </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#af0e6941ba5919cae1bc530e2181b109">to_string</a> ()</td></tr> |
---|
| 102 | |
---|
| 103 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method returns a basic info about the current instance. <br></td></tr> |
---|
| 104 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="67d954d255ede776eade7334d4895790"></a><!-- doxytag: member="bdm::mratio::to_setting" ref="67d954d255ede776eade7334d4895790" args="(Setting &set) const " --> |
---|
| 105 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#67d954d255ede776eade7334d4895790">to_setting</a> (Setting &set) const </td></tr> |
---|
| 106 | |
---|
| 107 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method save all the instance properties into the Setting structure. <br></td></tr> |
---|
| 108 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1c314bd6d6dacb8ba78ea5eb88fd9516"></a><!-- doxytag: member="bdm::mratio::validate" ref="1c314bd6d6dacb8ba78ea5eb88fd9516" args="()" --> |
---|
| 109 | virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1root.html#1c314bd6d6dacb8ba78ea5eb88fd9516">validate</a> ()</td></tr> |
---|
| 110 | |
---|
| 111 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This method TODO. <br></td></tr> |
---|
[270] | 112 | <tr><td colspan="2"><div class="groupHeader">Matematical operations</div></td></tr> |
---|
[651] | 113 | <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#f0c1db6fcbb3aae2dd6123884457a367">samplecond</a> (const vec &cond)</td></tr> |
---|
| 114 | |
---|
| 115 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a sample from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_16.png">. <a href="#f0c1db6fcbb3aae2dd6123884457a367"></a><br></td></tr> |
---|
| 116 | <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual mat </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#6e497d501331057309d2fddf63259d1a">samplecond_m</a> (const vec &cond, int N)</td></tr> |
---|
| 117 | |
---|
| 118 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns. <a href="#6e497d501331057309d2fddf63259d1a"></a><br></td></tr> |
---|
| 119 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0b0ed1ed663071bb7cf4a1349eb94fcb"></a><!-- doxytag: member="bdm::mratio::evallogcond_m" ref="0b0ed1ed663071bb7cf4a1349eb94fcb" args="(const mat &Dt, const vec &cond)" --> |
---|
| 120 | virtual vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#0b0ed1ed663071bb7cf4a1349eb94fcb">evallogcond_m</a> (const mat &Dt, const vec &cond)</td></tr> |
---|
| 121 | |
---|
| 122 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Matrix version of evallogcond. <br></td></tr> |
---|
| 123 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2a0d03756f59924fd038980ee60bd904"></a><!-- doxytag: member="bdm::mratio::evallogcond_m" ref="2a0d03756f59924fd038980ee60bd904" args="(const Array< vec > &Dt, const vec &cond)" --> |
---|
| 124 | virtual vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#2a0d03756f59924fd038980ee60bd904">evallogcond_m</a> (const Array< vec > &Dt, const vec &cond)</td></tr> |
---|
| 125 | |
---|
| 126 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Array<vec> version of evallogcond. <br></td></tr> |
---|
[270] | 127 | <tr><td colspan="2"><div class="groupHeader">Access to attributes</div></td></tr> |
---|
[651] | 128 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aa0095f80870f15209bca68a8a7bad8a"></a><!-- doxytag: member="bdm::mratio::_rv" ref="aa0095f80870f15209bca68a8a7bad8a" args="() const " --> |
---|
[608] | 129 | const <a class="el" href="classbdm_1_1RV.html">RV</a> & </td><td class="memItemRight" valign="bottom"><b>_rv</b> () const </td></tr> |
---|
[651] | 130 | |
---|
| 131 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="739d5202899bb56792a547c74e517a11"></a><!-- doxytag: member="bdm::mratio::_rvc" ref="739d5202899bb56792a547c74e517a11" args="() const " --> |
---|
[608] | 132 | const <a class="el" href="classbdm_1_1RV.html">RV</a> & </td><td class="memItemRight" valign="bottom"><b>_rvc</b> () const </td></tr> |
---|
[651] | 133 | |
---|
| 134 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="eea4a999ed9679181335927e9cb66d28"></a><!-- doxytag: member="bdm::mratio::dimension" ref="eea4a999ed9679181335927e9cb66d28" args="() const " --> |
---|
[538] | 135 | int </td><td class="memItemRight" valign="bottom"><b>dimension</b> () const </td></tr> |
---|
[651] | 136 | |
---|
| 137 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="35e135910aed187b7290742f50e61bc8"></a><!-- doxytag: member="bdm::mratio::dimensionc" ref="35e135910aed187b7290742f50e61bc8" args="()" --> |
---|
[270] | 138 | int </td><td class="memItemRight" valign="bottom"><b>dimensionc</b> ()</td></tr> |
---|
[651] | 139 | |
---|
[270] | 140 | <tr><td colspan="2"><div class="groupHeader">Connection to other objects</div></td></tr> |
---|
[651] | 141 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7631a5570e4ade1420065e8df78f4401"></a><!-- doxytag: member="bdm::mratio::set_rvc" ref="7631a5570e4ade1420065e8df78f4401" args="(const RV &rvc0)" --> |
---|
[270] | 142 | void </td><td class="memItemRight" valign="bottom"><b>set_rvc</b> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &rvc0)</td></tr> |
---|
[651] | 143 | |
---|
| 144 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="18ac26bc2f96ae01ef4eb06178abbd75"></a><!-- doxytag: member="bdm::mratio::set_rv" ref="18ac26bc2f96ae01ef4eb06178abbd75" args="(const RV &rv0)" --> |
---|
[270] | 145 | void </td><td class="memItemRight" valign="bottom"><b>set_rv</b> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &rv0)</td></tr> |
---|
[651] | 146 | |
---|
| 147 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f8e3798150b42fd1f3e16ddbbe0e7045"></a><!-- doxytag: member="bdm::mratio::isnamed" ref="f8e3798150b42fd1f3e16ddbbe0e7045" args="()" --> |
---|
[270] | 148 | bool </td><td class="memItemRight" valign="bottom"><b>isnamed</b> ()</td></tr> |
---|
[651] | 149 | |
---|
| 150 | <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> |
---|
| 151 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="147afacb393324bb3f9a7a89e33f835e"></a><!-- doxytag: member="bdm::mratio::set_ep" ref="147afacb393324bb3f9a7a89e33f835e" args="(epdf &iepdf)" --> |
---|
| 152 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#147afacb393324bb3f9a7a89e33f835e">set_ep</a> (<a class="el" href="classbdm_1_1epdf.html">epdf</a> &<a class="el" href="classbdm_1_1mratio.html#7a676422bc6cc426ffa6fddf52672409">iepdf</a>)</td></tr> |
---|
| 153 | |
---|
| 154 | <tr><td class="mdescLeft"> </td><td class="mdescRight">set internal pointer <code>ep</code> to point to given <code>iepdf</code> <br></td></tr> |
---|
| 155 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7555b377f8b5895c9b759c9628ee3e20"></a><!-- doxytag: member="bdm::mratio::set_ep" ref="7555b377f8b5895c9b759c9628ee3e20" args="(epdf *iepdfp)" --> |
---|
| 156 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#7555b377f8b5895c9b759c9628ee3e20">set_ep</a> (<a class="el" href="classbdm_1_1epdf.html">epdf</a> *iepdfp)</td></tr> |
---|
| 157 | |
---|
| 158 | <tr><td class="mdescLeft"> </td><td class="mdescRight">set internal pointer <code>ep</code> to point to given <code>iepdf</code> <br></td></tr> |
---|
| 159 | <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> |
---|
| 160 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f31caba90a2aa10fbf7631832404fe54"></a><!-- doxytag: member="bdm::mratio::nom" ref="f31caba90a2aa10fbf7631832404fe54" args="" --> |
---|
| 161 | const <a class="el" href="classbdm_1_1epdf.html">epdf</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#f31caba90a2aa10fbf7631832404fe54">nom</a></td></tr> |
---|
| 162 | |
---|
| 163 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Nominator in the form of <a class="el" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling , where is random variable, rv, and...">mpdf</a>. <br></td></tr> |
---|
| 164 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="873598797f36eddab44e342e14563fcb"></a><!-- doxytag: member="bdm::mratio::den" ref="873598797f36eddab44e342e14563fcb" args="" --> |
---|
| 165 | <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< <a class="el" href="classbdm_1_1epdf.html">epdf</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#873598797f36eddab44e342e14563fcb">den</a></td></tr> |
---|
| 166 | |
---|
| 167 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Denominator in the form of <a class="el" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>. <br></td></tr> |
---|
| 168 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="51bfe6675e724f7fbeaaeacce5a9f9b8"></a><!-- doxytag: member="bdm::mratio::destroynom" ref="51bfe6675e724f7fbeaaeacce5a9f9b8" args="" --> |
---|
| 169 | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#51bfe6675e724f7fbeaaeacce5a9f9b8">destroynom</a></td></tr> |
---|
| 170 | |
---|
| 171 | <tr><td class="mdescLeft"> </td><td class="mdescRight">flag for destructor <br></td></tr> |
---|
| 172 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cda5bd23ba60146d69e1f804ff7710c7"></a><!-- doxytag: member="bdm::mratio::dl" ref="cda5bd23ba60146d69e1f804ff7710c7" args="" --> |
---|
| 173 | <a class="el" href="classbdm_1_1datalink__m2e.html">datalink_m2e</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#cda5bd23ba60146d69e1f804ff7710c7">dl</a></td></tr> |
---|
| 174 | |
---|
| 175 | <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classbdm_1_1datalink.html" title="DataLink is a connection between two data vectors Up and Down.">datalink</a> between conditional and nom <br></td></tr> |
---|
| 176 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7a676422bc6cc426ffa6fddf52672409"></a><!-- doxytag: member="bdm::mratio::iepdf" ref="7a676422bc6cc426ffa6fddf52672409" args="" --> |
---|
| 177 | <a class="el" href="classbdm_1_1epdf.html">epdf</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mratio.html#7a676422bc6cc426ffa6fddf52672409">iepdf</a></td></tr> |
---|
| 178 | |
---|
| 179 | <tr><td class="mdescLeft"> </td><td class="mdescRight">dummy <a class="el" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> that stores only rv and dim <br></td></tr> |
---|
| 180 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7c1900976ff13dbc09c9729b3bbff9e6"></a><!-- doxytag: member="bdm::mratio::dimc" ref="7c1900976ff13dbc09c9729b3bbff9e6" args="" --> |
---|
| 181 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6">dimc</a></td></tr> |
---|
| 182 | |
---|
| 183 | <tr><td class="mdescLeft"> </td><td class="mdescRight">dimension of the condition <br></td></tr> |
---|
| 184 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5a5f08950daa08b85b01ddf4e1c36288"></a><!-- doxytag: member="bdm::mratio::rvc" ref="5a5f08950daa08b85b01ddf4e1c36288" args="" --> |
---|
| 185 | <a class="el" href="classbdm_1_1RV.html">RV</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288">rvc</a></td></tr> |
---|
| 186 | |
---|
| 187 | <tr><td class="mdescLeft"> </td><td class="mdescRight">random variable in condition <br></td></tr> |
---|
[259] | 188 | </table> |
---|
[651] | 189 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
---|
| 190 | Class representing ratio of two densities which arise e.g. by applying the Bayes rule. It represents density in the form: <p class="formulaDsp"> |
---|
| 191 | <img class="formulaDsp" alt="\[ f(rv|rvc) = \frac{f(rv,rvc)}{f(rvc)} \]" src="form_70.png"> |
---|
| 192 | <p> |
---|
| 193 | where <img class="formulaInl" alt="$ f(rvc) = \int f(rv,rvc) d\ rv $" src="form_71.png">. |
---|
| 194 | <p> |
---|
| 195 | In particular this type of arise by conditioning of a mixture model.<p> |
---|
| 196 | At present the only supported operation is <a class="el" href="classbdm_1_1mratio.html#3a2cbce8c61ca9f592d9c2220f7c1204" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond()</a>. <hr><h2>Constructor & Destructor Documentation</h2> |
---|
| 197 | <a class="anchor" name="0ff56d13f9515d7e5f23b7a4cc5529b4"></a><!-- doxytag: member="bdm::mratio::mratio" ref="0ff56d13f9515d7e5f23b7a4cc5529b4" args="(const epdf *nom0, const RV &rv, bool copy=false)" --> |
---|
[259] | 198 | <div class="memitem"> |
---|
| 199 | <div class="memproto"> |
---|
| 200 | <table class="memname"> |
---|
| 201 | <tr> |
---|
[651] | 202 | <td class="memname">bdm::mratio::mratio </td> |
---|
[259] | 203 | <td>(</td> |
---|
| 204 | <td class="paramtype">const <a class="el" href="classbdm_1_1epdf.html">epdf</a> * </td> |
---|
| 205 | <td class="paramname"> <em>nom0</em>, </td> |
---|
| 206 | </tr> |
---|
| 207 | <tr> |
---|
| 208 | <td class="paramkey"></td> |
---|
| 209 | <td></td> |
---|
| 210 | <td class="paramtype">const <a class="el" href="classbdm_1_1RV.html">RV</a> & </td> |
---|
| 211 | <td class="paramname"> <em>rv</em>, </td> |
---|
| 212 | </tr> |
---|
| 213 | <tr> |
---|
| 214 | <td class="paramkey"></td> |
---|
| 215 | <td></td> |
---|
| 216 | <td class="paramtype">bool </td> |
---|
| 217 | <td class="paramname"> <em>copy</em> = <code>false</code></td><td> </td> |
---|
| 218 | </tr> |
---|
| 219 | <tr> |
---|
| 220 | <td></td> |
---|
| 221 | <td>)</td> |
---|
| 222 | <td></td><td></td><td><code> [inline]</code></td> |
---|
| 223 | </tr> |
---|
| 224 | </table> |
---|
| 225 | </div> |
---|
| 226 | <div class="memdoc"> |
---|
| 227 | |
---|
[651] | 228 | <p> |
---|
| 229 | Default constructor. By default, the given <a class="el" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> is not copied! It is assumed that this function will be used only temporarily. |
---|
[632] | 230 | <p>References <a class="el" href="bdmbase_8h_source.html#l00154">bdm::RV::_dsize()</a>, <a class="el" href="bdmbase_8h_source.html#l00425">bdm::epdf::_rv()</a>, <a class="el" href="bdmerror_8h_source.html#l00047">bdm_assert_debug</a>, <a class="el" href="bdmerror_8h_source.html#l00051">bdm_error</a>, <a class="el" href="emix_8h_source.html#l00043">den</a>, <a class="el" href="emix_8h_source.html#l00046">destroynom</a>, <a class="el" href="bdmbase_8h_source.html#l00459">bdm::mpdf::dimc</a>, <a class="el" href="emix_8h_source.html#l00048">dl</a>, <a class="el" href="emix_8h_source.html#l00050">iepdf</a>, <a class="el" href="bdmbase_8h_source.html#l00168">bdm::RV::length()</a>, <a class="el" href="bdmbase_8cpp_source.html#l00153">bdm::epdf::marginal()</a>, <a class="el" href="emix_8h_source.html#l00040">nom</a>, <a class="el" href="bdmbase_8h_source.html#l00461">bdm::mpdf::rvc</a>, <a class="el" href="bdmbase_8cpp_source.html#l00223">bdm::datalink_m2e::set_connection()</a>, <a class="el" href="bdmbase_8h_source.html#l00468">bdm::mpdf::set_ep()</a>, <a class="el" href="bdmbase_8h_source.html#l00414">bdm::epdf::set_rv()</a>, and <a class="el" href="bdmbase_8cpp_source.html#l00316">bdm::RV::subt()</a>.</p> |
---|
[259] | 231 | |
---|
| 232 | </div> |
---|
[651] | 233 | </div><p> |
---|
| 234 | <hr><h2>Member Function Documentation</h2> |
---|
| 235 | <a class="anchor" name="30a0bceb948e287d497c578e371b1667"></a><!-- doxytag: member="bdm::mratio::from_setting" ref="30a0bceb948e287d497c578e371b1667" args="(const Setting &set)" --> |
---|
[396] | 236 | <div class="memitem"> |
---|
| 237 | <div class="memproto"> |
---|
| 238 | <table class="memname"> |
---|
| 239 | <tr> |
---|
[651] | 240 | <td class="memname">void bdm::mpdf::from_setting </td> |
---|
[396] | 241 | <td>(</td> |
---|
| 242 | <td class="paramtype">const Setting & </td> |
---|
[651] | 243 | <td class="paramname"> <em>set</em> </td> |
---|
[396] | 244 | <td> ) </td> |
---|
[472] | 245 | <td><code> [virtual, inherited]</code></td> |
---|
[396] | 246 | </tr> |
---|
| 247 | </table> |
---|
| 248 | </div> |
---|
| 249 | <div class="memdoc"> |
---|
[608] | 250 | |
---|
[651] | 251 | <p> |
---|
| 252 | Load from structure with elements:. |
---|
| 253 | <p> |
---|
| 254 | <div class="fragment"><pre class="fragment"> { <span class="keyword">class </span>= "mpdf_offspring", |
---|
| 255 | rv = {<span class="keyword">class</span>=<span class="stringliteral">"RV"</span>, names=(...),}; <span class="comment">// RV describing meaning of random variable</span> |
---|
| 256 | <a class="code" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>= {<span class="keyword">class</span>=<span class="stringliteral">"RV"</span>, names=(...),}; <span class="comment">// RV describing meaning of random variable in condition</span> |
---|
[608] | 257 | <span class="comment">// elements of offsprings</span> |
---|
| 258 | } |
---|
[396] | 259 | </pre></div> |
---|
[651] | 260 | <p>Reimplemented from <a class="el" href="classbdm_1_1root.html#0551e3121091c5199bf4413b50522176">bdm::root</a>.</p> |
---|
[396] | 261 | |
---|
[651] | 262 | <p>Reimplemented in <a class="el" href="classbdm_1_1mepdf.html#27ef18a3e3b1b5de02739d1324bf25fb">bdm::mepdf</a>, <a class="el" href="classbdm_1_1mprod.html#bfa7478f8df1de6d8cd4c349db512831">bdm::mprod</a>, <a class="el" href="classbdm_1_1mDirich.html#c1e6f42277b97f700ea1b6045cb6b2d7">bdm::mDirich</a>, <a class="el" href="classbdm_1_1mlnorm.html#52980f13d80162d00b30d5864343f564">bdm::mlnorm< sq_T, TEpdf ></a>, <a class="el" href="classbdm_1_1mgnorm.html#d717dacc6a9eb967f8410994dc6dc6f9">bdm::mgnorm< sq_T ></a>, <a class="el" href="classbdm_1_1mgamma.html#da2af0f327e5452bee71d1bf97452ae4">bdm::mgamma</a>, <a class="el" href="classbdm_1_1migamma__ref.html#9e7e0f7d2aa9ecca8ec1af8cbcb5ef1d">bdm::migamma_ref</a>, <a class="el" href="classbdm_1_1mlognorm.html#49e45ea13a869da607ef9be7a229128a">bdm::mlognorm</a>, <a class="el" href="classbdm_1_1mlnorm.html#52980f13d80162d00b30d5864343f564">bdm::mlnorm< chmat ></a>, and <a class="el" href="classbdm_1_1mlnorm.html#52980f13d80162d00b30d5864343f564">bdm::mlnorm< ldmat, enorm ></a>.</p> |
---|
[396] | 263 | |
---|
| 264 | </div> |
---|
[651] | 265 | </div><p> |
---|
| 266 | <a class="anchor" name="f0c1db6fcbb3aae2dd6123884457a367"></a><!-- doxytag: member="bdm::mratio::samplecond" ref="f0c1db6fcbb3aae2dd6123884457a367" args="(const vec &cond)" --> |
---|
[259] | 267 | <div class="memitem"> |
---|
| 268 | <div class="memproto"> |
---|
| 269 | <table class="memname"> |
---|
| 270 | <tr> |
---|
[651] | 271 | <td class="memname">virtual vec bdm::mpdf::samplecond </td> |
---|
[259] | 272 | <td>(</td> |
---|
| 273 | <td class="paramtype">const vec & </td> |
---|
[651] | 274 | <td class="paramname"> <em>cond</em> </td> |
---|
[269] | 275 | <td> ) </td> |
---|
[538] | 276 | <td><code> [inline, virtual, inherited]</code></td> |
---|
[259] | 277 | </tr> |
---|
| 278 | </table> |
---|
| 279 | </div> |
---|
| 280 | <div class="memdoc"> |
---|
| 281 | |
---|
[651] | 282 | <p> |
---|
| 283 | Returns a sample from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_16.png">. |
---|
| 284 | <p> |
---|
| 285 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
[259] | 286 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
| 287 | <tr><td valign="top"></td><td valign="top"><em>cond</em> </td><td>is numeric value of <code>rv</code> </td></tr> |
---|
| 288 | </table> |
---|
| 289 | </dl> |
---|
| 290 | |
---|
[651] | 291 | <p>Reimplemented in <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< EPDF ></a>, <a class="el" href="classbdm_1_1mepdf.html#b904a90ef78294040b498717cc13015e">bdm::mepdf</a>, <a class="el" href="classbdm_1_1mprod.html#ee715a8013acf9892f6cb489db595555">bdm::mprod</a>, <a class="el" href="classbdm_1_1mmix.html#c97f01cd62bf63e67ddd5b1b8a56cf59">bdm::mmix</a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< egamma ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< enorm< chmat > ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< enorm< sq_T > ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< eigamma ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< elognorm ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< eiWishartCh ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< enorm< ldmat > ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< TEpdf< sq_T > ></a>, and <a class="el" href="classbdm_1_1mpdf__internal.html#d8e547695d1cc19219b91164d825c930">bdm::mpdf_internal< eDirich ></a>.</p> |
---|
[259] | 292 | |
---|
[591] | 293 | <p>References <a class="el" href="bdmerror_8h_source.html#l00051">bdm_error</a>.</p> |
---|
[590] | 294 | |
---|
[641] | 295 | <p>Referenced by <a class="el" href="bdmbase_8cpp_source.html#l00182">bdm::mpdf::samplecond_m()</a>.</p> |
---|
[271] | 296 | |
---|
[259] | 297 | </div> |
---|
[651] | 298 | </div><p> |
---|
| 299 | <a class="anchor" name="6e497d501331057309d2fddf63259d1a"></a><!-- doxytag: member="bdm::mratio::samplecond_m" ref="6e497d501331057309d2fddf63259d1a" args="(const vec &cond, int N)" --> |
---|
[259] | 300 | <div class="memitem"> |
---|
| 301 | <div class="memproto"> |
---|
| 302 | <table class="memname"> |
---|
| 303 | <tr> |
---|
[651] | 304 | <td class="memname">mat bdm::mpdf::samplecond_m </td> |
---|
[259] | 305 | <td>(</td> |
---|
| 306 | <td class="paramtype">const vec & </td> |
---|
| 307 | <td class="paramname"> <em>cond</em>, </td> |
---|
| 308 | </tr> |
---|
| 309 | <tr> |
---|
| 310 | <td class="paramkey"></td> |
---|
| 311 | <td></td> |
---|
| 312 | <td class="paramtype">int </td> |
---|
| 313 | <td class="paramname"> <em>N</em></td><td> </td> |
---|
| 314 | </tr> |
---|
| 315 | <tr> |
---|
| 316 | <td></td> |
---|
| 317 | <td>)</td> |
---|
[472] | 318 | <td></td><td></td><td><code> [virtual, inherited]</code></td> |
---|
[259] | 319 | </tr> |
---|
| 320 | </table> |
---|
| 321 | </div> |
---|
| 322 | <div class="memdoc"> |
---|
| 323 | |
---|
[651] | 324 | <p> |
---|
| 325 | Returns. |
---|
| 326 | <p> |
---|
| 327 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
[259] | 328 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
[651] | 329 | <tr><td valign="top"></td><td valign="top"><em>N</em> </td><td>samples from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_16.png">. </td></tr> |
---|
[259] | 330 | <tr><td valign="top"></td><td valign="top"><em>cond</em> </td><td>is numeric value of <code>rv</code> </td></tr> |
---|
| 331 | </table> |
---|
| 332 | </dl> |
---|
| 333 | |
---|
[651] | 334 | <p>Reimplemented in <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< EPDF ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< egamma ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< enorm< chmat > ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< enorm< sq_T > ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< eigamma ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< elognorm ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< eiWishartCh ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< enorm< ldmat > ></a>, <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< TEpdf< sq_T > ></a>, and <a class="el" href="classbdm_1_1mpdf__internal.html#9554c554054da2d22cb8e908ae9c8823">bdm::mpdf_internal< eDirich ></a>.</p> |
---|
[259] | 335 | |
---|
[632] | 336 | <p>References <a class="el" href="bdmbase_8h_source.html#l00489">bdm::mpdf::samplecond()</a>.</p> |
---|
[538] | 337 | |
---|
[259] | 338 | </div> |
---|
[651] | 339 | </div><p> |
---|
| 340 | <hr>The documentation for this class was generated from the following file:<ul> |
---|
| 341 | <li><a class="el" href="emix_8h_source.html">emix.h</a></ul> |
---|
[259] | 342 | </div> |
---|
[651] | 343 | <hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 17:34:48 2009 for mixpp by |
---|
[259] | 344 | <a href="http://www.doxygen.org/index.html"> |
---|
[651] | 345 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> |
---|
[259] | 346 | </body> |
---|
| 347 | </html> |
---|