root/doc/html/classbdm_1_1mgamma.html @ 269

Revision 269, 18.3 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::mgamma 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_1mgamma.html">mgamma</a>
28  </div>
29</div>
30<div class="contents">
31<h1>bdm::mgamma Class Reference</h1><!-- doxytag: class="bdm::mgamma" --><!-- doxytag: inherits="bdm::mEF" -->Gamma random walk. 
32<a href="#_details">More...</a>
33<p>
34<code>#include &lt;<a class="el" href="libEF_8h-source.html">libEF.h</a>&gt;</code>
35<p>
36<div class="dynheader">
37Inheritance diagram for bdm::mgamma:</div>
38<div class="dynsection">
39<p><center><img src="classbdm_1_1mgamma__inherit__graph.png" border="0" usemap="#bdm_1_1mgamma__inherit__map" alt="Inheritance graph"></center>
40<map name="bdm_1_1mgamma__inherit__map">
41<area shape="rect" href="classbdm_1_1mgamma__fix.html" title="Gamma random walk around a fixed point." alt="" coords="5,316,147,343"><area shape="rect" href="classbdm_1_1mEF.html" title="Exponential family model." alt="" coords="33,161,119,188"><area shape="rect" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies." alt="" coords="31,84,121,111"><area shape="rect" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects." alt="" coords="20,7,132,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::mgamma:</div>
45<div class="dynsection">
46<p><center><img src="classbdm_1_1mgamma__coll__graph.png" border="0" usemap="#bdm_1_1mgamma__coll__map" alt="Collaboration graph"></center>
47<map name="bdm_1_1mgamma__coll__map">
48<area shape="rect" href="classbdm_1_1mEF.html" title="Exponential family model." alt="" coords="5,364,91,391"><area shape="rect" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies." alt="" coords="8,284,99,311"><area shape="rect" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects." alt="" coords="19,7,131,33"><area shape="rect" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables." alt="" coords="37,87,112,113"><area shape="rect" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="105,185,191,212"><area shape="rect" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density." alt="" coords="129,284,209,311"><area shape="rect" href="classbdm_1_1egamma.html" title="Gamma posterior density." alt="" coords="115,364,229,391"></map>
49<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
50
51<p>
52<a href="classbdm_1_1mgamma-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="2f6425cd966191b0be4c6ea91a40b6d9"></a><!-- doxytag: member="bdm::mgamma::mgamma" ref="2f6425cd966191b0be4c6ea91a40b6d9" args="(const RV &amp;rv, const RV &amp;rvc)" -->
56&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mgamma.html#2f6425cd966191b0be4c6ea91a40b6d9">mgamma</a> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &amp;<a class="el" href="classbdm_1_1mpdf.html#9bcfb45435d30983f436d41c298cbb51">rv</a>, const <a class="el" href="classbdm_1_1RV.html">RV</a> &amp;<a class="el" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288">rvc</a>)</td></tr>
57
58<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <br></td></tr>
59<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0b486f7e52a3d8a39adbcbd325461c0d"></a><!-- doxytag: member="bdm::mgamma::set_parameters" ref="0b486f7e52a3d8a39adbcbd325461c0d" args="(double k)" -->
60void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mgamma.html#0b486f7e52a3d8a39adbcbd325461c0d">set_parameters</a> (double <a class="el" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09">k</a>)</td></tr>
61
62<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set value of <code>k</code>. <br></td></tr>
63<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8996500f1885e39cde30221b20900bff"></a><!-- doxytag: member="bdm::mgamma::condition" ref="8996500f1885e39cde30221b20900bff" args="(const vec &amp;val)" -->
64void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mgamma.html#8996500f1885e39cde30221b20900bff">condition</a> (const vec &amp;val)</td></tr>
65
66<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Update <code>ep</code> so that it represents this <a class="el" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> conditioned on <code>rvc</code> = cond. <br></td></tr>
67<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#f0c1db6fcbb3aae2dd6123884457a367">samplecond</a> (const vec &amp;cond)</td></tr>
68
69<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a sample from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_10.png"><a href="#f0c1db6fcbb3aae2dd6123884457a367"></a><br></td></tr>
70<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#ee26963a637b2ea1fb1933652981e652">samplecond_m</a> (const vec &amp;cond, vec &amp;ll, int N)</td></tr>
71
72<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns.  <a href="#ee26963a637b2ea1fb1933652981e652"></a><br></td></tr>
73<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6336a8a72462e2a56a3989a220f18b1b"></a><!-- doxytag: member="bdm::mgamma::evallogcond" ref="6336a8a72462e2a56a3989a220f18b1b" args="(const vec &amp;dt, const vec &amp;cond)" -->
74virtual double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#6336a8a72462e2a56a3989a220f18b1b">evallogcond</a> (const vec &amp;dt, const vec &amp;cond)</td></tr>
75
76<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shortcut for conditioning and evaluation of the internal <a class="el" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>. In some cases, this operation can be implemented efficiently. <br></td></tr>
77<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0b0ed1ed663071bb7cf4a1349eb94fcb"></a><!-- doxytag: member="bdm::mgamma::evallogcond_m" ref="0b0ed1ed663071bb7cf4a1349eb94fcb" args="(const mat &amp;Dt, const vec &amp;cond)" -->
78virtual vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#0b0ed1ed663071bb7cf4a1349eb94fcb">evallogcond_m</a> (const mat &amp;Dt, const vec &amp;cond)</td></tr>
79
80<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Matrix version of evallogcond. <br></td></tr>
81<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b3aba7311038bf990d706a64cab60cf8"></a><!-- doxytag: member="bdm::mgamma::_rvc" ref="b3aba7311038bf990d706a64cab60cf8" args="() const " -->
82<a class="el" href="classbdm_1_1RV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#b3aba7311038bf990d706a64cab60cf8">_rvc</a> () const </td></tr>
83
84<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
85<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="222d5280e309c5a053ba73841e98c151"></a><!-- doxytag: member="bdm::mgamma::_rv" ref="222d5280e309c5a053ba73841e98c151" args="() const " -->
86<a class="el" href="classbdm_1_1RV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#222d5280e309c5a053ba73841e98c151">_rv</a> () const </td></tr>
87
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
89<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1892fe3933488942253679f068e9e7f6"></a><!-- doxytag: member="bdm::mgamma::_epdf" ref="1892fe3933488942253679f068e9e7f6" args="()" -->
90<a class="el" href="classbdm_1_1epdf.html">epdf</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#1892fe3933488942253679f068e9e7f6">_epdf</a> ()</td></tr>
91
92<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
93<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="05e843fd11c410a99dad2b88c55aca80"></a><!-- doxytag: member="bdm::mgamma::_e" ref="05e843fd11c410a99dad2b88c55aca80" args="()" -->
94<a class="el" href="classbdm_1_1epdf.html">epdf</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#05e843fd11c410a99dad2b88c55aca80">_e</a> ()</td></tr>
95
96<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
97<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
98<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bdc9f1e9e03c09e91103fee269864438"></a><!-- doxytag: member="bdm::mgamma::epdf" ref="bdc9f1e9e03c09e91103fee269864438" args="" -->
99<a class="el" href="classbdm_1_1egamma.html">egamma</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mgamma.html#bdc9f1e9e03c09e91103fee269864438">epdf</a></td></tr>
100
101<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Internal <a class="el" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> that arise by conditioning on <code>rvc</code>. <br></td></tr>
102<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b20cf88cca1fe9b0b8f2a412608bfd09"></a><!-- doxytag: member="bdm::mgamma::k" ref="b20cf88cca1fe9b0b8f2a412608bfd09" args="" -->
103double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mgamma.html#b20cf88cca1fe9b0b8f2a412608bfd09">k</a></td></tr>
104
105<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constant <img class="formulaInl" alt="$k$" src="form_41.png">. <br></td></tr>
106<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f6a652ce70fa2eb4d2c7ba6d5a6ae343"></a><!-- doxytag: member="bdm::mgamma::_beta" ref="f6a652ce70fa2eb4d2c7ba6d5a6ae343" args="" -->
107vec *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mgamma.html#f6a652ce70fa2eb4d2c7ba6d5a6ae343">_beta</a></td></tr>
108
109<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">cache of epdf.beta <br></td></tr>
110<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9bcfb45435d30983f436d41c298cbb51"></a><!-- doxytag: member="bdm::mgamma::rv" ref="9bcfb45435d30983f436d41c298cbb51" args="" -->
111<a class="el" href="classbdm_1_1RV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#9bcfb45435d30983f436d41c298cbb51">rv</a></td></tr>
112
113<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">modeled random variable <br></td></tr>
114<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5a5f08950daa08b85b01ddf4e1c36288"></a><!-- doxytag: member="bdm::mgamma::rvc" ref="5a5f08950daa08b85b01ddf4e1c36288" args="" -->
115<a class="el" href="classbdm_1_1RV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288">rvc</a></td></tr>
116
117<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">random variable in condition <br></td></tr>
118<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5eea43c56d38e4441bfb30270db949c0"></a><!-- doxytag: member="bdm::mgamma::ep" ref="5eea43c56d38e4441bfb30270db949c0" args="" -->
119<a class="el" href="classbdm_1_1epdf.html">epdf</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0">ep</a></td></tr>
120
121<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">pointer to internal <a class="el" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> <br></td></tr>
122</table>
123<hr><a name="_details"></a><h2>Detailed Description</h2>
124Gamma random walk.
125<p>
126Mean value, <img class="formulaInl" alt="$\mu$" src="form_14.png">, of this density is given by <code>rvc</code> . Standard deviation of the random walk is proportional to one <img class="formulaInl" alt="$k$" src="form_41.png">-th the mean. This is achieved by setting <img class="formulaInl" alt="$\alpha=k$" src="form_11.png"> and <img class="formulaInl" alt="$\beta=k/\mu$" src="form_12.png">.<p>
127The standard deviation of the walk is then: <img class="formulaInl" alt="$\mu/\sqrt(k)$" src="form_13.png">. <hr><h2>Member Function Documentation</h2>
128<a class="anchor" name="f0c1db6fcbb3aae2dd6123884457a367"></a><!-- doxytag: member="bdm::mgamma::samplecond" ref="f0c1db6fcbb3aae2dd6123884457a367" args="(const vec &amp;cond)" -->
129<div class="memitem">
130<div class="memproto">
131      <table class="memname">
132        <tr>
133          <td class="memname">virtual vec bdm::mpdf::samplecond           </td>
134          <td>(</td>
135          <td class="paramtype">const vec &amp;&nbsp;</td>
136          <td class="paramname"> <em>cond</em>          </td>
137          <td>&nbsp;)&nbsp;</td>
138          <td><code> [inline, virtual, inherited]</code></td>
139        </tr>
140      </table>
141</div>
142<div class="memdoc">
143
144<p>
145Returns a sample from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_10.png">.
146<p>
147<dl compact><dt><b>Parameters:</b></dt><dd>
148  <table border="0" cellspacing="2" cellpadding="0">
149    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>is numeric value of <code>rv</code> </td></tr>
150  </table>
151</dl>
152
153<p>References <a class="el" href="libBM_8h-source.html#l00250">bdm::mpdf::condition()</a>, <a class="el" href="libBM_8h-source.html#l00233">bdm::mpdf::ep</a>, and <a class="el" href="classbdm_1_1epdf.html#09721eb148bc49d6ec2f1956039f3a10">bdm::epdf::sample()</a>.</p>
154
155<p>Referenced by <a class="el" href="libPF_8h-source.html#l00143">bdm::MPF&lt; BM_T &gt;::bayes()</a>, <a class="el" href="libPF_8cpp-source.html#l00007">bdm::PF::bayes()</a>, and <a class="el" href="libDS_8cpp-source.html#l00044">bdm::ArxDS::step()</a>.</p>
156
157</div>
158</div><p>
159<a class="anchor" name="ee26963a637b2ea1fb1933652981e652"></a><!-- doxytag: member="bdm::mgamma::samplecond_m" ref="ee26963a637b2ea1fb1933652981e652" args="(const vec &amp;cond, vec &amp;ll, int N)" -->
160<div class="memitem">
161<div class="memproto">
162      <table class="memname">
163        <tr>
164          <td class="memname">virtual mat bdm::mpdf::samplecond_m           </td>
165          <td>(</td>
166          <td class="paramtype">const vec &amp;&nbsp;</td>
167          <td class="paramname"> <em>cond</em>, </td>
168        </tr>
169        <tr>
170          <td class="paramkey"></td>
171          <td></td>
172          <td class="paramtype">vec &amp;&nbsp;</td>
173          <td class="paramname"> <em>ll</em>, </td>
174        </tr>
175        <tr>
176          <td class="paramkey"></td>
177          <td></td>
178          <td class="paramtype">int&nbsp;</td>
179          <td class="paramname"> <em>N</em></td><td>&nbsp;</td>
180        </tr>
181        <tr>
182          <td></td>
183          <td>)</td>
184          <td></td><td></td><td><code> [inline, virtual, inherited]</code></td>
185        </tr>
186      </table>
187</div>
188<div class="memdoc">
189
190<p>
191Returns.
192<p>
193<dl compact><dt><b>Parameters:</b></dt><dd>
194  <table border="0" cellspacing="2" cellpadding="0">
195    <tr><td valign="top"></td><td valign="top"><em>N</em>&nbsp;</td><td>samples from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_10.png">. </td></tr>
196    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>is numeric value of <code>rv</code> </td></tr>
197    <tr><td valign="top"></td><td valign="top"><em>ll</em>&nbsp;</td><td>is a return value of log-likelihood of the sample. </td></tr>
198  </table>
199</dl>
200
201<p>References <a class="el" href="libBM_8h-source.html#l00250">bdm::mpdf::condition()</a>, <a class="el" href="libBM_8h-source.html#l00086">bdm::RV::count()</a>, <a class="el" href="libBM_8h-source.html#l00233">bdm::mpdf::ep</a>, <a class="el" href="classbdm_1_1epdf.html#a8e39e2ff5e5cf5471bc159530d3b2d3">bdm::epdf::evallog()</a>, <a class="el" href="libBM_8h-source.html#l00229">bdm::mpdf::rv</a>, and <a class="el" href="classbdm_1_1epdf.html#09721eb148bc49d6ec2f1956039f3a10">bdm::epdf::sample()</a>.</p>
202
203</div>
204</div><p>
205<hr>The documentation for this class was generated from the following files:<ul>
206<li><a class="el" href="libEF_8h-source.html">libEF.h</a><li>libEF.cpp</ul>
207</div>
208<hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 11 10:21:07 2009 for mixpp by&nbsp;
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.