root/doc/html/classmprod.html @ 180

Revision 180, 19.2 kB (checked in by smidl, 16 years ago)

Modifications of BDM to reflect changes in basics

Line 
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">
3<title>mixpp: mprod Class Reference</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5<link href="tabs.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.5.6 -->
8<div class="navigation" id="top">
9  <div class="tabs">
10    <ul>
11      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
12      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
13      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
14      <li><a href="files.html"><span>Files</span></a></li>
15    </ul>
16  </div>
17  <div class="tabs">
18    <ul>
19      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
20      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
21      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
22    </ul>
23  </div>
24</div>
25<div class="contents">
26<h1>mprod Class Reference</h1><!-- doxytag: class="mprod" --><!-- doxytag: inherits="compositepdf,mpdf" -->Chain rule decomposition of <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
27<a href="#_details">More...</a>
28<p>
29<code>#include &lt;<a class="el" href="emix_8h-source.html">emix.h</a>&gt;</code>
30<p>
31<div class="dynheader">
32Inheritance diagram for mprod:</div>
33<div class="dynsection">
34<p><center><img src="classmprod__inherit__graph.png" border="0" usemap="#mprod__inherit__map" alt="Inheritance graph"></center>
35<map name="mprod__inherit__map">
36<area shape="rect" href="classcompositepdf.html" title="Abstract composition of pdfs, a base for specific classes." alt="" coords="5,7,112,33"><area shape="rect" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies." alt="" coords="136,7,189,33"></map>
37<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
38<div class="dynheader">
39Collaboration diagram for mprod:</div>
40<div class="dynsection">
41<p><center><img src="classmprod__coll__graph.png" border="0" usemap="#mprod__coll__map" alt="Collaboration graph"></center>
42<map name="mprod__coll__map">
43<area shape="rect" href="classcompositepdf.html" title="Abstract composition of pdfs, a base for specific classes." alt="" coords="5,204,112,231"><area shape="rect" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies." alt="" coords="136,204,189,231"><area shape="rect" href="classRV.html" title="Class representing variables, most often random variables." alt="" coords="137,7,175,33"><area shape="rect" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="172,105,220,132"></map>
44<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
45
46<p>
47<a href="classmprod-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
48<tr><td></td></tr>
49<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
50<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="419b303581a91ad85200bdcb4b3186f4"></a><!-- doxytag: member="mprod::mprod" ref="419b303581a91ad85200bdcb4b3186f4" args="(Array&lt; mpdf * &gt; mFacs)" -->
51&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmprod.html#419b303581a91ad85200bdcb4b3186f4">mprod</a> (Array&lt; <a class="el" href="classmpdf.html">mpdf</a> * &gt; mFacs)</td></tr>
52
53<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor from list of mFacs, Additional parameter overlap is left for future use. Do not set to true for <a class="el" href="classmprod.html" title="Chain rule decomposition of epdf.">mprod</a>. <br></td></tr>
54<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c15df5d0c7bb9dc82dd78f037b2550a8"></a><!-- doxytag: member="mprod::evalpdflog" ref="c15df5d0c7bb9dc82dd78f037b2550a8" args="(const vec &amp;val) const " -->
55double&nbsp;</td><td class="memItemRight" valign="bottom"><b>evalpdflog</b> (const vec &amp;val) const </td></tr>
56
57<tr><td class="memItemLeft" nowrap align="right" valign="top">vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmprod.html#a48887eb8738a9e5550bfc38eb8e9d68">samplecond</a> (const vec &amp;cond, double &amp;ll)</td></tr>
58
59<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the required moment of the <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a><a href="#a48887eb8738a9e5550bfc38eb8e9d68"></a><br></td></tr>
60<tr><td class="memItemLeft" nowrap align="right" valign="top">mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmprod.html#e171c40e210539c2af01d6237785620b">samplecond</a> (const vec &amp;cond, vec &amp;ll, int N)</td></tr>
61
62<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns.  <a href="#e171c40e210539c2af01d6237785620b"></a><br></td></tr>
63<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="635d219fb3e32852400d6f98aa4bdc93"></a><!-- doxytag: member="mprod::getrv" ref="635d219fb3e32852400d6f98aa4bdc93" args="(bool checkoverlap=false)" -->
64<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>getrv</b> (bool checkoverlap=false)</td></tr>
65
66<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5a4479785c1fdb2cc351fbea07b899ac"></a><!-- doxytag: member="mprod::setrvc" ref="5a4479785c1fdb2cc351fbea07b899ac" args="(const RV &amp;rv, RV &amp;rvc)" -->
67void&nbsp;</td><td class="memItemRight" valign="bottom"><b>setrvc</b> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb">rv</a>, <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab">rvc</a>)</td></tr>
68
69<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="08958c8f76d65de94ecc37b8d90bc77a"></a><!-- doxytag: member="mprod::setindices" ref="08958c8f76d65de94ecc37b8d90bc77a" args="(const RV &amp;rv)" -->
70void&nbsp;</td><td class="memItemRight" valign="bottom"><b>setindices</b> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb">rv</a>)</td></tr>
71
72<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3bd4ada95f381ea6c4cff2dc86e957c4"></a><!-- doxytag: member="mprod::setrvcinrv" ref="3bd4ada95f381ea6c4cff2dc86e957c4" args="(const RV &amp;rvc, Array&lt; ivec &gt; &amp;rvcind)" -->
73void&nbsp;</td><td class="memItemRight" valign="bottom"><b>setrvcinrv</b> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab">rvc</a>, Array&lt; ivec &gt; &amp;rvcind)</td></tr>
74
75<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0f95a0cc6ab40611f46804682446ed83"></a><!-- doxytag: member="mprod::condition" ref="0f95a0cc6ab40611f46804682446ed83" args="(const vec &amp;cond)" -->
76virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#0f95a0cc6ab40611f46804682446ed83">condition</a> (const vec &amp;cond)</td></tr>
77
78<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Update <code>ep</code> so that it represents this <a class="el" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> conditioned on <code>rvc</code> = cond. <br></td></tr>
79<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="80b738ece5bd4f8c4edaee4b38906f91"></a><!-- doxytag: member="mprod::evalcond" ref="80b738ece5bd4f8c4edaee4b38906f91" args="(const vec &amp;dt, const vec &amp;cond)" -->
80virtual double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#80b738ece5bd4f8c4edaee4b38906f91">evalcond</a> (const vec &amp;dt, const vec &amp;cond)</td></tr>
81
82<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shortcut for conditioning and evaluation of the internal <a class="el" href="classepdf.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>
83<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ec9c850305984582548e8deb64f0ffe8"></a><!-- doxytag: member="mprod::_rvc" ref="ec9c850305984582548e8deb64f0ffe8" args="()" -->
84<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#ec9c850305984582548e8deb64f0ffe8">_rvc</a> ()</td></tr>
85
86<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
87<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1e71ad4c66d5884c82d4a3b06b42fe32"></a><!-- doxytag: member="mprod::_rv" ref="1e71ad4c66d5884c82d4a3b06b42fe32" args="()" -->
88<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#1e71ad4c66d5884c82d4a3b06b42fe32">_rv</a> ()</td></tr>
89
90<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
91<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e17780ee5b2cfe05922a6c56af1462f8"></a><!-- doxytag: member="mprod::_epdf" ref="e17780ee5b2cfe05922a6c56af1462f8" args="()" -->
92<a class="el" href="classepdf.html">epdf</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#e17780ee5b2cfe05922a6c56af1462f8">_epdf</a> ()</td></tr>
93
94<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
95<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
96<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0883ce383e8475546df138719918f70e"></a><!-- doxytag: member="mprod::epdfs" ref="0883ce383e8475546df138719918f70e" args="" -->
97Array&lt; <a class="el" href="classepdf.html">epdf</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><b>epdfs</b></td></tr>
98
99<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cc85192d8abc01832937ed8b62e363a6"></a><!-- doxytag: member="mprod::rvcinds" ref="cc85192d8abc01832937ed8b62e363a6" args="" -->
100Array&lt; ivec &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmprod.html#cc85192d8abc01832937ed8b62e363a6">rvcinds</a></td></tr>
101
102<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Indeces of rvc in common rvc. <br></td></tr>
103<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c1646fe41ff5934d010e54ccaa46133f"></a><!-- doxytag: member="mprod::n" ref="c1646fe41ff5934d010e54ccaa46133f" args="" -->
104int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f">n</a></td></tr>
105
106<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of mpdfs in the composite. <br></td></tr>
107<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="637877061b917a16a0421bb5c4cd480d"></a><!-- doxytag: member="mprod::mpdfs" ref="637877061b917a16a0421bb5c4cd480d" args="" -->
108Array&lt; <a class="el" href="classmpdf.html">mpdf</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcompositepdf.html#637877061b917a16a0421bb5c4cd480d">mpdfs</a></td></tr>
109
110<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Elements of composition. <br></td></tr>
111<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4d4a8269f9faefeca8cdc251a5a29a7f"></a><!-- doxytag: member="mprod::rvsinrv" ref="4d4a8269f9faefeca8cdc251a5a29a7f" args="" -->
112Array&lt; ivec &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcompositepdf.html#4d4a8269f9faefeca8cdc251a5a29a7f">rvsinrv</a></td></tr>
113
114<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Indeces of rvs in common rv. <br></td></tr>
115<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3df07bb5e3ed36a3119b145043296676"></a><!-- doxytag: member="mprod::rvcsinrv" ref="3df07bb5e3ed36a3119b145043296676" args="" -->
116Array&lt; ivec &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcompositepdf.html#3df07bb5e3ed36a3119b145043296676">rvcsinrv</a></td></tr>
117
118<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Indeces of rvc in common rv. <br></td></tr>
119<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f6687c07ff07d47812dd565368ca59eb"></a><!-- doxytag: member="mprod::rv" ref="f6687c07ff07d47812dd565368ca59eb" args="" -->
120<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb">rv</a></td></tr>
121
122<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">modeled random variable <br></td></tr>
123<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="acb7dda792b3cd5576f39fa3129abbab"></a><!-- doxytag: member="mprod::rvc" ref="acb7dda792b3cd5576f39fa3129abbab" args="" -->
124<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab">rvc</a></td></tr>
125
126<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">random variable in condition <br></td></tr>
127<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7aa894208a32f3487827df6d5054424c"></a><!-- doxytag: member="mprod::ep" ref="7aa894208a32f3487827df6d5054424c" args="" -->
128<a class="el" href="classepdf.html">epdf</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#7aa894208a32f3487827df6d5054424c">ep</a></td></tr>
129
130<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">pointer to internal <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> <br></td></tr>
131</table>
132<hr><a name="_details"></a><h2>Detailed Description</h2>
133Chain rule decomposition of <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.
134<p>
135Probability density in the form of Chain-rule decomposition: \[ f(x_1,x_2,x_3) = f(x_1|x_2,x_3)f(x_2,x_3)f(x_3) \] Note that <hr><h2>Member Function Documentation</h2>
136<a class="anchor" name="a48887eb8738a9e5550bfc38eb8e9d68"></a><!-- doxytag: member="mprod::samplecond" ref="a48887eb8738a9e5550bfc38eb8e9d68" args="(const vec &amp;cond, double &amp;ll)" -->
137<div class="memitem">
138<div class="memproto">
139      <table class="memname">
140        <tr>
141          <td class="memname">vec mprod::samplecond           </td>
142          <td>(</td>
143          <td class="paramtype">const vec &amp;&nbsp;</td>
144          <td class="paramname"> <em>cond</em>, </td>
145        </tr>
146        <tr>
147          <td class="paramkey"></td>
148          <td></td>
149          <td class="paramtype">double &amp;&nbsp;</td>
150          <td class="paramname"> <em>ll</em></td><td>&nbsp;</td>
151        </tr>
152        <tr>
153          <td></td>
154          <td>)</td>
155          <td></td><td></td><td><code> [inline, virtual]</code></td>
156        </tr>
157      </table>
158</div>
159<div class="memdoc">
160
161<p>
162Returns the required moment of the <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.
163<p>
164Returns a sample from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_10.png">. <dl compact><dt><b>Parameters:</b></dt><dd>
165  <table border="0" cellspacing="2" cellpadding="0">
166    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>is numeric value of <code>rv</code> </td></tr>
167    <tr><td valign="top"></td><td valign="top"><em>ll</em>&nbsp;</td><td>is a return value of log-likelihood of the sample. </td></tr>
168  </table>
169</dl>
170
171<p>Reimplemented from <a class="el" href="classmpdf.html#3f172b79ec4a5ebc87898a5381141f1b">mpdf</a>.</p>
172
173<p>References <a class="el" href="libBM_8h-source.html#l00069">RV::count()</a>, <a class="el" href="libBM_8h-source.html#l00249">compositepdf::mpdfs</a>, <a class="el" href="libBM_8h-source.html#l00247">compositepdf::n</a>, <a class="el" href="libBM_8h-source.html#l00194">mpdf::rv</a>, <a class="el" href="emix_8h-source.html#l00075">rvcinds</a>, <a class="el" href="libBM_8h-source.html#l00253">compositepdf::rvcsinrv</a>, and <a class="el" href="libBM_8h-source.html#l00251">compositepdf::rvsinrv</a>.</p>
174
175<p>Referenced by <a class="el" href="emix_8h-source.html#l00121">samplecond()</a>.</p>
176
177</div>
178</div><p>
179<a class="anchor" name="e171c40e210539c2af01d6237785620b"></a><!-- doxytag: member="mprod::samplecond" ref="e171c40e210539c2af01d6237785620b" args="(const vec &amp;cond, vec &amp;ll, int N)" -->
180<div class="memitem">
181<div class="memproto">
182      <table class="memname">
183        <tr>
184          <td class="memname">mat mprod::samplecond           </td>
185          <td>(</td>
186          <td class="paramtype">const vec &amp;&nbsp;</td>
187          <td class="paramname"> <em>cond</em>, </td>
188        </tr>
189        <tr>
190          <td class="paramkey"></td>
191          <td></td>
192          <td class="paramtype">vec &amp;&nbsp;</td>
193          <td class="paramname"> <em>ll</em>, </td>
194        </tr>
195        <tr>
196          <td class="paramkey"></td>
197          <td></td>
198          <td class="paramtype">int&nbsp;</td>
199          <td class="paramname"> <em>N</em></td><td>&nbsp;</td>
200        </tr>
201        <tr>
202          <td></td>
203          <td>)</td>
204          <td></td><td></td><td><code> [inline, virtual]</code></td>
205        </tr>
206      </table>
207</div>
208<div class="memdoc">
209
210<p>
211Returns.
212<p>
213<dl compact><dt><b>Parameters:</b></dt><dd>
214  <table border="0" cellspacing="2" cellpadding="0">
215    <tr><td valign="top"></td><td valign="top"><em>N</em>&nbsp;</td><td>samples from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_10.png">. </td></tr>
216    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>is numeric value of <code>rv</code> </td></tr>
217    <tr><td valign="top"></td><td valign="top"><em>ll</em>&nbsp;</td><td>is a return value of log-likelihood of the sample. </td></tr>
218  </table>
219</dl>
220
221<p>Reimplemented from <a class="el" href="classmpdf.html#0e37163660f93df2a4d723cedb1da89c">mpdf</a>.</p>
222
223<p>References <a class="el" href="libBM_8h-source.html#l00069">RV::count()</a>, <a class="el" href="libBM_8h-source.html#l00194">mpdf::rv</a>, and <a class="el" href="emix_8h-source.html#l00098">samplecond()</a>.</p>
224
225</div>
226</div><p>
227<hr>The documentation for this class was generated from the following file:<ul>
228<li>work/git/mixpp/bdm/stat/<a class="el" href="emix_8h-source.html">emix.h</a></ul>
229</div>
230<hr size="1"><address style="text-align: right;"><small>Generated on Thu Oct 9 21:26:42 2008 for mixpp by&nbsp;
231<a href="http://www.doxygen.org/index.html">
232<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
233</body>
234</html>
Note: See TracBrowser for help on using the browser.