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><a href="modules.html"><span>Modules</span></a></li> |
---|
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 List</span></a></li> |
---|
21 | <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
---|
22 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
23 | </ul> |
---|
24 | </div> |
---|
25 | </div> |
---|
26 | <div class="contents"> |
---|
27 | <h1>emix Class Reference</h1><!-- doxytag: class="emix" --><!-- doxytag: inherits="epdf" -->Mixture of epdfs. |
---|
28 | <a href="#_details">More...</a> |
---|
29 | <p> |
---|
30 | <code>#include <<a class="el" href="emix_8h-source.html">emix.h</a>></code> |
---|
31 | <p> |
---|
32 | <div class="dynheader"> |
---|
33 | Inheritance 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"> |
---|
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> |
---|
38 | <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> |
---|
39 | <div class="dynheader"> |
---|
40 | Collaboration 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"> |
---|
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> |
---|
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> |
---|
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 &rv)" --> |
---|
52 | </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> |
---|
53 | |
---|
54 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <br></td></tr> |
---|
55 | <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> |
---|
56 | |
---|
57 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0650601f24e633e0ab09aa1e46c14483"></a><!-- doxytag: member="emix::sample" ref="0650601f24e633e0ab09aa1e46c14483" args="() const " --> |
---|
58 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#0650601f24e633e0ab09aa1e46c14483">sample</a> () const </td></tr> |
---|
59 | |
---|
60 | <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> |
---|
61 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b662a51d042b062020460e64bff4e9e8"></a><!-- doxytag: member="emix::mean" ref="b662a51d042b062020460e64bff4e9e8" args="() const " --> |
---|
62 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#b662a51d042b062020460e64bff4e9e8">mean</a> () const </td></tr> |
---|
63 | |
---|
64 | <tr><td class="mdescLeft"> </td><td class="mdescRight">return expected value <br></td></tr> |
---|
65 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="73b96c9989b398c2a16417a70773442e"></a><!-- doxytag: member="emix::variance" ref="73b96c9989b398c2a16417a70773442e" args="() const " --> |
---|
66 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#73b96c9989b398c2a16417a70773442e">variance</a> () const </td></tr> |
---|
67 | |
---|
68 | <tr><td class="mdescLeft"> </td><td class="mdescRight">return expected variance (not covariance!) <br></td></tr> |
---|
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 &val) const " --> |
---|
70 | double </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#82691a72b583dab957cbd60d9283e47a">evallog</a> (const vec &val) const </td></tr> |
---|
71 | |
---|
72 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Compute log-probability of argument <code>val</code>. <br></td></tr> |
---|
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 &Val) const " --> |
---|
74 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#b3eb9e153e8bfdb6bb47adecc278cbca">evallog_m</a> (const mat &Val) const </td></tr> |
---|
75 | |
---|
76 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Compute log-probability of multiple values argument <code>val</code>. <br></td></tr> |
---|
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 &Val) const " --> |
---|
78 | mat </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#44ae2b86c650c2ccb967969c1859d268">evallog_M</a> (const mat &Val) const </td></tr> |
---|
79 | |
---|
80 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Auxiliary function that returns pdflog for each component. <br></td></tr> |
---|
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 &rv) const " --> |
---|
82 | <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> |
---|
83 | |
---|
84 | <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> |
---|
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 &rv) const " --> |
---|
86 | <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> |
---|
87 | |
---|
88 | <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> |
---|
89 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="35baf0f62307455cebfbf462144b4dd8"></a><!-- doxytag: member="emix::_w" ref="35baf0f62307455cebfbf462144b4dd8" args="()" --> |
---|
90 | vec & </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#35baf0f62307455cebfbf462144b4dd8">_w</a> ()</td></tr> |
---|
91 | |
---|
92 | <tr><td class="mdescLeft"> </td><td class="mdescRight">returns a pointer to the internal mean value. Use with Care! <br></td></tr> |
---|
93 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4d7baeb2a9e3fca1d8fd32a107df291d"></a><!-- doxytag: member="emix::ownComs" ref="4d7baeb2a9e3fca1d8fd32a107df291d" args="()" --> |
---|
94 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#4d7baeb2a9e3fca1d8fd32a107df291d">ownComs</a> ()</td></tr> |
---|
95 | |
---|
96 | <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> |
---|
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> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#95d175b2daa1d896ceffd69b70e02efb">_Coms</a> (int i)</td></tr> |
---|
99 | |
---|
100 | <tr><td class="mdescLeft"> </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 " --> |
---|
102 | virtual mat </td><td class="memItemRight" valign="bottom"><a class="el" href="classepdf.html#76608914c3b19e150292d5c56e93e508">sample_m</a> (int N) const </td></tr> |
---|
103 | |
---|
104 | <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> |
---|
105 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ca0d32aabb4cbba347e0c37fe8607562"></a><!-- doxytag: member="emix::_rv" ref="ca0d32aabb4cbba347e0c37fe8607562" args="() const " --> |
---|
106 | 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> |
---|
107 | |
---|
108 | <tr><td class="mdescLeft"> </td><td class="mdescRight">access function, possibly dangerous! <br></td></tr> |
---|
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 &in_rv)" --> |
---|
110 | 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> |
---|
111 | |
---|
112 | <tr><td class="mdescLeft"> </td><td class="mdescRight">modifier function - useful when copying epdfs <br></td></tr> |
---|
113 | <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> |
---|
114 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cdc8f4e2a5e43595ac5450d8a7f9d1ab"></a><!-- doxytag: member="emix::w" ref="cdc8f4e2a5e43595ac5450d8a7f9d1ab" args="" --> |
---|
115 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#cdc8f4e2a5e43595ac5450d8a7f9d1ab">w</a></td></tr> |
---|
116 | |
---|
117 | <tr><td class="mdescLeft"> </td><td class="mdescRight">weights of the components <br></td></tr> |
---|
118 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7155d827417b53fb6aa5cff1459e6eb4"></a><!-- doxytag: member="emix::Coms" ref="7155d827417b53fb6aa5cff1459e6eb4" args="" --> |
---|
119 | 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> |
---|
120 | |
---|
121 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Component (epdfs). <br></td></tr> |
---|
122 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7d0d863e6066ee02947914ff06ac34e8"></a><!-- doxytag: member="emix::destroyComs" ref="7d0d863e6066ee02947914ff06ac34e8" args="" --> |
---|
123 | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classemix.html#7d0d863e6066ee02947914ff06ac34e8">destroyComs</a></td></tr> |
---|
124 | |
---|
125 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flag if owning Coms. <br></td></tr> |
---|
126 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="74da992e3f5d598da8850b646b79b9d9"></a><!-- doxytag: member="emix::rv" ref="74da992e3f5d598da8850b646b79b9d9" args="" --> |
---|
127 | <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> |
---|
128 | |
---|
129 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Identified of the random variable. <br></td></tr> |
---|
130 | </table> |
---|
131 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
---|
132 | Mixture of epdfs. |
---|
133 | <p> |
---|
134 | Density 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> |
---|
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 &w, const Array< epdf * > &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 & </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< <a class="el" href="classepdf.html">epdf</a> * > & </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 </td> |
---|
158 | <td class="paramname"> <em>copy</em> = <code>true</code></td><td> </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> |
---|
170 | Set 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. |
---|
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> |
---|
172 | |
---|
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> |
---|
174 | |
---|
175 | </div> |
---|
176 | </div><p> |
---|
177 | <hr>The documentation for this class was generated from the following files:<ul> |
---|
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> |
---|
179 | </div> |
---|
180 | <hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 15 10:51:07 2009 for mixpp by |
---|
181 | <a href="http://www.doxygen.org/index.html"> |
---|
182 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> |
---|
183 | </body> |
---|
184 | </html> |
---|