root/doc/html/classmultiBM.html @ 210

Revision 210, 19.5 kB (checked in by smidl, 16 years ago)

dokumentace

RevLine 
[171]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: multiBM 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>multiBM Class Reference</h1><!-- doxytag: class="multiBM" --><!-- doxytag: inherits="BMEF" -->Estimator for Multinomial density. 
27<a href="#_details">More...</a>
28<p>
29<code>#include &lt;<a class="el" href="libEF_8h-source.html">libEF.h</a>&gt;</code>
30<p>
31<div class="dynheader">
32Inheritance diagram for multiBM:</div>
33<div class="dynsection">
34<p><center><img src="classmultiBM__inherit__graph.png" border="0" usemap="#multiBM__inherit__map" alt="Inheritance graph"></center>
35<map name="multiBM__inherit__map">
36<area shape="rect" href="classBMEF.html" title="Estimator for Exponential family." alt="" coords="13,84,69,111"><area shape="rect" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities." alt="" coords="21,7,61,33"></map>
37<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
38<div class="dynheader">
39Collaboration diagram for multiBM:</div>
40<div class="dynsection">
41<p><center><img src="classmultiBM__coll__graph.png" border="0" usemap="#multiBM__coll__map" alt="Collaboration graph"></center>
42<map name="multiBM__coll__map">
43<area shape="rect" href="classBMEF.html" title="Estimator for Exponential family." alt="" coords="5,263,61,289"><area shape="rect" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities." alt="" coords="15,156,55,183"><area shape="rect" href="classRV.html" title="Class representing variables, most often random variables." alt="" coords="41,7,79,33"><area shape="rect" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="72,103,120,129"><area shape="rect" href="classeDirich.html" title="Dirichlet posterior density." alt="" coords="67,316,131,343"><area shape="rect" href="classeEF.html" title="General conjugate exponential family posterior density." alt="" coords="75,209,117,236"></map>
44<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
45
46<p>
47<a href="classmultiBM-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="7d7d7e78c129602bcde96078359dc6e5"></a><!-- doxytag: member="multiBM::multiBM" ref="7d7d7e78c129602bcde96078359dc6e5" args="(const RV &amp;rv, const vec beta0)" -->
51&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#7d7d7e78c129602bcde96078359dc6e5">multiBM</a> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classBM.html#af00f0612fabe66241dd507188cdbf88">rv</a>, const vec beta0)</td></tr>
52
53<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <br></td></tr>
54<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b92751adbfb9f259ca8c95232cfd9c09"></a><!-- doxytag: member="multiBM::multiBM" ref="b92751adbfb9f259ca8c95232cfd9c09" args="(const multiBM &amp;B)" -->
55&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#b92751adbfb9f259ca8c95232cfd9c09">multiBM</a> (const <a class="el" href="classmultiBM.html">multiBM</a> &amp;B)</td></tr>
56
57<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copy constructor. <br></td></tr>
58<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="42e36804041e551d3ceea6c75abc0562"></a><!-- doxytag: member="multiBM::set_statistics" ref="42e36804041e551d3ceea6c75abc0562" args="(const BM *mB0)" -->
[181]59void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#42e36804041e551d3ceea6c75abc0562">set_statistics</a> (const <a class="el" href="classBM.html">BM</a> *mB0)</td></tr>
[171]60
[181]61<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets sufficient statistics to match that of givefrom mB0. <br></td></tr>
[171]62<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#11eeba7e97954e316e959116f90d80e2">bayes</a> (const vec &amp;dt)</td></tr>
63
64<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Incremental Bayes rule.  <a href="#11eeba7e97954e316e959116f90d80e2"></a><br></td></tr>
65<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#13e26a61757278981fd8cac9a7ef91eb">logpred</a> (const vec &amp;dt) const </td></tr>
66
[181]67<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3988322f8f51b153622036f461f62a67"></a><!-- doxytag: member="multiBM::flatten" ref="3988322f8f51b153622036f461f62a67" args="(const BMEF *B)" -->
68void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#3988322f8f51b153622036f461f62a67">flatten</a> (const <a class="el" href="classBMEF.html">BMEF</a> *B)</td></tr>
[171]69
[181]70<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flatten the posterior according to the given <a class="el" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a> (of the same type!). <br></td></tr>
[171]71<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="66cdfd83a70bc281840ab0646b941684"></a><!-- doxytag: member="multiBM::_epdf" ref="66cdfd83a70bc281840ab0646b941684" args="() const " -->
72const <a class="el" href="classepdf.html">epdf</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#66cdfd83a70bc281840ab0646b941684">_epdf</a> () const </td></tr>
73
[210]74<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a reference 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. <br></td></tr>
75<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="66a0fa6966e40bb6c3e7ba22d26e9d35"></a><!-- doxytag: member="multiBM::_e" ref="66a0fa6966e40bb6c3e7ba22d26e9d35" args="() const " -->
76const <a class="el" href="classeDirich.html">eDirich</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#66a0fa6966e40bb6c3e7ba22d26e9d35">_e</a> () const </td></tr>
77
[171]78<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>
[180]79<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="164117b1a5eb6f33db9b4b0f4b2d2842"></a><!-- doxytag: member="multiBM::set_parameters" ref="164117b1a5eb6f33db9b4b0f4b2d2842" args="(const vec &amp;beta0)" -->
80void&nbsp;</td><td class="memItemRight" valign="bottom"><b>set_parameters</b> (const vec &amp;beta0)</td></tr>
81
[171]82<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="30bb40eb1fd31869b2e62e79e1ecdcb4"></a><!-- doxytag: member="multiBM::set_statistics" ref="30bb40eb1fd31869b2e62e79e1ecdcb4" args="(const BMEF *BM0)" -->
83virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBMEF.html#30bb40eb1fd31869b2e62e79e1ecdcb4">set_statistics</a> (const <a class="el" href="classBMEF.html">BMEF</a> *BM0)</td></tr>
84
85<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get statistics from another model <br></td></tr>
86<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8f4ecb6e2eaf630155a1fa98f35aa6ad"></a><!-- doxytag: member="multiBM::bayes" ref="8f4ecb6e2eaf630155a1fa98f35aa6ad" args="(const vec &amp;data, const double w)" -->
87virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBMEF.html#8f4ecb6e2eaf630155a1fa98f35aa6ad">bayes</a> (const vec &amp;data, const double w)</td></tr>
88
89<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Weighted update of sufficient statistics (Bayes rule). <br></td></tr>
[210]90<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="97f5312efe4a5bedb86d2daec59d8651"></a><!-- doxytag: member="multiBM::_copy_" ref="97f5312efe4a5bedb86d2daec59d8651" args="(bool changerv=false)" -->
91<a class="el" href="classBMEF.html">BMEF</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBMEF.html#97f5312efe4a5bedb86d2daec59d8651">_copy_</a> (bool changerv=false)</td></tr>
[181]92
93<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flatten the posterior as if to keep nu0 data. <br></td></tr>
[171]94<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0186270f75189677f390fe088a9947e9"></a><!-- doxytag: member="multiBM::bayesB" ref="0186270f75189677f390fe088a9947e9" args="(const mat &amp;Dt)" -->
95virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#0186270f75189677f390fe088a9947e9">bayesB</a> (const mat &amp;Dt)</td></tr>
96
97<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Batch Bayes rule (columns of Dt are observations). <br></td></tr>
[180]98<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cd0660f2a1a344b56ac39802708ff165"></a><!-- doxytag: member="multiBM::logpred_m" ref="cd0660f2a1a344b56ac39802708ff165" args="(const mat &amp;dt) const " -->
99vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#cd0660f2a1a344b56ac39802708ff165">logpred_m</a> (const mat &amp;dt) const </td></tr>
100
101<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Matrix version of logpred. <br></td></tr>
[210]102<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5594d68ee9aa6fc8c1e79019da5c9d56"></a><!-- doxytag: member="multiBM::predictor" ref="5594d68ee9aa6fc8c1e79019da5c9d56" args="(const RV &amp;rv) const " -->
103virtual <a class="el" href="classepdf.html">epdf</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#5594d68ee9aa6fc8c1e79019da5c9d56">predictor</a> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classBM.html#af00f0612fabe66241dd507188cdbf88">rv</a>) const </td></tr>
[180]104
105<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a predictive density (marginal density on data). <br></td></tr>
[171]106<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="126bd2595c48e311fc2a7ab72876092a"></a><!-- doxytag: member="multiBM::_rv" ref="126bd2595c48e311fc2a7ab72876092a" args="() const " -->
107const <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>
108
109<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
110<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="87f4a547d2c29180be88175e5eab9c88"></a><!-- doxytag: member="multiBM::_ll" ref="87f4a547d2c29180be88175e5eab9c88" args="() const " -->
111double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#87f4a547d2c29180be88175e5eab9c88">_ll</a> () const </td></tr>
112
113<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
114<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1ffa9f23669aabecc3760c06c6987522"></a><!-- doxytag: member="multiBM::set_evalll" ref="1ffa9f23669aabecc3760c06c6987522" args="(bool evl0)" -->
115void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#1ffa9f23669aabecc3760c06c6987522">set_evalll</a> (bool evl0)</td></tr>
116
117<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
118<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
119<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="eddee08a724170de63f36e40c57b27b5"></a><!-- doxytag: member="multiBM::est" ref="eddee08a724170de63f36e40c57b27b5" args="" -->
120<a class="el" href="classeDirich.html">eDirich</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#eddee08a724170de63f36e40c57b27b5">est</a></td></tr>
121
122<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Conjugate prior and posterior. <br></td></tr>
123<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7b606116aed7e8834a339cbb0424b1d6"></a><!-- doxytag: member="multiBM::beta" ref="7b606116aed7e8834a339cbb0424b1d6" args="" -->
[181]124vec &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmultiBM.html#7b606116aed7e8834a339cbb0424b1d6">beta</a></td></tr>
[171]125
[181]126<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pointer inside est to sufficient statistics. <br></td></tr>
[171]127<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="538d632e59f9afa8daa1de74da12ce71"></a><!-- doxytag: member="multiBM::frg" ref="538d632e59f9afa8daa1de74da12ce71" args="" -->
128double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBMEF.html#538d632e59f9afa8daa1de74da12ce71">frg</a></td></tr>
129
130<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">forgetting factor <br></td></tr>
131<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="308cf5d4133cd471fdf1ecd5dfa09d02"></a><!-- doxytag: member="multiBM::last_lognc" ref="308cf5d4133cd471fdf1ecd5dfa09d02" args="" -->
132double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBMEF.html#308cf5d4133cd471fdf1ecd5dfa09d02">last_lognc</a></td></tr>
133
134<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">cached value of lognc() in the previous step (used in evaluation of <code>ll</code> ) <br></td></tr>
135<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="af00f0612fabe66241dd507188cdbf88"></a><!-- doxytag: member="multiBM::rv" ref="af00f0612fabe66241dd507188cdbf88" args="" -->
136<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>
137
138<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Random variable of the posterior. <br></td></tr>
139<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5623fef6572a08c2b53b8c87b82dc979"></a><!-- doxytag: member="multiBM::ll" ref="5623fef6572a08c2b53b8c87b82dc979" args="" -->
140double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#5623fef6572a08c2b53b8c87b82dc979">ll</a></td></tr>
141
142<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Logarithm of marginalized data likelihood. <br></td></tr>
143<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bf6fb59b30141074f8ee1e2f43d03129"></a><!-- doxytag: member="multiBM::evalll" ref="bf6fb59b30141074f8ee1e2f43d03129" args="" -->
144bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBM.html#bf6fb59b30141074f8ee1e2f43d03129">evalll</a></td></tr>
145
146<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>
147</table>
148<hr><a name="_details"></a><h2>Detailed Description</h2>
149Estimator for Multinomial density. <hr><h2>Member Function Documentation</h2>
150<a class="anchor" name="11eeba7e97954e316e959116f90d80e2"></a><!-- doxytag: member="multiBM::bayes" ref="11eeba7e97954e316e959116f90d80e2" args="(const vec &amp;dt)" -->
151<div class="memitem">
152<div class="memproto">
153      <table class="memname">
154        <tr>
155          <td class="memname">void multiBM::bayes           </td>
156          <td>(</td>
157          <td class="paramtype">const vec &amp;&nbsp;</td>
158          <td class="paramname"> <em>dt</em>          </td>
159          <td>&nbsp;)&nbsp;</td>
160          <td><code> [inline, virtual]</code></td>
161        </tr>
162      </table>
163</div>
164<div class="memdoc">
165
166<p>
167Incremental Bayes rule.
168<p>
169<dl compact><dt><b>Parameters:</b></dt><dd>
170  <table border="0" cellspacing="2" cellpadding="0">
171    <tr><td valign="top"></td><td valign="top"><em>dt</em>&nbsp;</td><td>vector of input data </td></tr>
172  </table>
173</dl>
174
175<p>Reimplemented from <a class="el" href="classBMEF.html#52b7719312d545215cca1ff87722a35a">BMEF</a>.</p>
176
[210]177<p>References <a class="el" href="libEF_8h-source.html#l00254">beta</a>, <a class="el" href="libEF_8h-source.html#l00252">est</a>, <a class="el" href="libBM_8h-source.html#l00403">BM::evalll</a>, <a class="el" href="libEF_8h-source.html#l00078">BMEF::frg</a>, <a class="el" href="libEF_8h-source.html#l00080">BMEF::last_lognc</a>, <a class="el" href="libBM_8h-source.html#l00401">BM::ll</a>, and <a class="el" href="libEF_8h-source.html#l00230">eDirich::lognc()</a>.</p>
[171]178
179</div>
180</div><p>
181<a class="anchor" name="13e26a61757278981fd8cac9a7ef91eb"></a><!-- doxytag: member="multiBM::logpred" ref="13e26a61757278981fd8cac9a7ef91eb" args="(const vec &amp;dt) const " -->
182<div class="memitem">
183<div class="memproto">
184      <table class="memname">
185        <tr>
186          <td class="memname">double multiBM::logpred           </td>
187          <td>(</td>
188          <td class="paramtype">const vec &amp;&nbsp;</td>
189          <td class="paramname"> <em>dt</em>          </td>
190          <td>&nbsp;)&nbsp;</td>
191          <td> const<code> [inline, virtual]</code></td>
192        </tr>
193      </table>
194</div>
195<div class="memdoc">
196
197<p>
198Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out.
199<p>Reimplemented from <a class="el" href="classBM.html#8a8ce6df431689964c41cc6c849cfd06">BM</a>.</p>
200
[210]201<p>References <a class="el" href="libEF_8h-source.html#l00237">eDirich::_beta()</a>, <a class="el" href="libEF_8h-source.html#l00254">beta</a>, <a class="el" href="libEF_8h-source.html#l00252">est</a>, <a class="el" href="libBM_8h-source.html#l00403">BM::evalll</a>, <a class="el" href="libEF_8h-source.html#l00078">BMEF::frg</a>, <a class="el" href="libEF_8h-source.html#l00080">BMEF::last_lognc</a>, and <a class="el" href="libEF_8h-source.html#l00230">eDirich::lognc()</a>.</p>
[171]202
203</div>
204</div><p>
205<hr>The documentation for this class was generated from the following file:<ul>
206<li>work/git/mixpp/bdm/stat/<a class="el" href="libEF_8h-source.html">libEF.h</a></ul>
207</div>
[210]208<hr size="1"><address style="text-align: right;"><small>Generated on Wed Nov 12 19:18:56 2008 for mixpp by&nbsp;
[171]209<a href="http://www.doxygen.org/index.html">
210<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
211</body>
212</html>
Note: See TracBrowser for help on using the browser.