30 | | <a name="l00031"></a><a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f">00031</a> <a class="code" href="classMixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a> <a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f" title="Internal mixture of EF models.">Mix</a>; |
31 | | <a name="l00033"></a><a class="code" href="classmerger.html#01e222f5df660e1b25c712e82da8df8f">00033</a> Array<datalink_m2e*> <a class="code" href="classmerger.html#01e222f5df660e1b25c712e82da8df8f" title="Data link for each mpdf in mpdfs.">dls</a>; |
32 | | <a name="l00035"></a><a class="code" href="classmerger.html#e741e6096a7acec3dfa477efa1d8160e">00035</a> Array<RV> <a class="code" href="classmerger.html#e741e6096a7acec3dfa477efa1d8160e" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a>; |
33 | | <a name="l00037"></a><a class="code" href="classmerger.html#d0ff2953f904f12a355f72f51813ca7a">00037</a> Array<datalink_m2e*> <a class="code" href="classmerger.html#d0ff2953f904f12a355f72f51813ca7a" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a>; |
| 30 | <a name="l00031"></a><a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81">00031</a> <a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>; |
| 31 | <a name="l00033"></a><a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c">00033</a> Array<datalink_m2e*> <a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a>; |
| 32 | <a name="l00035"></a><a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703">00035</a> Array<RV> <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a>; |
| 33 | <a name="l00037"></a><a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193">00037</a> Array<datalink_m2e*> <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a>; |
35 | | <a name="l00040"></a><a class="code" href="classmerger.html#ce84de1824875b4262eefb640e8c6d69">00040</a> <span class="keywordtype">int</span> <a class="code" href="classmerger.html#ce84de1824875b4262eefb640e8c6d69" title="Number of samples used in approximation.">Ns</a>; |
36 | | <a name="l00042"></a><a class="code" href="classmerger.html#6acf33e1c64aaaee20689725e8110f65">00042</a> <span class="keywordtype">int</span> <a class="code" href="classmerger.html#6acf33e1c64aaaee20689725e8110f65" title="Number of components in a mixture.">Nc</a>; |
37 | | <a name="l00044"></a><a class="code" href="classmerger.html#e68a72e2740007ae68545e378c7701ad">00044</a> <span class="keywordtype">double</span> <a class="code" href="classmerger.html#e68a72e2740007ae68545e378c7701ad" title="Prior on the log-normal merging model.">beta</a>; |
38 | | <a name="l00046"></a><a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801">00046</a> <a class="code" href="classeEmp.html" title="Weighted empirical density.">eEmp</a> <a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801" title="Projection to empirical density.">eSmp</a>; |
| 35 | <a name="l00040"></a><a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109">00040</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>; |
| 36 | <a name="l00042"></a><a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d">00042</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d" title="Number of components in a mixture.">Nc</a>; |
| 37 | <a name="l00044"></a><a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d">00044</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d" title="Prior on the log-normal merging model.">beta</a>; |
| 38 | <a name="l00046"></a><a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94">00046</a> <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a> <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>; |
41 | | <a name="l00050"></a><a class="code" href="classmerger.html#3f9a955329eab65026e8322e9027d469">00050</a> <a class="code" href="classmerger.html#3f9a955329eab65026e8322e9027d469" title="Default constructor.">merger</a> ( <span class="keyword">const</span> Array<mpdf*> &S ) : |
42 | | <a name="l00051"></a>00051 <a class="code" href="classcompositepdf.html" title="Abstract composition of pdfs, a base for specific classes this abstract class is...">compositepdf</a> ( S ), <a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( <a class="code" href="classcompositepdf.html#635d219fb3e32852400d6f98aa4bdc93" title="find common rv, flag">getrv</a> ( false ) ), |
43 | | <a name="l00052"></a>00052 <a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f" title="Internal mixture of EF models.">Mix</a> ( Array<<a class="code" href="classBMEF.html" title="Estimator for Exponential family.">BMEF</a>*> ( 0 ),vec ( 0 ) ), <a class="code" href="classmerger.html#01e222f5df660e1b25c712e82da8df8f" title="Data link for each mpdf in mpdfs.">dls</a> ( <a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classmerger.html#e741e6096a7acec3dfa477efa1d8160e" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( <a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classmerger.html#d0ff2953f904f12a355f72f51813ca7a" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( <a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801" title="Projection to empirical density.">eSmp</a>(<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>,0) { |
44 | | <a name="l00053"></a>00053 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> ztmp; |
| 41 | <a name="l00050"></a><a class="code" href="classbdm_1_1merger.html#30ae0fa8a88737185f598bf63fec0569">00050</a> <a class="code" href="classbdm_1_1merger.html#30ae0fa8a88737185f598bf63fec0569" title="Default constructor.">merger</a> ( <span class="keyword">const</span> Array<mpdf*> &S ) : |
| 42 | <a name="l00051"></a>00051 <a class="code" href="classbdm_1_1compositepdf.html" title="Abstract composition of pdfs, a base for specific classes this abstract class is...">compositepdf</a> ( S ), <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( <a class="code" href="classbdm_1_1compositepdf.html#c73d39acc4378eee6a63155c3517d3c9" title="find common rv, flag">getrv</a> ( false ) ), |
| 43 | <a name="l00052"></a>00052 <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a> ( Array<<a class="code" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family.">BMEF</a>*> ( 0 ),vec ( 0 ) ), <a class="code" href="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" title="Data link for each mpdf in mpdfs.">dls</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>(<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>,0) { |
| 44 | <a name="l00053"></a>00053 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> ztmp; |
46 | | <a name="l00055"></a>00055 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvc; <a class="code" href="classcompositepdf.html#5a4479785c1fdb2cc351fbea07b899ac" title="common rvc of all mpdfs is written to rvc">setrvc</a> ( <a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>,rvc ); |
47 | | <a name="l00056"></a>00056 <a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>.<a class="code" href="classRV.html#935790526b630dec4ffefa9ec0c2b6fb" title="Add (concat) another variable to the current one,.">add</a> ( rvc ); |
48 | | <a name="l00057"></a>00057 <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++ ) { |
| 46 | <a name="l00055"></a>00055 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvc; <a class="code" href="classbdm_1_1compositepdf.html#c71fc2c51f49d797e61f479f543c75ce" title="common rvc of all mpdfs is written to rvc">setrvc</a> ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>,rvc ); |
| 47 | <a name="l00056"></a>00056 <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( rvc ); |
| 48 | <a name="l00057"></a>00057 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a>;i++ ) { |
52 | | <a name="l00061"></a>00061 ztmp= <a class="code" href="classcompositepdf.html#637877061b917a16a0421bb5c4cd480d" title="Elements of composition.">mpdfs</a> ( i )->_rv(); |
53 | | <a name="l00062"></a>00062 ztmp.<a class="code" href="classRV.html#935790526b630dec4ffefa9ec0c2b6fb" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classcompositepdf.html#637877061b917a16a0421bb5c4cd480d" title="Elements of composition.">mpdfs</a> ( i )->_rvc() ); |
54 | | <a name="l00063"></a>00063 <a class="code" href="classmerger.html#e741e6096a7acec3dfa477efa1d8160e" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ) =<a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a>.<a class="code" href="classRV.html#b9d175c327c21488b1e2fb756a84e149" title="Subtract another variable from the current one.">subt</a> ( ztmp ); |
55 | | <a name="l00064"></a>00064 <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 ) = <span class="keyword">new</span> <a class="code" href="classdatalink__m2e.html" title="data link between">datalink_m2e</a> ( <a class="code" href="classmerger.html#e741e6096a7acec3dfa477efa1d8160e" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ), ztmp, <a class="code" href="classepdf.html#74da992e3f5d598da8850b646b79b9d9" title="Identified of the random variable.">rv</a> ) ; |
| 52 | <a name="l00061"></a>00061 ztmp= <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )->_rv(); |
| 53 | <a name="l00062"></a>00062 ztmp.<a class="code" href="classbdm_1_1RV.html#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classbdm_1_1compositepdf.html#23faf2debc4dde10836393b8c665914a" title="Elements of composition.">mpdfs</a> ( i )->_rvc() ); |
| 54 | <a name="l00063"></a>00063 <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ) =<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#aec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a> ( ztmp ); |
| 55 | <a name="l00064"></a>00064 <a class="code" href="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i ) = <span class="keyword">new</span> <a class="code" href="classbdm_1_1datalink__m2e.html" title="data link between">datalink_m2e</a> ( <a class="code" href="classbdm_1_1merger.html#135b938f841cb88ad00a8bbded818703" title="Array of rvs that are not modelled by mpdfs at all (aux).">rvzs</a> ( i ), ztmp, <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a> ) ; |
58 | | <a name="l00067"></a>00067 <a class="code" href="classmerger.html#e68a72e2740007ae68545e378c7701ad" title="Prior on the log-normal merging model.">beta</a>=2.0; |
59 | | <a name="l00068"></a>00068 <a class="code" href="classmerger.html#ce84de1824875b4262eefb640e8c6d69" title="Number of samples used in approximation.">Ns</a>=100; |
60 | | <a name="l00069"></a>00069 <a class="code" href="classmerger.html#6acf33e1c64aaaee20689725e8110f65" title="Number of components in a mixture.">Nc</a>=10; |
61 | | <a name="l00070"></a>00070 <a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classMixEF.html#6576024e16523da5cbaaf233512c53dc" title="Set which method is to be used.">set_method</a> ( EM ); |
| 58 | <a name="l00067"></a>00067 <a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d" title="Prior on the log-normal merging model.">beta</a>=2.0; |
| 59 | <a name="l00068"></a>00068 <a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>=100; |
| 60 | <a name="l00069"></a>00069 <a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d" title="Number of components in a mixture.">Nc</a>=10; |
| 61 | <a name="l00070"></a>00070 <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#664529d52cc667383b39eeb440ccd577" title="Set which method is to be used.">set_method</a> ( EM ); |
63 | | <a name="l00073"></a><a class="code" href="classmerger.html#79420e251308df4502c834171d518ad9">00073</a> <span class="keywordtype">void</span> <a class="code" href="classmerger.html#79420e251308df4502c834171d518ad9" title="Set internal parameters used in approximation.">set_parameters</a> ( <span class="keywordtype">double</span> beta0, <span class="keywordtype">int</span> Ns0, <span class="keywordtype">int</span> Nc0 ) {<a class="code" href="classmerger.html#e68a72e2740007ae68545e378c7701ad" title="Prior on the log-normal merging model.">beta</a>=beta0;<a class="code" href="classmerger.html#ce84de1824875b4262eefb640e8c6d69" title="Number of samples used in approximation.">Ns</a>=Ns0;<a class="code" href="classmerger.html#6acf33e1c64aaaee20689725e8110f65" title="Number of components in a mixture.">Nc</a>=Nc0;<a class="code" href="classmerger.html#b13c9e8921e6bc6b8dd7bbafb54fa801" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classeEmp.html#a4215f6a5a04d07b43f7ebaa942e15f1" title="Set sample.">set_n</a>(Ns0,<span class="keyword">false</span>);} |
64 | | <a name="l00075"></a><a class="code" href="classmerger.html#02d2a445e44a87f37ee3a2b9b40cffd1">00075</a> <span class="keywordtype">void</span> <a class="code" href="classmerger.html#02d2a445e44a87f37ee3a2b9b40cffd1" title="Initialize the proposal density. This function must be called before merge()!">init</a>() { |
65 | | <a name="l00076"></a>00076 Array<vec> Smps ( <a class="code" href="classcompositepdf.html#c1646fe41ff5934d010e54ccaa46133f" title="Number of mpdfs in the composite.">n</a> ); |
| 63 | <a name="l00073"></a><a class="code" href="classbdm_1_1merger.html#bc867c8e2b4709041bf8802ae9c78e37">00073</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#bc867c8e2b4709041bf8802ae9c78e37" title="Set internal parameters used in approximation.">set_parameters</a> ( <span class="keywordtype">double</span> beta0, <span class="keywordtype">int</span> Ns0, <span class="keywordtype">int</span> Nc0 ) {<a class="code" href="classbdm_1_1merger.html#1a85d299f202a70afe0cdc1045c26a5d" title="Prior on the log-normal merging model.">beta</a>=beta0;<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>=Ns0;<a class="code" href="classbdm_1_1merger.html#214ca7c566e8f75d45bb243d7c74580d" title="Number of components in a mixture.">Nc</a>=Nc0;<a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#dccd02eaa4c45e858a6351723686ac85" title="Set sample.">set_n</a>(Ns0,<span class="keyword">false</span>);} |
| 64 | <a name="l00075"></a><a class="code" href="classbdm_1_1merger.html#8ae79a651e93d6e2d611556001af8aa8">00075</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#8ae79a651e93d6e2d611556001af8aa8" title="Initialize the proposal density. This function must be called before merge()!">init</a>() { |
| 65 | <a name="l00076"></a>00076 Array<vec> Smps ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ); |
69 | | <a name="l00081"></a>00081 <span class="keywordtype">void</span> <a class="code" href="classmerger.html#bc23accc77ec766bce7202934e2c180c" title="Create a mixture density, make sure to call init() before the first call.">merge</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>* g0 ); |
70 | | <a name="l00083"></a><a class="code" href="classmerger.html#bc23accc77ec766bce7202934e2c180c">00083</a> <span class="keywordtype">void</span> <a class="code" href="classmerger.html#bc23accc77ec766bce7202934e2c180c" title="Create a mixture density, make sure to call init() before the first call.">merge</a> () {<a class="code" href="classmerger.html#bc23accc77ec766bce7202934e2c180c" title="Create a mixture density, make sure to call init() before the first call.">merge</a> ( & ( <a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classMixEF.html#efb3e20c2151d91c4fc080b7722a2069" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>() ) );}; |
| 69 | <a name="l00081"></a>00081 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* g0 ); |
| 70 | <a name="l00083"></a><a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2">00083</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</a> () {<a class="code" href="classbdm_1_1merger.html#b72f4662c9ac760a8b17ebe5d697f3c2" title="Create a mixture density, make sure to call init() before the first call.">merge</a> ( & ( <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#33d0b3da1d10bf149d41ee74f6284a19" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>() ) );}; |
72 | | <a name="l00086"></a>00086 vec <a class="code" href="classmerger.html#217c65f335c603033fa09a2ecc64bc05" title="Merge log-likelihood values.">lognorm_merge</a> ( mat &lW ); |
73 | | <a name="l00089"></a><a class="code" href="classmerger.html#379198c3d2063bfa63f5d1245a2511ba">00089</a> vec <a class="code" href="classmerger.html#379198c3d2063bfa63f5d1245a2511ba">sample</a> ( )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classmerger.html#021d1522cea70db8545d708afd32ec2f" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classMixEF.html#efb3e20c2151d91c4fc080b7722a2069" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>().<a class="code" href="classepdf.html#8019654e494bf5e458f6fb947e11b262" title="Returns a sample, from density .">sample</a>();} |
74 | | <a name="l00090"></a><a class="code" href="classmerger.html#632cd7e0bcd149c0dc85042063364f6b">00090</a> <span class="keywordtype">double</span> <a class="code" href="classmerger.html#632cd7e0bcd149c0dc85042063364f6b" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &dt )<span class="keyword"> const </span>{ |
| 72 | <a name="l00086"></a>00086 vec <a class="code" href="classbdm_1_1merger.html#b90f1b8a21a693176dd953a3b983aa0b" title="Merge log-likelihood values.">lognorm_merge</a> ( mat &lW ); |
| 73 | <a name="l00089"></a><a class="code" href="classbdm_1_1merger.html#0ef73e76eeee44c8e3896e3a271ad974">00089</a> vec <a class="code" href="classbdm_1_1merger.html#0ef73e76eeee44c8e3896e3a271ad974">sample</a> ( )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>.<a class="code" href="classbdm_1_1MixEF.html#33d0b3da1d10bf149d41ee74f6284a19" title="Returns a reference to the epdf representing posterior density on parameters.">_epdf</a>().<a class="code" href="classbdm_1_1epdf.html#09721eb148bc49d6ec2f1956039f3a10" title="Returns a sample, from density .">sample</a>();} |
| 74 | <a name="l00090"></a><a class="code" href="classbdm_1_1merger.html#c47543661897638cab9f506c76a1f92f">00090</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1merger.html#c47543661897638cab9f506c76a1f92f" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &dt )<span class="keyword"> const </span>{ |
79 | | <a name="l00095"></a><a class="code" href="classmerger.html#3a46999cd77047d5d4ac6c1cb735a83e">00095</a> vec <a class="code" href="classmerger.html#3a46999cd77047d5d4ac6c1cb735a83e" title="return expected value">mean</a>()<span class="keyword"> const </span>{ |
80 | | <a name="l00096"></a>00096 <span class="keyword">const</span> Vec<double> &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>(); |
81 | | <a name="l00097"></a>00097 <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>(); |
82 | | <a name="l00098"></a>00098 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>() ); |
83 | | <a name="l00099"></a>00099 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i<<a class="code" href="classmerger.html#ce84de1824875b4262eefb640e8c6d69" title="Number of samples used in approximation.">Ns</a>; i++ ) { |
| 79 | <a name="l00095"></a><a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5">00095</a> vec <a class="code" href="classbdm_1_1merger.html#82c5ad7677315fde8e9fc9381c17ece5" title="return expected value">mean</a>()<span class="keyword"> const </span>{ |
| 80 | <a name="l00096"></a>00096 <span class="keyword">const</span> Vec<double> &w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>(); |
| 81 | <a name="l00097"></a>00097 <span class="keyword">const</span> Array<vec> &S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>(); |
| 82 | <a name="l00098"></a>00098 vec tmp=zeros ( <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>() ); |
| 83 | <a name="l00099"></a>00099 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i<<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>; i++ ) { |
89 | | <a name="l00105"></a>00105 <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>(); |
90 | | <a name="l00106"></a>00106 <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>(); |
| 89 | <a name="l00105"></a>00105 <span class="keyword">const</span> vec &w = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" title="Potentially dangerous, use with care.">_w</a>(); |
| 90 | <a name="l00106"></a>00106 <span class="keyword">const</span> Array<vec> &S = <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>(); |
96 | | <a name="l00112"></a>00112 mat 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>(), <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>()); |
97 | | <a name="l00113"></a>00113 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i<<a class="code" href="classmerger.html#ce84de1824875b4262eefb640e8c6d69" title="Number of samples used in approximation.">Ns</a>; i++ ) { |
| 96 | <a name="l00112"></a>00112 mat Tmp=zeros(<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>(), <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Identified of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>()); |
| 97 | <a name="l00113"></a>00113 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0; i<<a class="code" href="classbdm_1_1merger.html#e91b83e6d9076848c71ae27664072109" title="Number of samples used in approximation.">Ns</a>; i++ ) { |
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>(); |
| 102 | <a name="l00118"></a><a class="code" href="classbdm_1_1merger.html#bcef70ece256b1ab1fa7a3a354eb1cc4">00118</a> vec <a class="code" href="classbdm_1_1merger.html#bcef70ece256b1ab1fa7a3a354eb1cc4" 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="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#d7f83cc0415cd44ae7cc8b4bdad93aef" 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="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>.<a class="code" href="classbdm_1_1eEmp.html#c24966b0aaeb767bc8a6b4fd60931be2" title="access function">_samples</a>(); |
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 ); |
| 112 | <a name="l00129"></a><a class="code" href="classbdm_1_1merger.html#febef179bb5e074ae6e34d15b4596273">00129</a> <span class="keyword">virtual</span> <a class="code" href="classbdm_1_1merger.html#febef179bb5e074ae6e34d15b4596273" 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="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" 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="classbdm_1_1merger.html#ea3c9f4739f857877fd5285b3973289c" 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="classbdm_1_1merger.html#6c48bf36ec1f3f7b52e3159cf428a193" title="Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs.">zdls</a> ( i ); |
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>;} |
| 119 | <a name="l00137"></a><a class="code" href="classbdm_1_1merger.html#13f8534f626a37bed91a6d9db54d6d2f">00137</a> <a class="code" href="classbdm_1_1MixEF.html" title="Mixture of Exponential Family Densities.">MixEF</a>& <a class="code" href="classbdm_1_1merger.html#13f8534f626a37bed91a6d9db54d6d2f" title="Access function.">_Mix</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#67ae71cbf0686d7c7bf116fa5db86d81" title="Internal mixture of EF models.">Mix</a>;} |
| 120 | <a name="l00139"></a><a class="code" href="classbdm_1_1merger.html#23f5f8b80df579b05681006fbcfe3699">00139</a> <a class="code" href="classbdm_1_1eEmp.html" title="Weighted empirical density.">eEmp</a>& <a class="code" href="classbdm_1_1merger.html#23f5f8b80df579b05681006fbcfe3699" title="Access function.">_Smp</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1merger.html#522d43f7aa13fe6701e93fba174dec94" title="Projection to empirical density.">eSmp</a>;} |