Changeset 269 for doc/html/libEF_8h-source.html
- Timestamp:
- 02/11/09 14:15:39 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
doc/html/libEF_8h-source.html
r264 r269 31 31 <a name="l00025"></a>00025 <span class="keyword">extern</span> Uniform_RNG <a class="code" href="namespacebdm.html#96288dbda6916cd442af735f66a9f40b" title="Global Uniform_RNG.">UniRNG</a>; 32 32 <a name="l00027"></a>00027 <span class="keyword">extern</span> Normal_RNG <a class="code" href="namespacebdm.html#c959a7382efbcc31af4b58cf0f0f951a" title="Global Normal_RNG.">NorRNG</a>; 33 <a name="l00029"></a>00029 <span class="keyword">extern</span> <a class="code" href="classitpp_1_1Gamma__RNG.html" title="Gamma distribution.">Gamma_RNG</a><a class="code" href="namespacebdm.html#2828dc833cc283a1fb39a5e8dc06518f" title="Global Gamma_RNG.">GamRNG</a>;33 <a name="l00029"></a>00029 <span class="keyword">extern</span> Gamma_RNG <a class="code" href="namespacebdm.html#2828dc833cc283a1fb39a5e8dc06518f" title="Global Gamma_RNG.">GamRNG</a>; 34 34 <a name="l00030"></a>00030 35 35 <a name="l00037"></a><a class="code" href="classbdm_1_1eEF.html">00037</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eEF.html" title="General conjugate exponential family posterior density.">eEF</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> { … … 55 55 <a name="l00071"></a>00071 }; 56 56 <a name="l00072"></a>00072 57 <a name="l00074"></a><a class="code" href="classbdm_1_1BMEF.html">00074</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> {57 <a name="l00074"></a><a class="code" href="classbdm_1_1BMEF.html">00074</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a> { 58 58 <a name="l00075"></a>00075 <span class="keyword">protected</span>: 59 59 <a name="l00077"></a><a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64">00077</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>; 60 60 <a name="l00079"></a><a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865">00079</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>; 61 61 <a name="l00080"></a>00080 <span class="keyword">public</span>: 62 <a name="l00082"></a><a class="code" href="classbdm_1_1BMEF.html#73bccd1d8142d4d330e35637ca30decc">00082</a> <a class="code" href="classbdm_1_1BMEF.html#73bccd1d8142d4d330e35637ca30decc" title="Default constructor.">BMEF</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a>, <span class="keywordtype">double</span> frg0=1.0 ) :<a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( rv ), <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a> ( frg0 ) {}63 <a name="l00084"></a><a class="code" href="classbdm_1_1BMEF.html#9662379513101405e159e76717104e62">00084</a> <a class="code" href="classbdm_1_1BMEF.html#73bccd1d8142d4d330e35637ca30decc" title="Default constructor.">BMEF</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> &B ) :<a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( B ), <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a> ( B.<a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a> ), <a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a> ( B.<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a> ) {}62 <a name="l00082"></a><a class="code" href="classbdm_1_1BMEF.html#73bccd1d8142d4d330e35637ca30decc">00082</a> <a class="code" href="classbdm_1_1BMEF.html#73bccd1d8142d4d330e35637ca30decc" title="Default constructor.">BMEF</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a>, <span class="keywordtype">double</span> frg0=1.0 ) :<a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a> ( rv ), <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a> ( frg0 ) {} 63 <a name="l00084"></a><a class="code" href="classbdm_1_1BMEF.html#9662379513101405e159e76717104e62">00084</a> <a class="code" href="classbdm_1_1BMEF.html#73bccd1d8142d4d330e35637ca30decc" title="Default constructor.">BMEF</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> &B ) :<a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a> ( B ), <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a> ( B.<a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a> ), <a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a> ( B.<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a> ) {} 64 64 <a name="l00086"></a><a class="code" href="classbdm_1_1BMEF.html#d2b528b7a41ca67163152142f5404051">00086</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1BMEF.html#d2b528b7a41ca67163152142f5404051" title="get statistics from another model">set_statistics</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* BM0 ) {it_error ( <span class="stringliteral">"Not implemented"</span> );}; 65 65 <a name="l00088"></a><a class="code" href="classbdm_1_1BMEF.html#bf58deb99af2a6cc674f13ff90300de6">00088</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1BMEF.html#bf58deb99af2a6cc674f13ff90300de6" title="Weighted update of sufficient statistics (Bayes rule).">bayes</a> ( <span class="keyword">const</span> vec &data, <span class="keyword">const</span> <span class="keywordtype">double</span> w ) {}; … … 190 190 <a name="l00267"></a><a class="code" href="classbdm_1_1multiBM.html#65dc7567b67ce86a8f339dd496ed8e88">00267</a> <a class="code" href="classbdm_1_1multiBM.html#65dc7567b67ce86a8f339dd496ed8e88" title="Default constructor.">multiBM</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a>, <span class="keyword">const</span> vec beta0 ) : <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( rv ),<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ( rv,beta0 ),<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>._beta() ) {<span class="keywordflow">if</span>(<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>.length()>0){<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();}<span class="keywordflow">else</span>{<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=0.0;}} 191 191 <a name="l00269"></a><a class="code" href="classbdm_1_1multiBM.html#c4378cf8037f6bed29c74eea63344b31">00269</a> <a class="code" href="classbdm_1_1multiBM.html#65dc7567b67ce86a8f339dd496ed8e88" title="Default constructor.">multiBM</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a> &B ) : <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( B ),<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a> ( <a class="code" href="classbdm_1_1BM.html#18d6db4af8ee42077741d9e3618153ca" title="Random variable of the posterior.">rv</a>,B.<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ),<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a> ( <a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>._beta() ) {} 192 <a name="l00271"></a><a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52">00271</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52" title="Sets sufficient statistics to match that of givefrom mB0.">set_statistics</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a>* mB0 ) {<span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>* mB=<span class="keyword">dynamic_cast<</span><span class="keyword">const </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>*<span class="keyword">></span> ( mB0 ); <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>=mB-><a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>;}192 <a name="l00271"></a><a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52">00271</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#dbe6b90d410dc062a233d1dc09eeba52" title="Sets sufficient statistics to match that of givefrom mB0.">set_statistics</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a>* mB0 ) {<span class="keyword">const</span> <a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>* mB=<span class="keyword">dynamic_cast<</span><span class="keyword">const </span><a class="code" href="classbdm_1_1multiBM.html" title="Estimator for Multinomial density.">multiBM</a>*<span class="keyword">></span> ( mB0 ); <a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>=mB-><a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>;} 193 193 <a name="l00272"></a><a class="code" href="classbdm_1_1multiBM.html#1e4bf41b61937fd80f34049742e23f95">00272</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1multiBM.html#1e4bf41b61937fd80f34049742e23f95" title="Incremental Bayes rule.">bayes</a> ( <span class="keyword">const</span> vec &dt ) { 194 194 <a name="l00273"></a>00273 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a><1.0 ) {<a class="code" href="classbdm_1_1multiBM.html#044263356944c92209eecd39a5187d25" title="Pointer inside est to sufficient statistics.">beta</a>*=<a class="code" href="classbdm_1_1BMEF.html#1331865e10fb1ccef65bb4c47fa3be64" title="forgetting factor">frg</a>;<a class="code" href="classbdm_1_1BMEF.html#06e7b3ac03e10017d4288c76888e2865" title="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</a>=<a class="code" href="classbdm_1_1multiBM.html#9ecc6878abbd20eb8d8e43b6ab3f941a" title="Conjugate prior and posterior.">est</a>.<a class="code" href="classbdm_1_1eDirich.html#279a99f6266c82fe2273e83841f19eb2" title="logarithm of the normalizing constant, ">lognc</a>();} … … 611 611 <a name="l00837"></a>00837 <span class="preprocessor">#endif //EF_H</span> 612 612 </pre></div></div> 613 <hr size="1"><address style="text-align: right;"><small>Generated on Fri Feb 6 19:49:45 2009 for mixpp by 613 <hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 11 10:20:05 2009 for mixpp by 614 614 <a href="http://www.doxygen.org/index.html"> 615 615 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>