root/doc/html/classbdm_1_1emix.html @ 269

Revision 269, 17.5 kB (checked in by smidl, 15 years ago)

doc

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: bdm::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&nbsp;Page</span></a></li>
12      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
13      <li><a href="modules.html"><span>Modules</span></a></li>
14      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
15      <li class="current"><a href="classes.html"><span>Classes</span></a></li>
16      <li><a href="files.html"><span>Files</span></a></li>
17    </ul>
18  </div>
19  <div class="tabs">
20    <ul>
21      <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
22      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
23      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
24      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
25    </ul>
26  </div>
27  <div class="navpath"><a class="el" href="namespacebdm.html">bdm</a>::<a class="el" href="classbdm_1_1emix.html">emix</a>
28  </div>
29</div>
30<div class="contents">
31<h1>bdm::emix Class Reference</h1><!-- doxytag: class="bdm::emix" --><!-- doxytag: inherits="bdm::epdf" -->Mixture of epdfs. 
32<a href="#_details">More...</a>
33<p>
34<code>#include &lt;<a class="el" href="emix_8h-source.html">emix.h</a>&gt;</code>
35<p>
36<div class="dynheader">
37Inheritance diagram for bdm::emix:</div>
38<div class="dynsection">
39<p><center><img src="classbdm_1_1emix__inherit__graph.png" border="0" usemap="#bdm_1_1emix__inherit__map" alt="Inheritance graph"></center>
40<map name="bdm_1_1emix__inherit__map">
41<area shape="rect" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="19,84,104,111"><area shape="rect" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects." alt="" coords="5,7,117,33"></map>
42<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
43<div class="dynheader">
44Collaboration diagram for bdm::emix:</div>
45<div class="dynsection">
46<p><center><img src="classbdm_1_1emix__coll__graph.png" border="0" usemap="#bdm_1_1emix__coll__map" alt="Collaboration graph"></center>
47<map name="bdm_1_1emix__coll__map">
48<area shape="rect" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="13,183,99,209"><area shape="rect" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects." alt="" coords="5,7,117,33"><area shape="rect" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables." alt="" coords="72,87,147,113"></map>
49<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
50
51<p>
52<a href="classbdm_1_1emix-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
53<tr><td></td></tr>
54<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
55<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="38649cee71ed9d8c32cfe8bb4b78a98b"></a><!-- doxytag: member="bdm::emix::emix" ref="38649cee71ed9d8c32cfe8bb4b78a98b" args="(const RV &amp;rv)" -->
56&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#38649cee71ed9d8c32cfe8bb4b78a98b">emix</a> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &amp;<a class="el" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8">rv</a>)</td></tr>
57
58<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <br></td></tr>
59<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#d8c1aefba8302759836b5f26999ce840">set_parameters</a> (const vec &amp;<a class="el" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46">w</a>, const Array&lt; <a class="el" href="classbdm_1_1epdf.html">epdf</a> * &gt; &amp;<a class="el" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e">Coms</a>, bool copy=true)</td></tr>
60
61<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e8839dbbb0d1276a8dbe957a67cfe0dc"></a><!-- doxytag: member="bdm::emix::sample" ref="e8839dbbb0d1276a8dbe957a67cfe0dc" args="() const " -->
62vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#e8839dbbb0d1276a8dbe957a67cfe0dc">sample</a> () const </td></tr>
63
64<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>
65<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a3a5390bc56e81ef3b0debc0f185fa8a"></a><!-- doxytag: member="bdm::emix::mean" ref="a3a5390bc56e81ef3b0debc0f185fa8a" args="() const " -->
66vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#a3a5390bc56e81ef3b0debc0f185fa8a">mean</a> () const </td></tr>
67
68<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return expected value <br></td></tr>
69<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e9a627023cdf90c9ffd8eef726595c86"></a><!-- doxytag: member="bdm::emix::variance" ref="e9a627023cdf90c9ffd8eef726595c86" args="() const " -->
70vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#e9a627023cdf90c9ffd8eef726595c86">variance</a> () const </td></tr>
71
72<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return expected variance (not covariance!) <br></td></tr>
73<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0f3db99f730bde6b7953931594537e8e"></a><!-- doxytag: member="bdm::emix::evallog" ref="0f3db99f730bde6b7953931594537e8e" args="(const vec &amp;val) const " -->
74double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#0f3db99f730bde6b7953931594537e8e">evallog</a> (const vec &amp;val) const </td></tr>
75
76<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute log-probability of argument <code>val</code>. <br></td></tr>
77<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="23af1986e2afcbc8c7e1c30f610e703b"></a><!-- doxytag: member="bdm::emix::evallog_m" ref="23af1986e2afcbc8c7e1c30f610e703b" args="(const mat &amp;Val) const " -->
78vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#23af1986e2afcbc8c7e1c30f610e703b">evallog_m</a> (const mat &amp;Val) const </td></tr>
79
80<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute log-probability of multiple values argument <code>val</code>. <br></td></tr>
81<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e64c1d5a73f541e469792e23d4677af2"></a><!-- doxytag: member="bdm::emix::evallog_M" ref="e64c1d5a73f541e469792e23d4677af2" args="(const mat &amp;Val) const " -->
82mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#e64c1d5a73f541e469792e23d4677af2">evallog_M</a> (const mat &amp;Val) const </td></tr>
83
84<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Auxiliary function that returns pdflog for each component. <br></td></tr>
85<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f7165371cc4f7be9292024b9f5431646"></a><!-- doxytag: member="bdm::emix::marginal" ref="f7165371cc4f7be9292024b9f5431646" args="(const RV &amp;rv) const " -->
86<a class="el" href="classbdm_1_1emix.html">emix</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#f7165371cc4f7be9292024b9f5431646">marginal</a> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &amp;<a class="el" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8">rv</a>) const </td></tr>
87
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return marginal density on the given <a class="el" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>, the remainig rvs are intergrated out. <br></td></tr>
89<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fc7772a2972959cf19ba26882feacecf"></a><!-- doxytag: member="bdm::emix::condition" ref="fc7772a2972959cf19ba26882feacecf" args="(const RV &amp;rv) const " -->
90<a class="el" href="classbdm_1_1mratio.html">mratio</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#fc7772a2972959cf19ba26882feacecf">condition</a> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &amp;<a class="el" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8">rv</a>) const </td></tr>
91
92<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return conditional density on the given <a class="el" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>, the remaining rvs will be in conditioning. <br></td></tr>
93<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d9b584cb5b2471a4250fb127757f28be"></a><!-- doxytag: member="bdm::emix::_w" ref="d9b584cb5b2471a4250fb127757f28be" args="()" -->
94vec &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#d9b584cb5b2471a4250fb127757f28be">_w</a> ()</td></tr>
95
96<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns a pointer to the internal mean value. Use with Care! <br></td></tr>
97<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="965fb16669250a3d28bc62cf76276d8e"></a><!-- doxytag: member="bdm::emix::ownComs" ref="965fb16669250a3d28bc62cf76276d8e" args="()" -->
98void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#965fb16669250a3d28bc62cf76276d8e">ownComs</a> ()</td></tr>
99
100<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Auxiliary function for taking ownership of the <a class="el" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms()</a>. <br></td></tr>
101<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="578616445243674438257be99ba71612"></a><!-- doxytag: member="bdm::emix::_Coms" ref="578616445243674438257be99ba71612" args="(int i)" -->
102<a class="el" href="classbdm_1_1epdf.html">epdf</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#578616445243674438257be99ba71612">_Coms</a> (int i)</td></tr>
103
104<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
105<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b4cf45fd83cc7573ede9fe1215256058"></a><!-- doxytag: member="bdm::emix::sample_m" ref="b4cf45fd83cc7573ede9fe1215256058" args="(int N) const " -->
106virtual mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1epdf.html#b4cf45fd83cc7573ede9fe1215256058">sample_m</a> (int N) const </td></tr>
107
108<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>
109<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4ab378d5e004c3ff3e2d4e64f7bba21"></a><!-- doxytag: member="bdm::emix::_rv" ref="a4ab378d5e004c3ff3e2d4e64f7bba21" args="() const " -->
110const <a class="el" href="classbdm_1_1RV.html">RV</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1epdf.html#a4ab378d5e004c3ff3e2d4e64f7bba21">_rv</a> () const </td></tr>
111
112<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function, possibly dangerous! <br></td></tr>
113<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="62e88cbce0ce77a8692f5e15d76e805f"></a><!-- doxytag: member="bdm::emix::_renewrv" ref="62e88cbce0ce77a8692f5e15d76e805f" args="(const RV &amp;in_rv)" -->
114void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1epdf.html#62e88cbce0ce77a8692f5e15d76e805f">_renewrv</a> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &amp;in_rv)</td></tr>
115
116<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">modifier function - useful when copying epdfs <br></td></tr>
117<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
118<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bb7270345c76da627cd77ddf020bcf46"></a><!-- doxytag: member="bdm::emix::w" ref="bb7270345c76da627cd77ddf020bcf46" args="" -->
119vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46">w</a></td></tr>
120
121<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">weights of the components <br></td></tr>
122<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e2966a6a44b250e22e55bc9fb6af5c3e"></a><!-- doxytag: member="bdm::emix::Coms" ref="e2966a6a44b250e22e55bc9fb6af5c3e" args="" -->
123Array&lt; <a class="el" href="classbdm_1_1epdf.html">epdf</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e">Coms</a></td></tr>
124
125<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Component (epdfs). <br></td></tr>
126<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="47189df41a4616c2fed5972f015743f4"></a><!-- doxytag: member="bdm::emix::destroyComs" ref="47189df41a4616c2fed5972f015743f4" args="" -->
127bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1emix.html#47189df41a4616c2fed5972f015743f4">destroyComs</a></td></tr>
128
129<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flag if owning Coms. <br></td></tr>
130<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="62c5b8ff71d9ebe6cd58d3c342eb1dc8"></a><!-- doxytag: member="bdm::emix::rv" ref="62c5b8ff71d9ebe6cd58d3c342eb1dc8" args="" -->
131<a class="el" href="classbdm_1_1RV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8">rv</a></td></tr>
132
133<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Identified of the random variable. <br></td></tr>
134</table>
135<hr><a name="_details"></a><h2>Detailed Description</h2>
136Mixture of epdfs.
137<p>
138Density function: <p class="formulaDsp">
139<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">
140<p>
141 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>
142<a class="anchor" name="d8c1aefba8302759836b5f26999ce840"></a><!-- doxytag: member="bdm::emix::set_parameters" ref="d8c1aefba8302759836b5f26999ce840" args="(const vec &amp;w, const Array&lt; epdf * &gt; &amp;Coms, bool copy=true)" -->
143<div class="memitem">
144<div class="memproto">
145      <table class="memname">
146        <tr>
147          <td class="memname">void bdm::emix::set_parameters           </td>
148          <td>(</td>
149          <td class="paramtype">const vec &amp;&nbsp;</td>
150          <td class="paramname"> <em>w</em>, </td>
151        </tr>
152        <tr>
153          <td class="paramkey"></td>
154          <td></td>
155          <td class="paramtype">const Array&lt; <a class="el" href="classbdm_1_1epdf.html">epdf</a> * &gt; &amp;&nbsp;</td>
156          <td class="paramname"> <em>Coms</em>, </td>
157        </tr>
158        <tr>
159          <td class="paramkey"></td>
160          <td></td>
161          <td class="paramtype">bool&nbsp;</td>
162          <td class="paramname"> <em>copy</em> = <code>true</code></td><td>&nbsp;</td>
163        </tr>
164        <tr>
165          <td></td>
166          <td>)</td>
167          <td></td><td></td><td></td>
168        </tr>
169      </table>
170</div>
171<div class="memdoc">
172
173<p>
174Set 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="classbdm_1_1emix.html#965fb16669250a3d28bc62cf76276d8e" title="Auxiliary function for taking ownership of the Coms().">ownComs()</a> if Coms should be destroyed by the destructor.
175<p>References <a class="el" href="libBM_8h-source.html#l00216">bdm::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#l00118">bdm::RV::equal()</a>, <a class="el" href="libBM_8h-source.html#l00177">bdm::epdf::rv</a>, and <a class="el" href="emix_8h-source.html#l00089">w</a>.</p>
176
177<p>Referenced by <a class="el" href="emix_8cpp-source.html#l00036">marginal()</a>, <a class="el" href="mixef_8cpp-source.html#l00134">bdm::MixEF::predictor()</a>, and <a class="el" href="emix_8h-source.html#l00297">bdm::mmix::set_parameters()</a>.</p>
178
179</div>
180</div><p>
181<hr>The documentation for this class was generated from the following files:<ul>
182<li><a class="el" href="emix_8h-source.html">emix.h</a><li>emix.cpp</ul>
183</div>
184<hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 11 10:20:52 2009 for mixpp by&nbsp;
185<a href="http://www.doxygen.org/index.html">
186<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
187</body>
188</html>
Note: See TracBrowser for help on using the browser.