root/doc/html/classmgamma__fix.html @ 210

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

dokumentace

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: mgamma_fix 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>mgamma_fix Class Reference</h1><!-- doxytag: class="mgamma_fix" --><!-- doxytag: inherits="mgamma" -->Gamma random walk around a fixed point. 
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 mgamma_fix:</div>
33<div class="dynsection">
34<p><center><img src="classmgamma__fix__inherit__graph.png" border="0" usemap="#mgamma__fix__inherit__map" alt="Inheritance graph"></center>
35<map name="mgamma__fix__inherit__map">
36<area shape="rect" href="classmgamma.html" title="Gamma random walk." alt="" coords="16,156,91,180"><area shape="rect" href="classmEF.html" title="Exponential family model." alt="" coords="29,81,77,105"><area shape="rect" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies." alt="" coords="28,6,79,30"></map>
37<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
38<div class="dynheader">
39Collaboration diagram for mgamma_fix:</div>
40<div class="dynsection">
41<p><center><img src="classmgamma__fix__coll__graph.png" border="0" usemap="#mgamma__fix__coll__map" alt="Collaboration graph"></center>
42<map name="mgamma__fix__coll__map">
43<area shape="rect" href="classmgamma.html" title="Gamma random walk." alt="" coords="23,351,97,375"><area shape="rect" href="classmEF.html" title="Exponential family model." alt="" coords="5,263,53,287"><area shape="rect" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies." alt="" coords="8,186,59,210"><area shape="rect" href="classRV.html" title="Class representing variables, most often random variables." alt="" coords="41,7,79,31"><area shape="rect" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density." alt="" coords="75,96,120,120"><area shape="rect" href="classeEF.html" title="General conjugate exponential family posterior density." alt="" coords="88,186,133,210"><area shape="rect" href="classegamma.html" title="Gamma posterior density." alt="" coords="77,263,149,287"></map>
44<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
45
46<p>
47<a href="classmgamma__fix-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="b92c3d2e5fd0381033a072e5ef3bcf80"></a><!-- doxytag: member="mgamma_fix::mgamma_fix" ref="b92c3d2e5fd0381033a072e5ef3bcf80" args="(const RV &amp;rv, const RV &amp;rvc)" -->
51&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma__fix.html#b92c3d2e5fd0381033a072e5ef3bcf80">mgamma_fix</a> (const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb">rv</a>, const <a class="el" href="classRV.html">RV</a> &amp;<a class="el" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab">rvc</a>)</td></tr>
52
53<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <br></td></tr>
54<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ec6f846896749e27cb7be9fa48dd1cb1"></a><!-- doxytag: member="mgamma_fix::set_parameters" ref="ec6f846896749e27cb7be9fa48dd1cb1" args="(double k0, vec ref0, double l0)" -->
55void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma__fix.html#ec6f846896749e27cb7be9fa48dd1cb1">set_parameters</a> (double k0, vec ref0, double l0)</td></tr>
56
57<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set value of <code>k</code>. <br></td></tr>
58<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6ea3931eec7b7da7b693e45981052460"></a><!-- doxytag: member="mgamma_fix::condition" ref="6ea3931eec7b7da7b693e45981052460" args="(const vec &amp;val)" -->
59void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma__fix.html#6ea3931eec7b7da7b693e45981052460">condition</a> (const vec &amp;val)</td></tr>
60
61<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Update <code>ep</code> so that it represents this <a class="el" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> conditioned on <code>rvc</code> = cond. <br></td></tr>
62<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a9d646cf758a70126dde7c48790b6e94"></a><!-- doxytag: member="mgamma_fix::set_parameters" ref="a9d646cf758a70126dde7c48790b6e94" args="(double k)" -->
63void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma.html#a9d646cf758a70126dde7c48790b6e94">set_parameters</a> (double <a class="el" href="classmgamma.html#43f733cce0245a52363d566099add687">k</a>)</td></tr>
64
65<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set value of <code>k</code>. <br></td></tr>
66<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#3f172b79ec4a5ebc87898a5381141f1b">samplecond</a> (const vec &amp;cond, double &amp;ll)</td></tr>
67
68<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the required moment of the <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a><a href="#3f172b79ec4a5ebc87898a5381141f1b"></a><br></td></tr>
69<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual mat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#0e37163660f93df2a4d723cedb1da89c">samplecond</a> (const vec &amp;cond, vec &amp;ll, int N)</td></tr>
70
71<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns.  <a href="#0e37163660f93df2a4d723cedb1da89c"></a><br></td></tr>
72<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="80b738ece5bd4f8c4edaee4b38906f91"></a><!-- doxytag: member="mgamma_fix::evalcond" ref="80b738ece5bd4f8c4edaee4b38906f91" args="(const vec &amp;dt, const vec &amp;cond)" -->
73virtual double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#80b738ece5bd4f8c4edaee4b38906f91">evalcond</a> (const vec &amp;dt, const vec &amp;cond)</td></tr>
74
75<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shortcut for conditioning and evaluation of the internal <a class="el" href="classepdf.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>
76<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b7b2da35080cd15f1be365b805e7277e"></a><!-- doxytag: member="mgamma_fix::evalcond_m" ref="b7b2da35080cd15f1be365b805e7277e" args="(const mat &amp;Dt, const vec &amp;cond)" -->
77virtual vec&nbsp;</td><td class="memItemRight" valign="bottom"><b>evalcond_m</b> (const mat &amp;Dt, const vec &amp;cond)</td></tr>
78
79<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="15ef062183b1ccdf794732d5fa0b77cd"></a><!-- doxytag: member="mgamma_fix::_rvc" ref="15ef062183b1ccdf794732d5fa0b77cd" args="() const " -->
80<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#15ef062183b1ccdf794732d5fa0b77cd">_rvc</a> () const </td></tr>
81
82<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
83<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="71256ffb5fbd08f41d650e606a5bd585"></a><!-- doxytag: member="mgamma_fix::_rv" ref="71256ffb5fbd08f41d650e606a5bd585" args="() const " -->
84<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#71256ffb5fbd08f41d650e606a5bd585">_rv</a> () const </td></tr>
85
86<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
87<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e17780ee5b2cfe05922a6c56af1462f8"></a><!-- doxytag: member="mgamma_fix::_epdf" ref="e17780ee5b2cfe05922a6c56af1462f8" args="()" -->
88<a class="el" href="classepdf.html">epdf</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#e17780ee5b2cfe05922a6c56af1462f8">_epdf</a> ()</td></tr>
89
90<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">access function <br></td></tr>
91<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
92<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3f48c09caddc298901ad75fe7c0529f6"></a><!-- doxytag: member="mgamma_fix::l" ref="3f48c09caddc298901ad75fe7c0529f6" args="" -->
93double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma__fix.html#3f48c09caddc298901ad75fe7c0529f6">l</a></td></tr>
94
95<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">parameter l <br></td></tr>
96<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="81ce49029ecc385418619b200dcafeb0"></a><!-- doxytag: member="mgamma_fix::refl" ref="81ce49029ecc385418619b200dcafeb0" args="" -->
97vec&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma__fix.html#81ce49029ecc385418619b200dcafeb0">refl</a></td></tr>
98
99<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">reference vector <br></td></tr>
100<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="612dbf35c770a780027619aaac2c443e"></a><!-- doxytag: member="mgamma_fix::epdf" ref="612dbf35c770a780027619aaac2c443e" args="" -->
101<a class="el" href="classegamma.html">egamma</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma.html#612dbf35c770a780027619aaac2c443e">epdf</a></td></tr>
102
103<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Internal <a class="el" href="classepdf.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>
104<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="43f733cce0245a52363d566099add687"></a><!-- doxytag: member="mgamma_fix::k" ref="43f733cce0245a52363d566099add687" args="" -->
105double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma.html#43f733cce0245a52363d566099add687">k</a></td></tr>
106
107<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constant <img class="formulaInl" alt="$k$" src="form_41.png">. <br></td></tr>
108<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5e90652837448bcc29707e7412f99691"></a><!-- doxytag: member="mgamma_fix::_beta" ref="5e90652837448bcc29707e7412f99691" args="" -->
109vec *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmgamma.html#5e90652837448bcc29707e7412f99691">_beta</a></td></tr>
110
111<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">cache of epdf.beta <br></td></tr>
112<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f6687c07ff07d47812dd565368ca59eb"></a><!-- doxytag: member="mgamma_fix::rv" ref="f6687c07ff07d47812dd565368ca59eb" args="" -->
113<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#f6687c07ff07d47812dd565368ca59eb">rv</a></td></tr>
114
115<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">modeled random variable <br></td></tr>
116<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="acb7dda792b3cd5576f39fa3129abbab"></a><!-- doxytag: member="mgamma_fix::rvc" ref="acb7dda792b3cd5576f39fa3129abbab" args="" -->
117<a class="el" href="classRV.html">RV</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#acb7dda792b3cd5576f39fa3129abbab">rvc</a></td></tr>
118
119<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">random variable in condition <br></td></tr>
120<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7aa894208a32f3487827df6d5054424c"></a><!-- doxytag: member="mgamma_fix::ep" ref="7aa894208a32f3487827df6d5054424c" args="" -->
121<a class="el" href="classepdf.html">epdf</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmpdf.html#7aa894208a32f3487827df6d5054424c">ep</a></td></tr>
122
123<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">pointer to internal <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> <br></td></tr>
124</table>
125<hr><a name="_details"></a><h2>Detailed Description</h2>
126Gamma random walk around a fixed point.
127<p>
128Mean value, <img class="formulaInl" alt="$\mu$" src="form_14.png">, of this density is given by a geometric combination of <code>rvc</code> and given fixed point, <img class="formulaInl" alt="$p$" src="form_42.png">. <img class="formulaInl" alt="$l$" src="form_43.png"> is the coefficient of the geometric combimation <p class="formulaDsp">
129<img class="formulaDsp" alt="\[ \mu = \mu_{t-1} ^{l} p^{1-l}\]" src="form_18.png">
130<p>
131<p>
132Standard 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>
133The standard deviation of the walk is then: <img class="formulaInl" alt="$\mu/\sqrt(k)$" src="form_13.png">. <hr><h2>Member Function Documentation</h2>
134<a class="anchor" name="3f172b79ec4a5ebc87898a5381141f1b"></a><!-- doxytag: member="mgamma_fix::samplecond" ref="3f172b79ec4a5ebc87898a5381141f1b" args="(const vec &amp;cond, double &amp;ll)" -->
135<div class="memitem">
136<div class="memproto">
137      <table class="memname">
138        <tr>
139          <td class="memname">virtual vec mpdf::samplecond           </td>
140          <td>(</td>
141          <td class="paramtype">const vec &amp;&nbsp;</td>
142          <td class="paramname"> <em>cond</em>, </td>
143        </tr>
144        <tr>
145          <td class="paramkey"></td>
146          <td></td>
147          <td class="paramtype">double &amp;&nbsp;</td>
148          <td class="paramname"> <em>ll</em></td><td>&nbsp;</td>
149        </tr>
150        <tr>
151          <td></td>
152          <td>)</td>
153          <td></td><td></td><td><code> [inline, virtual, inherited]</code></td>
154        </tr>
155      </table>
156</div>
157<div class="memdoc">
158
159<p>
160Returns the required moment of the <a class="el" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>.
161<p>
162Returns a sample from the density conditioned on <code>cond</code>, <img class="formulaInl" alt="$x \sim epdf(rv|cond)$" src="form_10.png">. <dl compact><dt><b>Parameters:</b></dt><dd>
163  <table border="0" cellspacing="2" cellpadding="0">
164    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>is numeric value of <code>rv</code> </td></tr>
165    <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>
166  </table>
167</dl>
168
169<p>Reimplemented in <a class="el" href="classmprod.html#a48887eb8738a9e5550bfc38eb8e9d68">mprod</a>.</p>
170
171<p>References <a class="el" href="libBM_8h-source.html#l00229">mpdf::condition()</a>, <a class="el" href="libBM_8h-source.html#l00210">mpdf::ep</a>, <a class="el" href="classepdf.html#6aef3eca74899692503769c18add1a4c">epdf::evalpdflog()</a>, and <a class="el" href="classepdf.html#8019654e494bf5e458f6fb947e11b262">epdf::sample()</a>.</p>
172
173<p>Referenced by <a class="el" href="libPF_8h-source.html#l00138">MPF&lt; BM_T &gt;::bayes()</a>, and <a class="el" href="libPF_8cpp-source.html#l00007">PF::bayes()</a>.</p>
174
175</div>
176</div><p>
177<a class="anchor" name="0e37163660f93df2a4d723cedb1da89c"></a><!-- doxytag: member="mgamma_fix::samplecond" ref="0e37163660f93df2a4d723cedb1da89c" args="(const vec &amp;cond, vec &amp;ll, int N)" -->
178<div class="memitem">
179<div class="memproto">
180      <table class="memname">
181        <tr>
182          <td class="memname">virtual mat mpdf::samplecond           </td>
183          <td>(</td>
184          <td class="paramtype">const vec &amp;&nbsp;</td>
185          <td class="paramname"> <em>cond</em>, </td>
186        </tr>
187        <tr>
188          <td class="paramkey"></td>
189          <td></td>
190          <td class="paramtype">vec &amp;&nbsp;</td>
191          <td class="paramname"> <em>ll</em>, </td>
192        </tr>
193        <tr>
194          <td class="paramkey"></td>
195          <td></td>
196          <td class="paramtype">int&nbsp;</td>
197          <td class="paramname"> <em>N</em></td><td>&nbsp;</td>
198        </tr>
199        <tr>
200          <td></td>
201          <td>)</td>
202          <td></td><td></td><td><code> [inline, virtual, inherited]</code></td>
203        </tr>
204      </table>
205</div>
206<div class="memdoc">
207
208<p>
209Returns.
210<p>
211<dl compact><dt><b>Parameters:</b></dt><dd>
212  <table border="0" cellspacing="2" cellpadding="0">
213    <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>
214    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>is numeric value of <code>rv</code> </td></tr>
215    <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>
216  </table>
217</dl>
218
219<p>Reimplemented in <a class="el" href="classmprod.html#e171c40e210539c2af01d6237785620b">mprod</a>.</p>
220
221<p>References <a class="el" href="libBM_8h-source.html#l00229">mpdf::condition()</a>, <a class="el" href="libBM_8h-source.html#l00073">RV::count()</a>, <a class="el" href="libBM_8h-source.html#l00210">mpdf::ep</a>, <a class="el" href="classepdf.html#6aef3eca74899692503769c18add1a4c">epdf::evalpdflog()</a>, <a class="el" href="libBM_8h-source.html#l00206">mpdf::rv</a>, and <a class="el" href="classepdf.html#8019654e494bf5e458f6fb947e11b262">epdf::sample()</a>.</p>
222
223</div>
224</div><p>
225<hr>The documentation for this class was generated from the following file:<ul>
226<li>work/git/mixpp/bdm/stat/<a class="el" href="libEF_8h-source.html">libEF.h</a></ul>
227</div>
228<hr size="1"><address style="text-align: right;"><small>Generated on Wed Nov 12 19:18:55 2008 for mixpp by&nbsp;
229<a href="http://www.doxygen.org/index.html">
230<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
231</body>
232</html>
Note: See TracBrowser for help on using the browser.