102 | | <a name="l00119"></a><a class="code" href="classmerger.html#51e425ee1dd46d73353526e6a1c24ca3">00119</a> <span class="keyword">virtual</span> <a class="code" href="classmerger.html#51e425ee1dd46d73353526e6a1c24ca3" title="for future use">~merger</a>() { |
103 | | <a name="l00120"></a>00120 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i<<a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a>; i++ ) { |
104 | | <a name="l00121"></a>00121 <span class="keyword">delete</span> <a class="code" href="classmerger.html#01e222f5df660e1b25c712e82da8df8f" title="Data link for each mpdf in mpdfs.">dls</a> ( i ); |
105 | | <a name="l00122"></a>00122 <span class="keyword">delete</span> <a class="code" href="classmerger.html#d0ff2953f904f12a355f72f51813ca7a" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i ); |
106 | | <a name="l00123"></a>00123 } |
107 | | <a name="l00124"></a>00124 }; |
108 | | <a name="l00125"></a>00125 |
109 | | <a name="l00127"></a><a class="code" href="classmerger.html#6e430acd4eb7eea6078df0eb0a429821">00127</a> <a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>& <a class="code" href="classmerger.html#6e430acd4eb7eea6078df0eb0a429821" title="Access function.">_Mix</a>() {<span class="keywordflow">return</span> <a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f" title="Internal mixture of EF models.">Mix</a>;} |
110 | | <a name="l00129"></a><a class="code" href="classmerger.html#f79677063ec72cdc175280a3fae8ebc2">00129</a> <a class="code" href="classeEmp.html" title="Weighted empirical density.">eEmp</a>& <a class="code" href="classmerger.html#f79677063ec72cdc175280a3fae8ebc2" title="Access function.">_Smp</a>() {<span class="keywordflow">return</span> <a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801" title="Projection to empirical density.">eSmp</a>;} |
111 | | <a name="l00130"></a>00130 }; |
112 | | <a name="l00131"></a>00131 |
113 | | <a name="l00132"></a>00132 |
114 | | <a name="l00133"></a>00133 |
115 | | <a name="l00134"></a>00134 <span class="preprocessor">#endif // MER_H</span> |
| 102 | <a name="l00118"></a><a class="code" href="classmerger.html#d6481bfb85df3c3773cee6c83687790a">00118</a> vec <a class="code" href="classmerger.html#d6481bfb85df3c3773cee6c83687790a" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{ |
| 103 | <a name="l00119"></a>00119 <span class="keyword">const</span> vec &w = <a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classeEmp.html#31b2bfb73b72486a5c89f2ab850c7a9b" title="Potentially dangerous, use with care.">_w</a>(); |
| 104 | <a name="l00120"></a>00120 <span class="keyword">const</span> Array<vec> &S = <a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classeEmp.html#31b747eca73b16f30370827ba4cc3575" title="access function">_samples</a>(); |
| 105 | <a name="l00121"></a>00121 |
| 106 | <a name="l00122"></a>00122 vec tmp=zeros(<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>.<a class="code" href="classRV.html#f5c7b8bd589eef09ccdf3329a0addea0" title="Return number of scalars in the RV.">count</a>()); |
| 107 | <a name="l00123"></a>00123 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i<Ns; i++ ) { |
| 108 | <a name="l00124"></a>00124 tmp+=w ( i ) *pow(S ( i ),2); |
| 109 | <a name="l00125"></a>00125 } |
| 110 | <a name="l00126"></a>00126 <span class="keywordflow">return</span> tmp-pow(<a class="code" href="classmerger.html#3a46999cd77047d5d4ac6c1cb735a83e" title="return expected value">mean</a>(),2); |
| 111 | <a name="l00127"></a>00127 } |
| 112 | <a name="l00129"></a><a class="code" href="classmerger.html#51e425ee1dd46d73353526e6a1c24ca3">00129</a> <span class="keyword">virtual</span> <a class="code" href="classmerger.html#51e425ee1dd46d73353526e6a1c24ca3" title="for future use">~merger</a>() { |
| 113 | <a name="l00130"></a>00130 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i<<a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a>; i++ ) { |
| 114 | <a name="l00131"></a>00131 <span class="keyword">delete</span> <a class="code" href="classmerger.html#01e222f5df660e1b25c712e82da8df8f" title="Data link for each mpdf in mpdfs.">dls</a> ( i ); |
| 115 | <a name="l00132"></a>00132 <span class="keyword">delete</span> <a class="code" href="classmerger.html#d0ff2953f904f12a355f72f51813ca7a" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i ); |
| 116 | <a name="l00133"></a>00133 } |
| 117 | <a name="l00134"></a>00134 }; |
| 118 | <a name="l00135"></a>00135 |
| 119 | <a name="l00137"></a><a class="code" href="classmerger.html#6e430acd4eb7eea6078df0eb0a429821">00137</a> <a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>& <a class="code" href="classmerger.html#6e430acd4eb7eea6078df0eb0a429821" title="Access function.">_Mix</a>() {<span class="keywordflow">return</span> <a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f" title="Internal mixture of EF models.">Mix</a>;} |
| 120 | <a name="l00139"></a><a class="code" href="classmerger.html#f79677063ec72cdc175280a3fae8ebc2">00139</a> <a class="code" href="classeEmp.html" title="Weighted empirical density.">eEmp</a>& <a class="code" href="classmerger.html#f79677063ec72cdc175280a3fae8ebc2" title="Access function.">_Smp</a>() {<span class="keywordflow">return</span> <a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801" title="Projection to empirical density.">eSmp</a>;} |
| 121 | <a name="l00140"></a>00140 }; |
| 122 | <a name="l00141"></a>00141 |
| 123 | <a name="l00142"></a>00142 |
| 124 | <a name="l00143"></a>00143 |
| 125 | <a name="l00144"></a>00144 <span class="preprocessor">#endif // MER_H</span> |