82 | | <a name="l00058"></a>00058 Array<const epdf*> epdfs ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>+1 ); |
83 | | <a name="l00059"></a>00059 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a>.length();i++ ) { |
84 | | <a name="l00060"></a>00060 <span class="comment">// it_assert_debug(!x,"MixEF::MixEF : Incompatible components");</span> |
85 | | <a name="l00061"></a>00061 epdfs ( i ) =& ( <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i )->posterior() ); |
86 | | <a name="l00062"></a>00062 } |
87 | | <a name="l00063"></a>00063 <span class="comment">// last in the product is the weight</span> |
88 | | <a name="l00064"></a>00064 epdfs ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ) =& ( <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a>.<a class="code" href="classbdm_1_1multiBM.html#cd682a9a179e6c42a5d28e71c2a2cbfa">posterior</a>() ); |
89 | | <a name="l00065"></a>00065 <a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a> = <span class="keyword">new</span> <a class="code" href="classbdm_1_1eprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a> ( epdfs ); |
90 | | <a name="l00066"></a>00066 } |
91 | | <a name="l00067"></a>00067 |
92 | | <a name="l00068"></a>00068 <span class="keyword">public</span>: |
93 | | <a name="l00070"></a><a class="code" href="classbdm_1_1MixEF.html#4efe67d414ff34a1e7534004fd061241">00070</a> <a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984" title="Constructor of empty mixture.">MixEF</a> ( <span class="keyword">const</span> Array<BMEF*> &Coms0, <span class="keyword">const</span> vec &alpha0 ) : |
94 | | <a name="l00071"></a>00071 <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ), <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ( Coms0.length() ), <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ), |
95 | | <a name="l00072"></a>00072 <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> (), <a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a>(QB) { |
96 | | <a name="l00073"></a>00073 <span class="comment">// it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" );</span> |
97 | | <a name="l00074"></a>00074 |
98 | | <a name="l00075"></a>00075 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>;i++ ) {<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i ) = ( <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* ) Coms0 ( i )->_copy_();} |
99 | | <a name="l00076"></a>00076 <a class="code" href="classbdm_1_1MixEF.html#d74a8d1370c63c93ec554908ae3e6006" title="Auxiliary function for use in constructors.">build_est</a>(); |
100 | | <a name="l00077"></a>00077 }; |
101 | | <a name="l00079"></a><a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984">00079</a> <a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984" title="Constructor of empty mixture.">MixEF</a> () : |
102 | | <a name="l00080"></a>00080 <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ), <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ( 0 ), <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( 0 ), |
103 | | <a name="l00081"></a>00081 <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> (),<a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a>(QB) {<a class="code" href="classbdm_1_1MixEF.html#d74a8d1370c63c93ec554908ae3e6006" title="Auxiliary function for use in constructors.">build_est</a>();} |
104 | | <a name="l00083"></a><a class="code" href="classbdm_1_1MixEF.html#9577de85c3e3481f7c0e23cf8f87c482">00083</a> <a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984" title="Constructor of empty mixture.">MixEF</a>(<span class="keyword">const</span> <a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a> &M2): <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ), <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ( M2.<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ), <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ), |
105 | | <a name="l00084"></a>00084 <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> ( M2.<a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> ), <a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a>(M2.<a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a>) { |
106 | | <a name="l00085"></a>00085 <span class="comment">// it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" );</span> |
107 | | <a name="l00086"></a>00086 |
108 | | <a name="l00087"></a>00087 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>;i++ ) {<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i ) = M2.<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i )->_copy_();} |
109 | | <a name="l00088"></a>00088 <a class="code" href="classbdm_1_1MixEF.html#d74a8d1370c63c93ec554908ae3e6006" title="Auxiliary function for use in constructors.">build_est</a>(); |
110 | | <a name="l00089"></a>00089 } |
111 | | <a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#0c2a50789b30769964a909d217125ed2">init</a> ( <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* Com0, <span class="keyword">const</span> mat &Data, <span class="keywordtype">int</span> c=5 ); |
112 | | <a name="l00095"></a>00095 <span class="comment">//Destructor</span> |
113 | | <a name="l00096"></a>00096 ~<a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>() { |
114 | | <a name="l00097"></a>00097 <span class="keyword">delete</span> <a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a>; |
115 | | <a name="l00098"></a>00098 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>;i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i );} |
116 | | <a name="l00099"></a>00099 } |
117 | | <a name="l00101"></a>00101 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#5bd7da667da183eed1577f11dff0c1f1" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> vec &dt ); |
118 | | <a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#5bd7da667da183eed1577f11dff0c1f1" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> mat &dt ); |
119 | | <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 ); |
120 | | <a name="l00105"></a>00105 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1MixEF.html#da724da464a75e07521941e430929efa">logpred</a> ( <span class="keyword">const</span> vec &dt ) <span class="keyword">const</span>; |
121 | | <a name="l00106"></a>00106 <span class="keyword">const</span> epdf& posterior()<span class="keyword"> const </span>{<span class="keywordflow">return</span> *<a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a>;} |
122 | | <a name="l00107"></a>00107 <span class="keyword">const</span> eprod* _e()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a>;} |
123 | | <a name="l00108"></a>00108 emix* <a class="code" href="classbdm_1_1MixEF.html#edc50e9640f049b846084748b18469a2" title="Constructs a predictive density .">epredictor</a>() <span class="keyword">const</span>; |
124 | | <a name="l00110"></a>00110 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#f0dfb4375fef4e61c4cb062e5bac7c8c" title="Flatten the density as if it was not estimated from the data.">flatten</a>(<span class="keyword">const</span> <a class="code" href="classbdm_1_1BMEF.html#2def512872ed8a4fc3b702371ec0be55" title="Default constructor (=empty constructor).">BMEF</a>* M2); |
125 | | <a name="l00112"></a><a class="code" href="classbdm_1_1MixEF.html#251ef6fc51757712693da5faae5317c9">00112</a> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* <a class="code" href="classbdm_1_1MixEF.html#251ef6fc51757712693da5faae5317c9" title="Access function.">_Coms</a>(<span class="keywordtype">int</span> i){<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a>(i);} |
126 | | <a name="l00113"></a>00113 |
127 | | <a name="l00115"></a><a class="code" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577">00115</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577" title="Set which method is to be used.">set_method</a>(MixEF_METHOD M){<a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a>=M;} |
128 | | <a name="l00116"></a>00116 }; |
129 | | <a name="l00117"></a>00117 |
130 | | <a name="l00118"></a>00118 } |
131 | | <a name="l00119"></a>00119 <span class="preprocessor">#endif // MEF_H</span> |
132 | | <a name="l00120"></a>00120 <span class="preprocessor"></span> |
133 | | <a name="l00121"></a>00121 |
| 88 | <a name="l00058"></a>00058 <a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a> = <span class="keyword">new</span> <a class="code" href="classbdm_1_1eprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a>; |
| 89 | <a name="l00059"></a>00059 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>>0 ) { |
| 90 | <a name="l00060"></a>00060 Array<const epdf*> epdfs ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>+1 ); |
| 91 | <a name="l00061"></a>00061 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a>.length();i++ ) { |
| 92 | <a name="l00062"></a>00062 <span class="comment">// it_assert_debug(!x,"MixEF::MixEF : Incompatible components");</span> |
| 93 | <a name="l00063"></a>00063 epdfs ( i ) =& ( <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i )->posterior() ); |
| 94 | <a name="l00064"></a>00064 } |
| 95 | <a name="l00065"></a>00065 <span class="comment">// last in the product is the weight</span> |
| 96 | <a name="l00066"></a>00066 epdfs ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ) =& ( <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a>.<a class="code" href="classbdm_1_1multiBM.html#cd682a9a179e6c42a5d28e71c2a2cbfa">posterior</a>() ); |
| 97 | <a name="l00067"></a>00067 <a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a>-><a class="code" href="classbdm_1_1eprod.html#7f0f526ddcd028c5edaecf250ef780f6">set_parameters</a> ( epdfs, <span class="keyword">false</span> ); |
| 98 | <a name="l00068"></a>00068 } |
| 99 | <a name="l00069"></a>00069 } |
| 100 | <a name="l00070"></a>00070 |
| 101 | <a name="l00071"></a>00071 <span class="keyword">public</span>: |
| 102 | <a name="l00073"></a><a class="code" href="classbdm_1_1MixEF.html#4efe67d414ff34a1e7534004fd061241">00073</a> <a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984" title="Constructor of empty mixture.">MixEF</a> ( <span class="keyword">const</span> Array<BMEF*> &Coms0, <span class="keyword">const</span> vec &alpha0 ) : |
| 103 | <a name="l00074"></a>00074 <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ), <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ( Coms0.length() ), <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ), |
| 104 | <a name="l00075"></a>00075 <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> (), <a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a> ( QB ) { |
| 105 | <a name="l00076"></a>00076 <span class="comment">// it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" );</span> |
| 106 | <a name="l00077"></a>00077 |
| 107 | <a name="l00078"></a>00078 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>;i++ ) {<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i ) = ( <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* ) Coms0 ( i )->_copy_();} |
| 108 | <a name="l00079"></a>00079 <a class="code" href="classbdm_1_1MixEF.html#d74a8d1370c63c93ec554908ae3e6006" title="Auxiliary function for use in constructors.">build_est</a>(); |
| 109 | <a name="l00080"></a>00080 }; |
| 110 | <a name="l00082"></a><a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984">00082</a> <a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984" title="Constructor of empty mixture.">MixEF</a> () : |
| 111 | <a name="l00083"></a>00083 <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ), <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ( 0 ), <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( 0 ), |
| 112 | <a name="l00084"></a>00084 <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> (),<a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a> ( QB ) {<a class="code" href="classbdm_1_1MixEF.html#d74a8d1370c63c93ec554908ae3e6006" title="Auxiliary function for use in constructors.">build_est</a>();} |
| 113 | <a name="l00086"></a><a class="code" href="classbdm_1_1MixEF.html#9577de85c3e3481f7c0e23cf8f87c482">00086</a> <a class="code" href="classbdm_1_1MixEF.html#0266854387338ba757e6192d62907984" title="Constructor of empty mixture.">MixEF</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a> &M2 ) : <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a> ( ), <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ( M2.<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ), <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( <a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a> ), |
| 114 | <a name="l00087"></a>00087 <a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> ( M2.<a class="code" href="classbdm_1_1MixEF.html#e39faa70cebadc3296bd249040105e86" title="Statistics for weights.">weights</a> ), <a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a> ( M2.<a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a> ) { |
| 115 | <a name="l00088"></a>00088 <span class="comment">// it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" );</span> |
| 116 | <a name="l00089"></a>00089 |
| 117 | <a name="l00090"></a>00090 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>;i++ ) {<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i ) = M2.<a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i )->_copy_();} |
| 118 | <a name="l00091"></a>00091 <a class="code" href="classbdm_1_1MixEF.html#d74a8d1370c63c93ec554908ae3e6006" title="Auxiliary function for use in constructors.">build_est</a>(); |
| 119 | <a name="l00092"></a>00092 } |
| 120 | <a name="l00097"></a>00097 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#0c2a50789b30769964a909d217125ed2">init</a> ( <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* Com0, <span class="keyword">const</span> mat &Data, <span class="keywordtype">int</span> c=5 ); |
| 121 | <a name="l00098"></a>00098 <span class="comment">//Destructor</span> |
| 122 | <a name="l00099"></a>00099 ~<a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>() { |
| 123 | <a name="l00100"></a>00100 <span class="keyword">delete</span> <a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a>; |
| 124 | <a name="l00101"></a>00101 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1MixEF.html#38ca1d86e977d1c38810a3c95bf074a5" title="Number of components.">n</a>;i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i );} |
| 125 | <a name="l00102"></a>00102 } |
| 126 | <a name="l00104"></a>00104 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#5bd7da667da183eed1577f11dff0c1f1" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> vec &dt ); |
| 127 | <a name="l00106"></a>00106 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#5bd7da667da183eed1577f11dff0c1f1" title="Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.">bayes</a> ( <span class="keyword">const</span> mat &dt ); |
| 128 | <a name="l00107"></a>00107 <span class="keywordtype">void</span> bayesB ( <span class="keyword">const</span> mat &dt, <span class="keyword">const</span> vec &wData ); |
| 129 | <a name="l00108"></a>00108 <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1MixEF.html#da724da464a75e07521941e430929efa">logpred</a> ( <span class="keyword">const</span> vec &dt ) <span class="keyword">const</span>; |
| 130 | <a name="l00109"></a>00109 <span class="keyword">const</span> epdf& posterior()<span class="keyword"> const </span>{<span class="keywordflow">return</span> *<a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a>;} |
| 131 | <a name="l00110"></a>00110 <span class="keyword">const</span> eprod* _e()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1MixEF.html#9413fb7f1836237aac807fb9f245e4f6" title="Posterior on component parameters.">est</a>;} |
| 132 | <a name="l00111"></a>00111 emix* <a class="code" href="classbdm_1_1MixEF.html#edc50e9640f049b846084748b18469a2" title="Constructs a predictive density .">epredictor</a>() <span class="keyword">const</span>; |
| 133 | <a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#f0dfb4375fef4e61c4cb062e5bac7c8c" title="Flatten the density as if it was not estimated from the data.">flatten</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1BMEF.html#2def512872ed8a4fc3b702371ec0be55" title="Default constructor (=empty constructor).">BMEF</a>* M2 ); |
| 134 | <a name="l00115"></a><a class="code" href="classbdm_1_1MixEF.html#251ef6fc51757712693da5faae5317c9">00115</a> <a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>* <a class="code" href="classbdm_1_1MixEF.html#251ef6fc51757712693da5faae5317c9" title="Access function.">_Coms</a> ( <span class="keywordtype">int</span> i ) {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1MixEF.html#90c21ab5a2af56d4b49e2eaef6eccc08" title="Models for Components of .">Coms</a> ( i );} |
| 135 | <a name="l00116"></a>00116 |
| 136 | <a name="l00118"></a><a class="code" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577">00118</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577" title="Set which method is to be used.">set_method</a> ( MixEF_METHOD M ) {<a class="code" href="classbdm_1_1MixEF.html#a2376ddadb7573532404452d0c2dd28a" title="Flag for a method that is used in the inference.">method</a>=M;} |
| 137 | <a name="l00119"></a>00119 }; |
| 138 | <a name="l00120"></a>00120 |
| 139 | <a name="l00121"></a>00121 } |
| 140 | <a name="l00122"></a>00122 <span class="preprocessor">#endif // MEF_H</span> |
| 141 | <a name="l00123"></a>00123 <span class="preprocessor"></span> |
| 142 | <a name="l00124"></a>00124 |