root/doc/html/classemix.html @ 234

Revision 234, 16.6 kB (checked in by smidl, 16 years ago)

doc

RevLine 
[32]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: emix 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>
[139]7<!-- Generated by Doxygen 1.5.6 -->
[106]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>
[219]13      <li><a href="modules.html"><span>Modules</span></a></li>
[106]14      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
15      <li><a href="files.html"><span>Files</span></a></li>
16    </ul>
17  </div>
18  <div class="tabs">
19    <ul>
20      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
21      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
22      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
23    </ul>
24  </div>
[32]25</div>
[106]26<div class="contents">
27<h1>emix Class Reference</h1><!-- doxytag: class="emix" --><!-- doxytag: inherits="epdf" -->Mixture of epdfs. 
[32]28<a href="#_details">More...</a>
29<p>
[106]30<code>#include &lt;<a class="el" href="emix_8h-source.html">emix.h</a>&gt;</code>
[32]31<p>
32<div class="dynheader">
33Inheritance diagram for emix:</div>
34<div class="dynsection">
35<p><center><img src="classemix__inherit__graph.png" border="0" usemap="#emix__inherit__map" alt="Inheritance graph"></center>
36<map name="emix__inherit__map">
[106]37<area shape="rect" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="7,7,52,31"></map>
[32]38<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
39<div class="dynheader">
40Collaboration diagram for emix:</div>
41<div class="dynsection">
42<p><center><img src="classemix__coll__graph.png" border="0" usemap="#emix__coll__map" alt="Collaboration graph"></center>
43<map name="emix__coll__map">
[106]44<area shape="rect" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="7,95,52,119"><area shape="rect" href="classRV.html" title="Class representing variables, most often random variables." alt="" coords="11,7,48,31"></map>
[32]45<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
46
47<p>
48<a href="classemix-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
49<tr><td></td></tr>
50<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
[181]51<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="62194619791d5f1da88cad01cfc9339d"></a><!-- doxytag: member="emix::emix" ref="62194619791d5f1da88cad01cfc9339d" args="(const RV &amp;rv)" -->
52&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#62194619791d5f1da88cad01cfc9339d">emix</a> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a>)</td></tr>
[32]53
54<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <br></td></tr>
[210]55<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#d3789d50a3327a6de552db077af5e4c5">set_parameters</a> (const vec &amp;<a class="el" href="classemix.html#cdc8f4e2a5e43595ac5450d8a7f9d1ab">w</a>, const Array&lt; <a class="el" href="classepdf.html">epdf</a> * &gt; &amp;<a class="el" href="classemix.html#7155d827417b53fb6aa5cff1459e6eb4">Coms</a>, bool copy=true)</td></tr>
[32]56
[171]57<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0650601f24e633e0ab09aa1e46c14483"></a><!-- doxytag: member="emix::sample" ref="0650601f24e633e0ab09aa1e46c14483" args="() const " -->
58vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#0650601f24e633e0ab09aa1e46c14483">sample</a> () const </td></tr>
[32]59
[171]60<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a sample, <img class="formulaInl" alt="$x$" src="form_28.png"> from density <img class="formulaInl" alt="$epdf(rv)$" src="form_59.png">. <br></td></tr>
[106]61<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b662a51d042b062020460e64bff4e9e8"></a><!-- doxytag: member="emix::mean" ref="b662a51d042b062020460e64bff4e9e8" args="() const " -->
62vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#b662a51d042b062020460e64bff4e9e8">mean</a> () const </td></tr>
[32]63
[106]64<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return expected value <br></td></tr>
[234]65<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="73b96c9989b398c2a16417a70773442e"></a><!-- doxytag: member="emix::variance" ref="73b96c9989b398c2a16417a70773442e" args="() const " -->
66vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#73b96c9989b398c2a16417a70773442e">variance</a> () const </td></tr>
67
68<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return expected variance (not covariance!) <br></td></tr>
[219]69<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="82691a72b583dab957cbd60d9283e47a"></a><!-- doxytag: member="emix::evallog" ref="82691a72b583dab957cbd60d9283e47a" args="(const vec &amp;val) const " -->
70double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#82691a72b583dab957cbd60d9283e47a">evallog</a> (const vec &amp;val) const </td></tr>
[32]71
[106]72<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute log-probability of argument <code>val</code>. <br></td></tr>
[219]73<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b3eb9e153e8bfdb6bb47adecc278cbca"></a><!-- doxytag: member="emix::evallog_m" ref="b3eb9e153e8bfdb6bb47adecc278cbca" args="(const mat &amp;Val) const " -->
74vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#b3eb9e153e8bfdb6bb47adecc278cbca">evallog_m</a> (const mat &amp;Val) const </td></tr>
[210]75
76<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute log-probability of multiple values argument <code>val</code>. <br></td></tr>
[219]77<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="44ae2b86c650c2ccb967969c1859d268"></a><!-- doxytag: member="emix::evallog_M" ref="44ae2b86c650c2ccb967969c1859d268" args="(const mat &amp;Val) const " -->
78mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#44ae2b86c650c2ccb967969c1859d268">evallog_M</a> (const mat &amp;Val) const </td></tr>
[210]79
[219]80<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Auxiliary function that returns pdflog for each component. <br></td></tr>
[210]81<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="33afde698093d458ce71875f7ee7384a"></a><!-- doxytag: member="emix::marginal" ref="33afde698093d458ce71875f7ee7384a" args="(const RV &amp;rv) const " -->
82<a class="el" href="classemix.html">emix</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#33afde698093d458ce71875f7ee7384a">marginal</a> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a>) const </td></tr>
83
84<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return marginal density on the given <a class="el" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>, the remainig rvs are intergrated out. <br></td></tr>
85<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ebf50c387034f72040c83d38738549b3"></a><!-- doxytag: member="emix::condition" ref="ebf50c387034f72040c83d38738549b3" args="(const RV &amp;rv) const " -->
86<a class="el" href="classmratio.html">mratio</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#ebf50c387034f72040c83d38738549b3">condition</a> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a>) const </td></tr>
87
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return conditional density on the given <a class="el" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>, the remaining rvs will be in conditioning. <br></td></tr>
[106]89<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="35baf0f62307455cebfbf462144b4dd8"></a><!-- doxytag: member="emix::_w" ref="35baf0f62307455cebfbf462144b4dd8" args="()" -->
90vec &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#35baf0f62307455cebfbf462144b4dd8">_w</a> ()</td></tr>
91
92<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns a pointer to the internal mean value. Use with Care! <br></td></tr>
[181]93<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4d7baeb2a9e3fca1d8fd32a107df291d"></a><!-- doxytag: member="emix::ownComs" ref="4d7baeb2a9e3fca1d8fd32a107df291d" args="()" -->
94void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#4d7baeb2a9e3fca1d8fd32a107df291d">ownComs</a> ()</td></tr>
95
96<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Auxiliary function for taking ownership of the <a class="el" href="classemix.html#7155d827417b53fb6aa5cff1459e6eb4" title="Component (epdfs).">Coms()</a>. <br></td></tr>
[210]97<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="95d175b2daa1d896ceffd69b70e02efb"></a><!-- doxytag: member="emix::_Coms" ref="95d175b2daa1d896ceffd69b70e02efb" args="(int i)" -->
98<a class="el" href="classepdf.html">epdf</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#95d175b2daa1d896ceffd69b70e02efb">_Coms</a> (int i)</td></tr>
[106]99
[210]100<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
101<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="76608914c3b19e150292d5c56e93e508"></a><!-- doxytag: member="emix::sample_m" ref="76608914c3b19e150292d5c56e93e508" args="(int N) const " -->
102virtual mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#76608914c3b19e150292d5c56e93e508">sample_m</a> (int N) const </td></tr>
103
[106]104<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns N samples from density <img class="formulaInl" alt="$epdf(rv)$" src="form_59.png">. <br></td></tr>
[171]105<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ca0d32aabb4cbba347e0c37fe8607562"></a><!-- doxytag: member="emix::_rv" ref="ca0d32aabb4cbba347e0c37fe8607562" args="() const " -->
106const <a class="el" href="classRV.html">RV</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#ca0d32aabb4cbba347e0c37fe8607562">_rv</a> () const </td></tr>
107
[162]108<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function, possibly dangerous! <br></td></tr>
[171]109<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7fb94ce90d1ac7077d29f7d6a6c3e0a5"></a><!-- doxytag: member="emix::_renewrv" ref="7fb94ce90d1ac7077d29f7d6a6c3e0a5" args="(const RV &amp;in_rv)" -->
110void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#7fb94ce90d1ac7077d29f7d6a6c3e0a5">_renewrv</a> (const <a class="el" href="classRV.html">RV</a> &amp;in_rv)</td></tr>
111
112<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">modifier function - useful when copying epdfs <br></td></tr>
[32]113<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
[106]114<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cdc8f4e2a5e43595ac5450d8a7f9d1ab"></a><!-- doxytag: member="emix::w" ref="cdc8f4e2a5e43595ac5450d8a7f9d1ab" args="" -->
115vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#cdc8f4e2a5e43595ac5450d8a7f9d1ab">w</a></td></tr>
[32]116
[106]117<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">weights of the components <br></td></tr>
[32]118<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7155d827417b53fb6aa5cff1459e6eb4"></a><!-- doxytag: member="emix::Coms" ref="7155d827417b53fb6aa5cff1459e6eb4" args="" -->
[106]119Array&lt; <a class="el" href="classepdf.html">epdf</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#7155d827417b53fb6aa5cff1459e6eb4">Coms</a></td></tr>
[32]120
[106]121<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Component (epdfs). <br></td></tr>
[181]122<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7d0d863e6066ee02947914ff06ac34e8"></a><!-- doxytag: member="emix::destroyComs" ref="7d0d863e6066ee02947914ff06ac34e8" args="" -->
123bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#7d0d863e6066ee02947914ff06ac34e8">destroyComs</a></td></tr>
124
125<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flag if owning Coms. <br></td></tr>
[32]126<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="74da992e3f5d598da8850b646b79b9d9"></a><!-- doxytag: member="emix::rv" ref="74da992e3f5d598da8850b646b79b9d9" args="" -->
[106]127<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a></td></tr>
[32]128
[106]129<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Identified of the random variable. <br></td></tr>
[32]130</table>
131<hr><a name="_details"></a><h2>Detailed Description</h2>
[106]132Mixture of epdfs.
133<p>
134Density function: <p class="formulaDsp">
135<img class="formulaDsp" alt="\[ f(x) = \sum_{i=1}^{n} w_{i} f_i(x), \quad \sum_{i=1}^n w_i = 1. \]" src="form_63.png">
136<p>
[210]137 where <img class="formulaInl" alt="$f_i(x)$" src="form_64.png"> is any density on random variable <img class="formulaInl" alt="$x$" src="form_28.png">, called <em>component</em>, <hr><h2>Member Function Documentation</h2>
138<a class="anchor" name="d3789d50a3327a6de552db077af5e4c5"></a><!-- doxytag: member="emix::set_parameters" ref="d3789d50a3327a6de552db077af5e4c5" args="(const vec &amp;w, const Array&lt; epdf * &gt; &amp;Coms, bool copy=true)" -->
139<div class="memitem">
140<div class="memproto">
141      <table class="memname">
142        <tr>
143          <td class="memname">void emix::set_parameters           </td>
144          <td>(</td>
145          <td class="paramtype">const vec &amp;&nbsp;</td>
146          <td class="paramname"> <em>w</em>, </td>
147        </tr>
148        <tr>
149          <td class="paramkey"></td>
150          <td></td>
151          <td class="paramtype">const Array&lt; <a class="el" href="classepdf.html">epdf</a> * &gt; &amp;&nbsp;</td>
152          <td class="paramname"> <em>Coms</em>, </td>
153        </tr>
154        <tr>
155          <td class="paramkey"></td>
156          <td></td>
157          <td class="paramtype">bool&nbsp;</td>
158          <td class="paramname"> <em>copy</em> = <code>true</code></td><td>&nbsp;</td>
159        </tr>
160        <tr>
161          <td></td>
162          <td>)</td>
163          <td></td><td></td><td></td>
164        </tr>
165      </table>
166</div>
167<div class="memdoc">
168
169<p>
[224]170Set weights <code>w</code> and components <code>Coms</code> By default Coms are copied inside. Parameter <code>copy</code> can be set to false if Coms live externally. Use method <a class="el" href="classemix.html#4d7baeb2a9e3fca1d8fd32a107df291d" title="Auxiliary function for taking ownership of the Coms().">ownComs()</a> if Coms should be destroyed by the destructor.
[234]171<p>References <a class="el" href="libBM_8h-source.html#l00205">epdf::_rv()</a>, <a class="el" href="emix_8h-source.html#l00091">Coms</a>, <a class="el" href="emix_8h-source.html#l00093">destroyComs</a>, <a class="el" href="libBM_8cpp-source.html#l00111">RV::equal()</a>, <a class="el" href="libBM_8h-source.html#l00166">epdf::rv</a>, and <a class="el" href="emix_8h-source.html#l00089">w</a>.</p>
[210]172
[234]173<p>Referenced by <a class="el" href="emix_8cpp-source.html#l00034">marginal()</a>, <a class="el" href="mixef_8cpp-source.html#l00134">MixEF::predictor()</a>, and <a class="el" href="emix_8h-source.html#l00297">mmix::set_parameters()</a>.</p>
[210]174
175</div>
176</div><p>
177<hr>The documentation for this class was generated from the following files:<ul>
[145]178<li>work/git/mixpp/bdm/stat/<a class="el" href="emix_8h-source.html">emix.h</a><li>work/git/mixpp/bdm/stat/emix.cpp</ul>
[106]179</div>
[234]180<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 15 10:51:07 2009 for mixpp by&nbsp;
[32]181<a href="http://www.doxygen.org/index.html">
[139]182<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
[32]183</body>
184</html>
Note: See TracBrowser for help on using the browser.