root/doc/html/classMixEF.html @ 172

Revision 171, 19.0 kB (checked in by smidl, 16 years ago)

New documentation

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: MixEF 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 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&nbsp;List</span></a></li>
20      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
21      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
22    </ul>
23  </div>
24</div>
25<div class="contents">
26<h1>MixEF Class Reference</h1><!-- doxytag: class="MixEF" --><!-- doxytag: inherits="BM" -->Mixture of Exponential Family Densities. 
27<a href="#_details">More...</a>
28<p>
29<code>#include &lt;<a class="el" href="mixef_8h-source.html">mixef.h</a>&gt;</code>
30<p>
31<div class="dynheader">
32Inheritance diagram for MixEF:</div>
33<div class="dynsection">
34<p><center><img src="classMixEF__inherit__graph.png" border="0" usemap="#MixEF__inherit__map" alt="Inheritance graph"></center>
35<map name="MixEF__inherit__map">
36<area shape="rect" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities." alt="" coords="13,7,53,33"></map>
37<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
38<div class="dynheader">
39Collaboration diagram for MixEF:</div>
40<div class="dynsection">
41<p><center><img src="classMixEF__coll__graph.png" border="0" usemap="#MixEF__coll__map" alt="Collaboration graph"></center>
42<map name="MixEF__coll__map">
43<area shape="rect" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities." alt="" coords="27,183,67,209"><area shape="rect" href="classBMEF.html" title="Estimator for Exponential family." alt="" coords="19,289,75,316"><area shape="rect" href="classRV.html" title="Class representing variables, most often random variables." alt="" coords="68,7,105,33"><area shape="rect" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="107,103,155,129"><area shape="rect" href="classeprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod." alt="" coords="168,236,227,263"><area shape="rect" href="classeEF.html" title="General conjugate exponential family posterior density." alt="" coords="109,183,152,209"><area shape="rect" href="classmultiBM.html" title="Estimator for Multinomial density." alt="" coords="47,385,119,412"><area shape="rect" href="classeDirich.html" title="Dirichlet posterior density." alt="" coords="99,289,163,316"></map>
44<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
45
46<p>
47<a href="classMixEF-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="7713c2f01e97df268049821749405bc2"></a><!-- doxytag: member="MixEF::MixEF" ref="7713c2f01e97df268049821749405bc2" args="(Array&lt; BMEF * &gt; &amp;Coms0, const vec &amp;alpha0)" -->
51&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#7713c2f01e97df268049821749405bc2">MixEF</a> (Array&lt; <a class="el" href="classBMEF.html">BMEF</a> * &gt; &amp;Coms0, const vec &amp;alpha0)</td></tr>
52
53<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Full constructor. <br></td></tr>
54<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#8be6cf2d9bb0d86e01e9470720515ae6">MixEF</a> (<a class="el" href="classBMEF.html">BMEF</a> *Com0, const mat &amp;Data, int c=5)</td></tr>
55
56<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d520fb534aa43f3084ff1568ffe7573d"></a><!-- doxytag: member="MixEF::bayes" ref="d520fb534aa43f3084ff1568ffe7573d" args="(const vec &amp;dt)" -->
57void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#d520fb534aa43f3084ff1568ffe7573d">bayes</a> (const vec &amp;dt)</td></tr>
58
59<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006. <br></td></tr>
60<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4e0ad97868e55facffb37932dd44353f"></a><!-- doxytag: member="MixEF::bayes" ref="4e0ad97868e55facffb37932dd44353f" args="(const mat &amp;dt)" -->
61void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#4e0ad97868e55facffb37932dd44353f">bayes</a> (const mat &amp;dt)</td></tr>
62
63<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">EM algorithm. <br></td></tr>
64<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e6810daa121ccaff1ac18f26fbad4563"></a><!-- doxytag: member="MixEF::bayesB" ref="e6810daa121ccaff1ac18f26fbad4563" args="(const mat &amp;dt)" -->
65void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#e6810daa121ccaff1ac18f26fbad4563">bayesB</a> (const mat &amp;dt)</td></tr>
66
67<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Batch Bayes rule (columns of Dt are observations). <br></td></tr>
68<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#424ca64f36d4e41de7a7e7ae921d35ea">logpred</a> (const vec &amp;dt) const </td></tr>
69
70<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="efb3e20c2151d91c4fc080b7722a2069"></a><!-- doxytag: member="MixEF::_epdf" ref="efb3e20c2151d91c4fc080b7722a2069" args="() const " -->
71const <a class="el" href="classepdf.html">epdf</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#efb3e20c2151d91c4fc080b7722a2069">_epdf</a> () const </td></tr>
72
73<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a pointer to the <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> representing posterior density on parameters. Use with care! <br></td></tr>
74<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="126bd2595c48e311fc2a7ab72876092a"></a><!-- doxytag: member="MixEF::_rv" ref="126bd2595c48e311fc2a7ab72876092a" args="() const " -->
75const <a class="el" href="classRV.html">RV</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#126bd2595c48e311fc2a7ab72876092a">_rv</a> () const </td></tr>
76
77<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
78<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="87f4a547d2c29180be88175e5eab9c88"></a><!-- doxytag: member="MixEF::_ll" ref="87f4a547d2c29180be88175e5eab9c88" args="() const " -->
79double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#87f4a547d2c29180be88175e5eab9c88">_ll</a> () const </td></tr>
80
81<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
82<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1ffa9f23669aabecc3760c06c6987522"></a><!-- doxytag: member="MixEF::set_evalll" ref="1ffa9f23669aabecc3760c06c6987522" args="(bool evl0)" -->
83void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#1ffa9f23669aabecc3760c06c6987522">set_evalll</a> (bool evl0)</td></tr>
84
85<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
86<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classBM.html">BM</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#eb58c81d6a7b75b05fc6f276eed78887">_copy_</a> (bool changerv=false)</td></tr>
87
88<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
89<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5ae381b3a7dfbe2c1e5bb579a5d9b9d1"></a><!-- doxytag: member="MixEF::build_est" ref="5ae381b3a7dfbe2c1e5bb579a5d9b9d1" args="()" -->
90void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1">build_est</a> ()</td></tr>
91
92<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Auxiliary function for use in constructors. <br></td></tr>
93<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
94<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e9cc9bb3e6da801455cec99a59aea149"></a><!-- doxytag: member="MixEF::n" ref="e9cc9bb3e6da801455cec99a59aea149" args="" -->
95int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149">n</a></td></tr>
96
97<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of components. <br></td></tr>
98<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4c4a140ca4e6e71b00237b7bc754302e"></a><!-- doxytag: member="MixEF::Coms" ref="4c4a140ca4e6e71b00237b7bc754302e" args="" -->
99Array&lt; <a class="el" href="classBMEF.html">BMEF</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e">Coms</a></td></tr>
100
101<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Models for Components of <img class="formulaInl" alt="$\theta_i$" src="form_69.png">. <br></td></tr>
102<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d906782a0a9558f19150dc69411f717f"></a><!-- doxytag: member="MixEF::weights" ref="d906782a0a9558f19150dc69411f717f" args="" -->
103<a class="el" href="classmultiBM.html">multiBM</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#d906782a0a9558f19150dc69411f717f">weights</a></td></tr>
104
105<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Statistics for weights. <br></td></tr>
106<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="33968f1325137cc6f4431f0cf05096dc"></a><!-- doxytag: member="MixEF::est" ref="33968f1325137cc6f4431f0cf05096dc" args="" -->
107<a class="el" href="classeprod.html">eprod</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc">est</a></td></tr>
108
109<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Posterior on component parameters. <br></td></tr>
110<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="af00f0612fabe66241dd507188cdbf88"></a><!-- doxytag: member="MixEF::rv" ref="af00f0612fabe66241dd507188cdbf88" args="" -->
111<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#af00f0612fabe66241dd507188cdbf88">rv</a></td></tr>
112
113<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Random variable of the posterior. <br></td></tr>
114<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5623fef6572a08c2b53b8c87b82dc979"></a><!-- doxytag: member="MixEF::ll" ref="5623fef6572a08c2b53b8c87b82dc979" args="" -->
115double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979">ll</a></td></tr>
116
117<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Logarithm of marginalized data likelihood. <br></td></tr>
118<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bf6fb59b30141074f8ee1e2f43d03129"></a><!-- doxytag: member="MixEF::evalll" ref="bf6fb59b30141074f8ee1e2f43d03129" args="" -->
119bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129">evalll</a></td></tr>
120
121<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If true, the filter will compute likelihood of the data record and store it in <code>ll</code> . Set to false if you want to save computational time. <br></td></tr>
122</table>
123<hr><a name="_details"></a><h2>Detailed Description</h2>
124Mixture of Exponential Family Densities.
125<p>
126An approximate estimation method for models with latent discrete variable, such as mixture models of the following kind: <p class="formulaDsp">
127<img class="formulaDsp" alt="\[ f(y_t|\psi_t, \Theta) = \sum_{i=1}^{n} w_i f(y_t|\psi_t, \theta_i) \]" src="form_66.png">
128<p>
129 where <img class="formulaInl" alt="$\psi$" src="form_67.png"> is a known function of past outputs, <img class="formulaInl" alt="$w=[w_1,\ldots,w_n]$" src="form_68.png"> are component weights, and component parameters <img class="formulaInl" alt="$\theta_i$" src="form_69.png"> are assumed to be mutually independent. <img class="formulaInl" alt="$\Theta$" src="form_70.png"> is an aggregation af all component parameters and weights, i.e. <img class="formulaInl" alt="$\Theta = [\theta_1,\ldots,\theta_n,w]$" src="form_71.png">.<p>
130The characteristic feature of this model is that if the exact values of the latent variable were known, estimation of the parameters can be handled by a single model. For example, for the case of mixture models, posterior density for each component parameters would be a BayesianModel from Exponential Family.<p>
131This class uses EM-style type algorithms for estimation of its parameters. Under this simplification, the posterior density is a product of exponential family members, hence approximate estimation project this class itself belongs to the exponential family.<p>
132TODO: Extend <a class="el" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> to use rvc. <hr><h2>Constructor &amp; Destructor Documentation</h2>
133<a class="anchor" name="8be6cf2d9bb0d86e01e9470720515ae6"></a><!-- doxytag: member="MixEF::MixEF" ref="8be6cf2d9bb0d86e01e9470720515ae6" args="(BMEF *Com0, const mat &amp;Data, int c=5)" -->
134<div class="memitem">
135<div class="memproto">
136      <table class="memname">
137        <tr>
138          <td class="memname">MixEF::MixEF           </td>
139          <td>(</td>
140          <td class="paramtype"><a class="el" href="classBMEF.html">BMEF</a> *&nbsp;</td>
141          <td class="paramname"> <em>Com0</em>, </td>
142        </tr>
143        <tr>
144          <td class="paramkey"></td>
145          <td></td>
146          <td class="paramtype">const mat &amp;&nbsp;</td>
147          <td class="paramname"> <em>Data</em>, </td>
148        </tr>
149        <tr>
150          <td class="paramkey"></td>
151          <td></td>
152          <td class="paramtype">int&nbsp;</td>
153          <td class="paramname"> <em>c</em> = <code>5</code></td><td>&nbsp;</td>
154        </tr>
155        <tr>
156          <td></td>
157          <td>)</td>
158          <td></td><td></td><td></td>
159        </tr>
160      </table>
161</div>
162<div class="memdoc">
163
164<p>
165Constructor Initializing the mixture by a random pick of centroids from data <dl compact><dt><b>Parameters:</b></dt><dd>
166  <table border="0" cellspacing="2" cellpadding="0">
167    <tr><td valign="top"></td><td valign="top"><em>Com0</em>&nbsp;</td><td>Initial component - necessary to determine its type. </td></tr>
168    <tr><td valign="top"></td><td valign="top"><em>Data</em>&nbsp;</td><td>Data on which the initialization will be done </td></tr>
169    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>Initial number of components, default=5 </td></tr>
170  </table>
171</dl>
172
173<p>References <a class="el" href="libBM_8h-source.html#l00313">BM::_copy_()</a>, <a class="el" href="mixef_8h-source.html#l00052">build_est()</a>, <a class="el" href="mixef_8h-source.html#l00044">Coms</a>, and <a class="el" href="mixef_8h-source.html#l00042">n</a>.</p>
174
175</div>
176</div><p>
177<hr><h2>Member Function Documentation</h2>
178<a class="anchor" name="424ca64f36d4e41de7a7e7ae921d35ea"></a><!-- doxytag: member="MixEF::logpred" ref="424ca64f36d4e41de7a7e7ae921d35ea" args="(const vec &amp;dt) const " -->
179<div class="memitem">
180<div class="memproto">
181      <table class="memname">
182        <tr>
183          <td class="memname">double MixEF::logpred           </td>
184          <td>(</td>
185          <td class="paramtype">const vec &amp;&nbsp;</td>
186          <td class="paramname"> <em>dt</em>          </td>
187          <td>&nbsp;)&nbsp;</td>
188          <td> const<code> [virtual]</code></td>
189        </tr>
190      </table>
191</div>
192<div class="memdoc">
193
194<p>
195Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out.
196<p>Reimplemented from <a class="el" href="classBM.html#8a8ce6df431689964c41cc6c849cfd06">BM</a>.</p>
197
198<p>References <a class="el" href="libEF_8h-source.html#l00259">multiBM::_epdf()</a>, <a class="el" href="mixef_8h-source.html#l00044">Coms</a>, <a class="el" href="classepdf.html#bf0a070a8f3e67a93604ca724638b870">epdf::mean()</a>, <a class="el" href="mixef_8h-source.html#l00042">n</a>, and <a class="el" href="mixef_8h-source.html#l00046">weights</a>.</p>
199
200</div>
201</div><p>
202<a class="anchor" name="eb58c81d6a7b75b05fc6f276eed78887"></a><!-- doxytag: member="MixEF::_copy_" ref="eb58c81d6a7b75b05fc6f276eed78887" args="(bool changerv=false)" -->
203<div class="memitem">
204<div class="memproto">
205      <table class="memname">
206        <tr>
207          <td class="memname">virtual <a class="el" href="classBM.html">BM</a>* BM::_copy_           </td>
208          <td>(</td>
209          <td class="paramtype">bool&nbsp;</td>
210          <td class="paramname"> <em>changerv</em> = <code>false</code>          </td>
211          <td>&nbsp;)&nbsp;</td>
212          <td><code> [inline, virtual, inherited]</code></td>
213        </tr>
214      </table>
215</div>
216<div class="memdoc">
217
218<p>
219Copy function required in vectors, Arrays of <a class="el" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> etc. Have to be DELETED manually! Prototype: BM* <a class="el" href="classBM.html#eb58c81d6a7b75b05fc6f276eed78887">_copy_()</a>{<a class="el" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> Tmp*=new Tmp(this*); return Tmp; }
220<p>Reimplemented in <a class="el" href="classARX.html#d2751057811c6fb8f4ff86e1648bcddc">ARX</a>.</p>
221
222<p>Referenced by <a class="el" href="mixef_8cpp-source.html#l00007">MixEF()</a>.</p>
223
224</div>
225</div><p>
226<hr>The documentation for this class was generated from the following files:<ul>
227<li>work/git/mixpp/bdm/estim/<a class="el" href="mixef_8h-source.html">mixef.h</a><li>work/git/mixpp/bdm/estim/mixef.cpp</ul>
228</div>
229<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 23 16:00:54 2008 for mixpp by&nbsp;
230<a href="http://www.doxygen.org/index.html">
231<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
232</body>
233</html>
Note: See TracBrowser for help on using the browser.