root/doc/html/classemix.html @ 224

Revision 224, 16.1 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>
[219]65<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 " -->
66double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#82691a72b583dab957cbd60d9283e47a">evallog</a> (const vec &amp;val) const </td></tr>
[32]67
[106]68<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute log-probability of argument <code>val</code>. <br></td></tr>
[219]69<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 " -->
70vec&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]71
72<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute log-probability of multiple values argument <code>val</code>. <br></td></tr>
[219]73<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 " -->
74mat&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]75
[219]76<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Auxiliary function that returns pdflog for each component. <br></td></tr>
[210]77<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 " -->
78<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>
79
80<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>
81<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 " -->
82<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>
83
84<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]85<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="35baf0f62307455cebfbf462144b4dd8"></a><!-- doxytag: member="emix::_w" ref="35baf0f62307455cebfbf462144b4dd8" args="()" -->
86vec &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#35baf0f62307455cebfbf462144b4dd8">_w</a> ()</td></tr>
87
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns a pointer to the internal mean value. Use with Care! <br></td></tr>
[181]89<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4d7baeb2a9e3fca1d8fd32a107df291d"></a><!-- doxytag: member="emix::ownComs" ref="4d7baeb2a9e3fca1d8fd32a107df291d" args="()" -->
90void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#4d7baeb2a9e3fca1d8fd32a107df291d">ownComs</a> ()</td></tr>
91
92<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]93<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="95d175b2daa1d896ceffd69b70e02efb"></a><!-- doxytag: member="emix::_Coms" ref="95d175b2daa1d896ceffd69b70e02efb" args="(int i)" -->
94<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]95
[210]96<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
97<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 " -->
98virtual mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#76608914c3b19e150292d5c56e93e508">sample_m</a> (int N) const </td></tr>
99
[106]100<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]101<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ca0d32aabb4cbba347e0c37fe8607562"></a><!-- doxytag: member="emix::_rv" ref="ca0d32aabb4cbba347e0c37fe8607562" args="() const " -->
102const <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>
103
[162]104<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function, possibly dangerous! <br></td></tr>
[171]105<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)" -->
106void&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>
107
108<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">modifier function - useful when copying epdfs <br></td></tr>
[32]109<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
[106]110<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cdc8f4e2a5e43595ac5450d8a7f9d1ab"></a><!-- doxytag: member="emix::w" ref="cdc8f4e2a5e43595ac5450d8a7f9d1ab" args="" -->
111vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#cdc8f4e2a5e43595ac5450d8a7f9d1ab">w</a></td></tr>
[32]112
[106]113<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">weights of the components <br></td></tr>
[32]114<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7155d827417b53fb6aa5cff1459e6eb4"></a><!-- doxytag: member="emix::Coms" ref="7155d827417b53fb6aa5cff1459e6eb4" args="" -->
[106]115Array&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]116
[106]117<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Component (epdfs). <br></td></tr>
[181]118<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7d0d863e6066ee02947914ff06ac34e8"></a><!-- doxytag: member="emix::destroyComs" ref="7d0d863e6066ee02947914ff06ac34e8" args="" -->
119bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#7d0d863e6066ee02947914ff06ac34e8">destroyComs</a></td></tr>
120
121<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flag if owning Coms. <br></td></tr>
[32]122<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="74da992e3f5d598da8850b646b79b9d9"></a><!-- doxytag: member="emix::rv" ref="74da992e3f5d598da8850b646b79b9d9" args="" -->
[106]123<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]124
[106]125<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Identified of the random variable. <br></td></tr>
[32]126</table>
127<hr><a name="_details"></a><h2>Detailed Description</h2>
[106]128Mixture of epdfs.
129<p>
130Density function: <p class="formulaDsp">
131<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">
132<p>
[210]133 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>
134<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)" -->
135<div class="memitem">
136<div class="memproto">
137      <table class="memname">
138        <tr>
139          <td class="memname">void emix::set_parameters           </td>
140          <td>(</td>
141          <td class="paramtype">const vec &amp;&nbsp;</td>
142          <td class="paramname"> <em>w</em>, </td>
143        </tr>
144        <tr>
145          <td class="paramkey"></td>
146          <td></td>
147          <td class="paramtype">const Array&lt; <a class="el" href="classepdf.html">epdf</a> * &gt; &amp;&nbsp;</td>
148          <td class="paramname"> <em>Coms</em>, </td>
149        </tr>
150        <tr>
151          <td class="paramkey"></td>
152          <td></td>
153          <td class="paramtype">bool&nbsp;</td>
154          <td class="paramname"> <em>copy</em> = <code>true</code></td><td>&nbsp;</td>
155        </tr>
156        <tr>
157          <td></td>
158          <td>)</td>
159          <td></td><td></td><td></td>
160        </tr>
161      </table>
162</div>
163<div class="memdoc">
164
165<p>
[224]166Set 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.
167<p>References <a class="el" href="libBM_8h-source.html#l00202">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]168
[219]169<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#l00282">mmix::set_parameters()</a>.</p>
[210]170
171</div>
172</div><p>
173<hr>The documentation for this class was generated from the following files:<ul>
[145]174<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]175</div>
[224]176<hr size="1"><address style="text-align: right;"><small>Generated on Mon Jan 5 19:29:16 2009 for mixpp by&nbsp;
[32]177<a href="http://www.doxygen.org/index.html">
[139]178<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
[32]179</body>
180</html>
Note: See TracBrowser for help on using the browser.