28 | | <a name="l00039"></a><a class="code" href="classMixEF.html">00039</a> <span class="keyword">class </span><a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>: <span class="keyword">public</span> <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> { |
29 | | <a name="l00040"></a>00040 <span class="keyword">protected</span>: |
30 | | <a name="l00042"></a><a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149">00042</a> <span class="keywordtype">int</span> <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>; |
31 | | <a name="l00044"></a><a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e">00044</a> Array<BMEF*> <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a>; |
32 | | <a name="l00046"></a><a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f">00046</a> <a class="code" href="classmultiBM.html" title="Estimator for Multinomial density.">multiBM</a> <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a>; |
33 | | <a name="l00048"></a><a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc">00048</a> <a class="code" href="classeprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a>* <a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a>; |
34 | | <a name="l00050"></a>00050 |
35 | | <a name="l00052"></a><a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1">00052</a> <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1" title="Auxiliary function for use in constructors.">build_est</a>() { |
36 | | <a name="l00053"></a>00053 Array<const epdf*> epdfs ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>+1 ); |
37 | | <a name="l00054"></a>00054 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a>.length();i++ ) { |
38 | | <a name="l00055"></a>00055 <span class="comment">// it_assert_debug(!x,"MixEF::MixEF : Incompatible components");</span> |
39 | | <a name="l00056"></a>00056 epdfs ( i ) =& ( <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i )->_epdf() ); |
40 | | <a name="l00057"></a>00057 } |
41 | | <a name="l00058"></a>00058 <span class="comment">// last in the product is the weight</span> |
42 | | <a name="l00059"></a>00059 epdfs ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ) =& ( <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a>.<a class="code" href="classmultiBM.html#66cdfd83a70bc281840ab0646b941684" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_epdf</a>() ); |
43 | | <a name="l00060"></a>00060 <a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a> = <span class="keyword">new</span> <a class="code" href="classeprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a> ( epdfs ); |
44 | | <a name="l00061"></a>00061 } |
45 | | <a name="l00062"></a>00062 |
46 | | <a name="l00063"></a>00063 <span class="keyword">public</span>: |
47 | | <a name="l00065"></a><a class="code" href="classMixEF.html#509ac467674c39af46aba42297528aad">00065</a> <a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a> ( <span class="keyword">const</span> Array<BMEF*> &Coms0, <span class="keyword">const</span> vec &alpha0 ) : |
48 | | <a name="l00066"></a>00066 <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>() ), <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ( Coms0.length() ), <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ), |
49 | | <a name="l00067"></a>00067 <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> ( <span class="stringliteral">"{w }"</span>, vec_1 ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ) ),alpha0 ) { |
50 | | <a name="l00068"></a>00068 <span class="comment">// it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" );</span> |
51 | | <a name="l00069"></a>00069 |
52 | | <a name="l00070"></a>00070 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>;i++ ) {<a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i ) = ( <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a>* ) Coms0 ( i )->_copy_();} |
53 | | <a name="l00071"></a>00071 <a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1" title="Auxiliary function for use in constructors.">build_est</a>(); |
54 | | <a name="l00072"></a>00072 }; |
55 | | <a name="l00073"></a>00073 <a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a> () : |
56 | | <a name="l00074"></a>00074 <a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>() ), <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ( 0 ), <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( 0 ), |
57 | | <a name="l00075"></a>00075 <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> ( <span class="stringliteral">"{w }"</span>, vec_1 ( 0 ) ),vec ( 0 ) ) {<a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1" title="Auxiliary function for use in constructors.">build_est</a>();} |
58 | | <a name="l00080"></a>00080 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#73a782d2f464c830bbdbb03d34c6d63e">init</a> ( <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a>* Com0, <span class="keyword">const</span> mat &Data, <span class="keywordtype">int</span> c=5 ); |
59 | | <a name="l00081"></a>00081 <span class="comment">//Destructor</span> |
60 | | <a name="l00082"></a>00082 ~<a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>() { |
61 | | <a name="l00083"></a>00083 <span class="keyword">delete</span> <a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a>; |
62 | | <a name="l00084"></a>00084 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>;i++ ) {<span class="keyword">delete</span> <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i );} |
63 | | <a name="l00085"></a>00085 } |
64 | | <a name="l00087"></a>00087 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#d520fb534aa43f3084ff1568ffe7573d" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> vec &dt ); |
65 | | <a name="l00089"></a>00089 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#d520fb534aa43f3084ff1568ffe7573d" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> mat &dt ); |
66 | | <a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#e6810daa121ccaff1ac18f26fbad4563" title="Batch Bayes rule (columns of Dt are observations).">bayesB</a> ( <span class="keyword">const</span> mat &dt ); |
67 | | <a name="l00091"></a>00091 <span class="keywordtype">double</span> <a class="code" href="classMixEF.html#424ca64f36d4e41de7a7e7ae921d35ea">logpred</a> ( <span class="keyword">const</span> vec &dt ) <span class="keyword">const</span>; |
68 | | <a name="l00092"></a><a class="code" href="classMixEF.html#efb3e20c2151d91c4fc080b7722a2069">00092</a> <span class="keyword">const</span> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classMixEF.html#efb3e20c2151d91c4fc080b7722a2069" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_epdf</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> *<a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a>;} |
69 | | <a name="l00093"></a>00093 <a class="code" href="classemix.html" title="Mixture of epdfs.">emix</a>* <a class="code" href="classMixEF.html#a93379cf31bb25961ea7f8d3f095513d" title="Constructs a predictive density (marginal density on data).">predictor</a>(<span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>); |
70 | | <a name="l00095"></a>00095 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#fdbd5f58778c1ecb68b71945cdff0483" title="Flatten the density as if it was not estimated from the data.">flatten</a>(<span class="keywordtype">double</span> sumw=1.0); |
71 | | <a name="l00096"></a>00096 }; |
72 | | <a name="l00097"></a>00097 |
73 | | <a name="l00098"></a>00098 |
74 | | <a name="l00099"></a>00099 <span class="preprocessor">#endif // MEF_H</span> |
75 | | <a name="l00100"></a>00100 <span class="preprocessor"></span> |
76 | | <a name="l00101"></a>00101 |
| 28 | <a name="l00023"></a>00023 <span class="keyword">enum</span> MixEF_METHOD { EM = 0, QB = 1}; |
| 29 | <a name="l00024"></a>00024 |
| 30 | <a name="l00041"></a><a class="code" href="classMixEF.html">00041</a> <span class="keyword">class </span><a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>: <span class="keyword">public</span> <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a> { |
| 31 | <a name="l00042"></a>00042 <span class="keyword">protected</span>: |
| 32 | <a name="l00044"></a><a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149">00044</a> <span class="keywordtype">int</span> <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>; |
| 33 | <a name="l00046"></a><a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e">00046</a> Array<BMEF*> <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a>; |
| 34 | <a name="l00048"></a><a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f">00048</a> <a class="code" href="classmultiBM.html" title="Estimator for Multinomial density.">multiBM</a> <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a>; |
| 35 | <a name="l00050"></a><a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc">00050</a> <a class="code" href="classeprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a>* <a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a>; |
| 36 | <a name="l00052"></a>00052 |
| 37 | <a name="l00054"></a><a class="code" href="classMixEF.html#6e630b2fd4cae8aa728ea1322708c8f0">00054</a> MixEF_METHOD <a class="code" href="classMixEF.html#6e630b2fd4cae8aa728ea1322708c8f0" title="Flag for a method that is used in the inference.">method</a>; |
| 38 | <a name="l00055"></a>00055 |
| 39 | <a name="l00057"></a><a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1">00057</a> <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1" title="Auxiliary function for use in constructors.">build_est</a>() { |
| 40 | <a name="l00058"></a>00058 Array<const epdf*> epdfs ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>+1 ); |
| 41 | <a name="l00059"></a>00059 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a>.length();i++ ) { |
| 42 | <a name="l00060"></a>00060 <span class="comment">// it_assert_debug(!x,"MixEF::MixEF : Incompatible components");</span> |
| 43 | <a name="l00061"></a>00061 epdfs ( i ) =& ( <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i )->_epdf() ); |
| 44 | <a name="l00062"></a>00062 } |
| 45 | <a name="l00063"></a>00063 <span class="comment">// last in the product is the weight</span> |
| 46 | <a name="l00064"></a>00064 epdfs ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ) =& ( <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a>.<a class="code" href="classmultiBM.html#66cdfd83a70bc281840ab0646b941684" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>() ); |
| 47 | <a name="l00065"></a>00065 <a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a> = <span class="keyword">new</span> <a class="code" href="classeprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a> ( epdfs ); |
| 48 | <a name="l00066"></a>00066 } |
| 49 | <a name="l00067"></a>00067 |
| 50 | <a name="l00068"></a>00068 <span class="keyword">public</span>: |
| 51 | <a name="l00070"></a><a class="code" href="classMixEF.html#509ac467674c39af46aba42297528aad">00070</a> <a class="code" href="classMixEF.html#51fa3e3953c0af69f4e0162829d7929d" title="Constructor of empty mixture.">MixEF</a> ( <span class="keyword">const</span> Array<BMEF*> &Coms0, <span class="keyword">const</span> vec &alpha0 ) : |
| 52 | <a name="l00071"></a>00071 <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>() ), <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ( Coms0.length() ), <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ), |
| 53 | <a name="l00072"></a>00072 <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> ( <span class="stringliteral">"{w }"</span>, vec_1 ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ) ),alpha0 ), <a class="code" href="classMixEF.html#6e630b2fd4cae8aa728ea1322708c8f0" title="Flag for a method that is used in the inference.">method</a>(QB) { |
| 54 | <a name="l00073"></a>00073 <span class="comment">// it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" );</span> |
| 55 | <a name="l00074"></a>00074 |
| 56 | <a name="l00075"></a>00075 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>;i++ ) {<a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i ) = ( <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a>* ) Coms0 ( i )->_copy_();} |
| 57 | <a name="l00076"></a>00076 <a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1" title="Auxiliary function for use in constructors.">build_est</a>(); |
| 58 | <a name="l00077"></a>00077 }; |
| 59 | <a name="l00079"></a><a class="code" href="classMixEF.html#51fa3e3953c0af69f4e0162829d7929d">00079</a> <a class="code" href="classMixEF.html#51fa3e3953c0af69f4e0162829d7929d" title="Constructor of empty mixture.">MixEF</a> () : |
| 60 | <a name="l00080"></a>00080 <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>() ), <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ( 0 ), <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( 0 ), |
| 61 | <a name="l00081"></a>00081 <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> ( <span class="stringliteral">"{w }"</span>, vec_1 ( 0 ) ),vec ( 0 ) ),<a class="code" href="classMixEF.html#6e630b2fd4cae8aa728ea1322708c8f0" title="Flag for a method that is used in the inference.">method</a>(QB) {<a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1" title="Auxiliary function for use in constructors.">build_est</a>();} |
| 62 | <a name="l00083"></a><a class="code" href="classMixEF.html#5f4880febf28803471694d87eab81ec4">00083</a> <a class="code" href="classMixEF.html#51fa3e3953c0af69f4e0162829d7929d" title="Constructor of empty mixture.">MixEF</a>(<span class="keyword">const</span> <a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a> &M2): <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a> ( <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>() ), <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ( M2.<a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ), <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( <a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a> ), |
| 63 | <a name="l00084"></a>00084 <a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a> ( M2.<a class="code" href="classMixEF.html#d906782a0a9558f19150dc69411f717f" title="Statistics for weights.">weights</a> ), <a class="code" href="classMixEF.html#6e630b2fd4cae8aa728ea1322708c8f0" title="Flag for a method that is used in the inference.">method</a>(M2.<a class="code" href="classMixEF.html#6e630b2fd4cae8aa728ea1322708c8f0" title="Flag for a method that is used in the inference.">method</a>) { |
| 64 | <a name="l00085"></a>00085 <span class="comment">// it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" );</span> |
| 65 | <a name="l00086"></a>00086 |
| 66 | <a name="l00087"></a>00087 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>;i++ ) {<a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i ) = M2.<a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i )->_copy_();} |
| 67 | <a name="l00088"></a>00088 <a class="code" href="classMixEF.html#5ae381b3a7dfbe2c1e5bb579a5d9b9d1" title="Auxiliary function for use in constructors.">build_est</a>(); |
| 68 | <a name="l00089"></a>00089 } |
| 69 | <a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#73a782d2f464c830bbdbb03d34c6d63e">init</a> ( <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a>* Com0, <span class="keyword">const</span> mat &Data, <span class="keywordtype">int</span> c=5 ); |
| 70 | <a name="l00095"></a>00095 <span class="comment">//Destructor</span> |
| 71 | <a name="l00096"></a>00096 ~<a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>() { |
| 72 | <a name="l00097"></a>00097 <span class="keyword">delete</span> <a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a>; |
| 73 | <a name="l00098"></a>00098 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classMixEF.html#e9cc9bb3e6da801455cec99a59aea149" title="Number of components.">n</a>;i++ ) {<span class="keyword">delete</span> <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a> ( i );} |
| 74 | <a name="l00099"></a>00099 } |
| 75 | <a name="l00101"></a>00101 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#d520fb534aa43f3084ff1568ffe7573d" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> vec &dt ); |
| 76 | <a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#d520fb534aa43f3084ff1568ffe7573d" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> mat &dt ); |
| 77 | <a name="l00104"></a>00104 <span class="keywordtype">void</span> bayesB ( <span class="keyword">const</span> mat &dt, <span class="keyword">const</span> vec &wData ); |
| 78 | <a name="l00105"></a>00105 <span class="keywordtype">double</span> <a class="code" href="classMixEF.html#424ca64f36d4e41de7a7e7ae921d35ea">logpred</a> ( <span class="keyword">const</span> vec &dt ) <span class="keyword">const</span>; |
| 79 | <a name="l00106"></a><a class="code" href="classMixEF.html#efb3e20c2151d91c4fc080b7722a2069">00106</a> <span class="keyword">const</span> <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>& <a class="code" href="classMixEF.html#efb3e20c2151d91c4fc080b7722a2069" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> *<a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a>;} |
| 80 | <a name="l00107"></a><a class="code" href="classMixEF.html#324c2f0f7f9a9ee123073c15aeb8d0c1">00107</a> <span class="keyword">const</span> <a class="code" href="classeprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a>* <a class="code" href="classMixEF.html#324c2f0f7f9a9ee123073c15aeb8d0c1" title="Returns a pointer to the epdf representing posterior density on parameters. Use with...">_e</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classMixEF.html#33968f1325137cc6f4431f0cf05096dc" title="Posterior on component parameters.">est</a>;} |
| 81 | <a name="l00108"></a>00108 <a class="code" href="classemix.html" title="Mixture of epdfs.">emix</a>* <a class="code" href="classMixEF.html#4d5b5c25280a50df1edfa2c03540d0ac" title="Constructs a predictive density (marginal density on data).">predictor</a>(<span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &<a class="code" href="classBM.html#af00f0612fabe66241dd507188cdbf88" title="Random variable of the posterior.">rv</a>) <span class="keyword">const</span>; |
| 82 | <a name="l00110"></a>00110 <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#7d4d571688a15cc5be10f6f48bfc433d" title="Flatten the density as if it was not estimated from the data.">flatten</a>(<span class="keyword">const</span> <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a>* M2); |
| 83 | <a name="l00112"></a><a class="code" href="classMixEF.html#959d9b078766e251a3089b501ed78513">00112</a> <a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a>* <a class="code" href="classMixEF.html#959d9b078766e251a3089b501ed78513" title="Access function.">_Coms</a>(<span class="keywordtype">int</span> i){<span class="keywordflow">return</span> <a class="code" href="classMixEF.html#4c4a140ca4e6e71b00237b7bc754302e" title="Models for Components of .">Coms</a>(i);} |
| 84 | <a name="l00113"></a>00113 |
| 85 | <a name="l00115"></a><a class="code" href="classMixEF.html#6576024e16523da5cbaaf233512c53dc">00115</a> <span class="keywordtype">void</span> <a class="code" href="classMixEF.html#6576024e16523da5cbaaf233512c53dc" title="Set which method is to be used.">set_method</a>(MixEF_METHOD M){<a class="code" href="classMixEF.html#6e630b2fd4cae8aa728ea1322708c8f0" title="Flag for a method that is used in the inference.">method</a>=M;} |
| 86 | <a name="l00116"></a>00116 }; |
| 87 | <a name="l00117"></a>00117 |
| 88 | <a name="l00118"></a>00118 |
| 89 | <a name="l00119"></a>00119 <span class="preprocessor">#endif // MEF_H</span> |
| 90 | <a name="l00120"></a>00120 <span class="preprocessor"></span> |
| 91 | <a name="l00121"></a>00121 |