| 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> | 
|---|
| 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 Page</span></a></li> | 
|---|
| 12 |       <li><a href="pages.html"><span>Related 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 List</span></a></li> | 
|---|
| 20 |       <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> | 
|---|
| 21 |       <li><a href="functions.html"><span>Class Members</span></a></li> | 
|---|
| 22 |     </ul> | 
|---|
| 23 |   </div> | 
|---|
| 24 | </div> | 
|---|
| 25 | <div class="contents"> | 
|---|
| 26 | <h1>emix Class Reference</h1><!-- doxytag: class="emix" --><!-- doxytag: inherits="epdf" -->Mixture of epdfs.   | 
|---|
| 27 | <a href="#_details">More...</a> | 
|---|
| 28 | <p> | 
|---|
| 29 | <code>#include <<a class="el" href="emix_8h-source.html">emix.h</a>></code> | 
|---|
| 30 | <p> | 
|---|
| 31 | <div class="dynheader"> | 
|---|
| 32 | Inheritance diagram for emix:</div> | 
|---|
| 33 | <div class="dynsection"> | 
|---|
| 34 | <p><center><img src="classemix__inherit__graph.png" border="0" usemap="#emix__inherit__map" alt="Inheritance graph"></center> | 
|---|
| 35 | <map name="emix__inherit__map"> | 
|---|
| 36 | <area shape="rect" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="7,7,52,31"></map> | 
|---|
| 37 | <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> | 
|---|
| 38 | <div class="dynheader"> | 
|---|
| 39 | Collaboration diagram for emix:</div> | 
|---|
| 40 | <div class="dynsection"> | 
|---|
| 41 | <p><center><img src="classemix__coll__graph.png" border="0" usemap="#emix__coll__map" alt="Collaboration graph"></center> | 
|---|
| 42 | <map name="emix__coll__map"> | 
|---|
| 43 | <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> | 
|---|
| 44 | <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> | 
|---|
| 45 |  | 
|---|
| 46 | <p> | 
|---|
| 47 | <a href="classemix-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="62194619791d5f1da88cad01cfc9339d"></a><!-- doxytag: member="emix::emix" ref="62194619791d5f1da88cad01cfc9339d" args="(const RV &rv)" --> | 
|---|
| 51 |  </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#62194619791d5f1da88cad01cfc9339d">emix</a> (const <a class="el" href="classRV.html">RV</a> &<a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a>)</td></tr> | 
|---|
| 52 |  | 
|---|
| 53 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <br></td></tr> | 
|---|
| 54 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#d3789d50a3327a6de552db077af5e4c5">set_parameters</a> (const vec &<a class="el" href="classemix.html#cdc8f4e2a5e43595ac5450d8a7f9d1ab">w</a>, const Array< <a class="el" href="classepdf.html">epdf</a> * > &<a class="el" href="classemix.html#7155d827417b53fb6aa5cff1459e6eb4">Coms</a>, bool copy=true)</td></tr> | 
|---|
| 55 |  | 
|---|
| 56 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0650601f24e633e0ab09aa1e46c14483"></a><!-- doxytag: member="emix::sample" ref="0650601f24e633e0ab09aa1e46c14483" args="() const " --> | 
|---|
| 57 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#0650601f24e633e0ab09aa1e46c14483">sample</a> () const </td></tr> | 
|---|
| 58 |  | 
|---|
| 59 | <tr><td class="mdescLeft"> </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> | 
|---|
| 60 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b662a51d042b062020460e64bff4e9e8"></a><!-- doxytag: member="emix::mean" ref="b662a51d042b062020460e64bff4e9e8" args="() const " --> | 
|---|
| 61 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#b662a51d042b062020460e64bff4e9e8">mean</a> () const </td></tr> | 
|---|
| 62 |  | 
|---|
| 63 | <tr><td class="mdescLeft"> </td><td class="mdescRight">return expected value <br></td></tr> | 
|---|
| 64 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="469e910479b3402589104ef3bb1b5741"></a><!-- doxytag: member="emix::evalpdflog" ref="469e910479b3402589104ef3bb1b5741" args="(const vec &val) const " --> | 
|---|
| 65 | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#469e910479b3402589104ef3bb1b5741">evalpdflog</a> (const vec &val) const </td></tr> | 
|---|
| 66 |  | 
|---|
| 67 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Compute log-probability of argument <code>val</code>. <br></td></tr> | 
|---|
| 68 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="375bfba7c79915c88c2e612bcf83dacb"></a><!-- doxytag: member="emix::evalpdflog_m" ref="375bfba7c79915c88c2e612bcf83dacb" args="(const mat &Val) const " --> | 
|---|
| 69 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#375bfba7c79915c88c2e612bcf83dacb">evalpdflog_m</a> (const mat &Val) const </td></tr> | 
|---|
| 70 |  | 
|---|
| 71 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Compute log-probability of multiple values argument <code>val</code>. <br></td></tr> | 
|---|
| 72 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="07b5638de45d1fe83eb4da37594fcc68"></a><!-- doxytag: member="emix::evalpdflog_M" ref="07b5638de45d1fe83eb4da37594fcc68" args="(const mat &Val) const " --> | 
|---|
| 73 | mat </td><td class="memItemRight" valign="bottom"><b>evalpdflog_M</b> (const mat &Val) const </td></tr> | 
|---|
| 74 |  | 
|---|
| 75 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="33afde698093d458ce71875f7ee7384a"></a><!-- doxytag: member="emix::marginal" ref="33afde698093d458ce71875f7ee7384a" args="(const RV &rv) const " --> | 
|---|
| 76 | <a class="el" href="classemix.html">emix</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#33afde698093d458ce71875f7ee7384a">marginal</a> (const <a class="el" href="classRV.html">RV</a> &<a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a>) const </td></tr> | 
|---|
| 77 |  | 
|---|
| 78 | <tr><td class="mdescLeft"> </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> | 
|---|
| 79 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ebf50c387034f72040c83d38738549b3"></a><!-- doxytag: member="emix::condition" ref="ebf50c387034f72040c83d38738549b3" args="(const RV &rv) const " --> | 
|---|
| 80 | <a class="el" href="classmratio.html">mratio</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#ebf50c387034f72040c83d38738549b3">condition</a> (const <a class="el" href="classRV.html">RV</a> &<a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a>) const </td></tr> | 
|---|
| 81 |  | 
|---|
| 82 | <tr><td class="mdescLeft"> </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> | 
|---|
| 83 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="35baf0f62307455cebfbf462144b4dd8"></a><!-- doxytag: member="emix::_w" ref="35baf0f62307455cebfbf462144b4dd8" args="()" --> | 
|---|
| 84 | vec & </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#35baf0f62307455cebfbf462144b4dd8">_w</a> ()</td></tr> | 
|---|
| 85 |  | 
|---|
| 86 | <tr><td class="mdescLeft"> </td><td class="mdescRight">returns a pointer to the internal mean value. Use with Care! <br></td></tr> | 
|---|
| 87 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4d7baeb2a9e3fca1d8fd32a107df291d"></a><!-- doxytag: member="emix::ownComs" ref="4d7baeb2a9e3fca1d8fd32a107df291d" args="()" --> | 
|---|
| 88 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#4d7baeb2a9e3fca1d8fd32a107df291d">ownComs</a> ()</td></tr> | 
|---|
| 89 |  | 
|---|
| 90 | <tr><td class="mdescLeft"> </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> | 
|---|
| 91 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="95d175b2daa1d896ceffd69b70e02efb"></a><!-- doxytag: member="emix::_Coms" ref="95d175b2daa1d896ceffd69b70e02efb" args="(int i)" --> | 
|---|
| 92 | <a class="el" href="classepdf.html">epdf</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#95d175b2daa1d896ceffd69b70e02efb">_Coms</a> (int i)</td></tr> | 
|---|
| 93 |  | 
|---|
| 94 | <tr><td class="mdescLeft"> </td><td class="mdescRight">access function <br></td></tr> | 
|---|
| 95 | <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 " --> | 
|---|
| 96 | virtual mat </td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#76608914c3b19e150292d5c56e93e508">sample_m</a> (int N) const </td></tr> | 
|---|
| 97 |  | 
|---|
| 98 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns N samples from density <img class="formulaInl" alt="$epdf(rv)$" src="form_59.png">. <br></td></tr> | 
|---|
| 99 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ca0d32aabb4cbba347e0c37fe8607562"></a><!-- doxytag: member="emix::_rv" ref="ca0d32aabb4cbba347e0c37fe8607562" args="() const " --> | 
|---|
| 100 | const <a class="el" href="classRV.html">RV</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#ca0d32aabb4cbba347e0c37fe8607562">_rv</a> () const </td></tr> | 
|---|
| 101 |  | 
|---|
| 102 | <tr><td class="mdescLeft"> </td><td class="mdescRight">access function, possibly dangerous! <br></td></tr> | 
|---|
| 103 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7fb94ce90d1ac7077d29f7d6a6c3e0a5"></a><!-- doxytag: member="emix::_renewrv" ref="7fb94ce90d1ac7077d29f7d6a6c3e0a5" args="(const RV &in_rv)" --> | 
|---|
| 104 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#7fb94ce90d1ac7077d29f7d6a6c3e0a5">_renewrv</a> (const <a class="el" href="classRV.html">RV</a> &in_rv)</td></tr> | 
|---|
| 105 |  | 
|---|
| 106 | <tr><td class="mdescLeft"> </td><td class="mdescRight">modifier function - useful when copying epdfs <br></td></tr> | 
|---|
| 107 | <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> | 
|---|
| 108 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cdc8f4e2a5e43595ac5450d8a7f9d1ab"></a><!-- doxytag: member="emix::w" ref="cdc8f4e2a5e43595ac5450d8a7f9d1ab" args="" --> | 
|---|
| 109 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#cdc8f4e2a5e43595ac5450d8a7f9d1ab">w</a></td></tr> | 
|---|
| 110 |  | 
|---|
| 111 | <tr><td class="mdescLeft"> </td><td class="mdescRight">weights of the components <br></td></tr> | 
|---|
| 112 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7155d827417b53fb6aa5cff1459e6eb4"></a><!-- doxytag: member="emix::Coms" ref="7155d827417b53fb6aa5cff1459e6eb4" args="" --> | 
|---|
| 113 | Array< <a class="el" href="classepdf.html">epdf</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#7155d827417b53fb6aa5cff1459e6eb4">Coms</a></td></tr> | 
|---|
| 114 |  | 
|---|
| 115 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Component (epdfs). <br></td></tr> | 
|---|
| 116 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7d0d863e6066ee02947914ff06ac34e8"></a><!-- doxytag: member="emix::destroyComs" ref="7d0d863e6066ee02947914ff06ac34e8" args="" --> | 
|---|
| 117 | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#7d0d863e6066ee02947914ff06ac34e8">destroyComs</a></td></tr> | 
|---|
| 118 |  | 
|---|
| 119 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flag if owning Coms. <br></td></tr> | 
|---|
| 120 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="74da992e3f5d598da8850b646b79b9d9"></a><!-- doxytag: member="emix::rv" ref="74da992e3f5d598da8850b646b79b9d9" args="" --> | 
|---|
| 121 | <a class="el" href="classRV.html">RV</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9">rv</a></td></tr> | 
|---|
| 122 |  | 
|---|
| 123 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Identified of the random variable. <br></td></tr> | 
|---|
| 124 | </table> | 
|---|
| 125 | <hr><a name="_details"></a><h2>Detailed Description</h2> | 
|---|
| 126 | Mixture of epdfs.  | 
|---|
| 127 | <p> | 
|---|
| 128 | Density function: <p class="formulaDsp"> | 
|---|
| 129 | <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"> | 
|---|
| 130 | <p> | 
|---|
| 131 |  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> | 
|---|
| 132 | <a class="anchor" name="d3789d50a3327a6de552db077af5e4c5"></a><!-- doxytag: member="emix::set_parameters" ref="d3789d50a3327a6de552db077af5e4c5" args="(const vec &w, const Array< epdf * > &Coms, bool copy=true)" --> | 
|---|
| 133 | <div class="memitem"> | 
|---|
| 134 | <div class="memproto"> | 
|---|
| 135 |       <table class="memname"> | 
|---|
| 136 |         <tr> | 
|---|
| 137 |           <td class="memname">void emix::set_parameters           </td> | 
|---|
| 138 |           <td>(</td> | 
|---|
| 139 |           <td class="paramtype">const vec & </td> | 
|---|
| 140 |           <td class="paramname"> <em>w</em>, </td> | 
|---|
| 141 |         </tr> | 
|---|
| 142 |         <tr> | 
|---|
| 143 |           <td class="paramkey"></td> | 
|---|
| 144 |           <td></td> | 
|---|
| 145 |           <td class="paramtype">const Array< <a class="el" href="classepdf.html">epdf</a> * > & </td> | 
|---|
| 146 |           <td class="paramname"> <em>Coms</em>, </td> | 
|---|
| 147 |         </tr> | 
|---|
| 148 |         <tr> | 
|---|
| 149 |           <td class="paramkey"></td> | 
|---|
| 150 |           <td></td> | 
|---|
| 151 |           <td class="paramtype">bool </td> | 
|---|
| 152 |           <td class="paramname"> <em>copy</em> = <code>true</code></td><td> </td> | 
|---|
| 153 |         </tr> | 
|---|
| 154 |         <tr> | 
|---|
| 155 |           <td></td> | 
|---|
| 156 |           <td>)</td> | 
|---|
| 157 |           <td></td><td></td><td></td> | 
|---|
| 158 |         </tr> | 
|---|
| 159 |       </table> | 
|---|
| 160 | </div> | 
|---|
| 161 | <div class="memdoc"> | 
|---|
| 162 |  | 
|---|
| 163 | <p> | 
|---|
| 164 | Set weights <code>w</code> and components <code>Coms</code> By default Coms are copied inside. <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>copy</em> </td><td>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. </td></tr> | 
|---|
| 167 |   </table> | 
|---|
| 168 | </dl> | 
|---|
| 169 |  | 
|---|
| 170 | <p>References <a class="el" href="libBM_8h-source.html#l00193">epdf::_rv()</a>, <a class="el" href="emix_8h-source.html#l00088">Coms</a>, <a class="el" href="emix_8h-source.html#l00090">destroyComs</a>, <a class="el" href="libBM_8cpp-source.html#l00109">RV::equal()</a>, <a class="el" href="libBM_8h-source.html#l00157">epdf::rv</a>, and <a class="el" href="emix_8h-source.html#l00086">w</a>.</p> | 
|---|
| 171 |  | 
|---|
| 172 | <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#l00274">mmix::set_parameters()</a>.</p> | 
|---|
| 173 |  | 
|---|
| 174 | </div> | 
|---|
| 175 | </div><p> | 
|---|
| 176 | <hr>The documentation for this class was generated from the following files:<ul> | 
|---|
| 177 | <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> | 
|---|
| 178 | </div> | 
|---|
| 179 | <hr size="1"><address style="text-align: right;"><small>Generated on Wed Nov 12 19:18:52 2008 for mixpp by  | 
|---|
| 180 | <a href="http://www.doxygen.org/index.html"> | 
|---|
| 181 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> | 
|---|
| 182 | </body> | 
|---|
| 183 | </html> | 
|---|