1 | <?xml version='1.0' encoding='UTF-8' standalone='no'?> |
---|
2 | <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6"> |
---|
3 | <compounddef id="libEF_8h" kind="file"> |
---|
4 | <compoundname>libEF.h</compoundname> |
---|
5 | <includes local="no">itpp/itbase.h</includes> |
---|
6 | <includes refid="libDC_8h" local="yes">../math/libDC.h</includes> |
---|
7 | <includes refid="libBM_8h" local="yes">libBM.h</includes> |
---|
8 | <includes refid="itpp__ext_8h" local="yes">../itpp_ext.h</includes> |
---|
9 | <includedby refid="arx_8h" local="yes">work/git/mixpp/bdm/estim/arx.h</includedby> |
---|
10 | <includedby refid="libKF_8h" local="yes">work/git/mixpp/bdm/estim/libKF.h</includedby> |
---|
11 | <includedby refid="libPF_8h" local="yes">work/git/mixpp/bdm/estim/libPF.h</includedby> |
---|
12 | <includedby refid="emix_8h" local="yes">work/git/mixpp/bdm/stat/emix.h</includedby> |
---|
13 | <includedby refid="libEF_8cpp" local="yes">work/git/mixpp/bdm/stat/libEF.cpp</includedby> |
---|
14 | <includedby refid="merger_8h" local="yes">work/git/mixpp/bdm/stat/merger.h</includedby> |
---|
15 | <includedby refid="merg__pred_8cpp" local="no">work/git/mixpp/mpdm/merg_pred.cpp</includedby> |
---|
16 | <includedby refid="arx__test_8cpp" local="no">work/git/mixpp/tests/arx_test.cpp</includedby> |
---|
17 | <includedby refid="merger__test_8cpp" local="no">work/git/mixpp/tests/merger_test.cpp</includedby> |
---|
18 | <includedby refid="testEpdf_8cpp" local="no">work/git/mixpp/tests/testEpdf.cpp</includedby> |
---|
19 | <includedby refid="testPF_8cpp" local="no">work/git/mixpp/tests/testPF.cpp</includedby> |
---|
20 | <includedby refid="testResample_8cpp" local="no">work/git/mixpp/tests/testResample.cpp</includedby> |
---|
21 | <includedby refid="testSmp_8cpp" local="no">work/git/mixpp/tests/testSmp.cpp</includedby> |
---|
22 | <incdepgraph> |
---|
23 | <node id="394"> |
---|
24 | <label>libBM.h</label> |
---|
25 | <link refid="libBM_8h"/> |
---|
26 | <childnode refid="392" relation="include"> |
---|
27 | </childnode> |
---|
28 | </node> |
---|
29 | <node id="395"> |
---|
30 | <label>../itpp_ext.h</label> |
---|
31 | <link refid="itpp__ext_8h-source"/> |
---|
32 | <childnode refid="392" relation="include"> |
---|
33 | </childnode> |
---|
34 | </node> |
---|
35 | <node id="391"> |
---|
36 | <label>work/git/mixpp/bdm/stat/libEF.h</label> |
---|
37 | <link refid="libEF.h"/> |
---|
38 | <childnode refid="392" relation="include"> |
---|
39 | </childnode> |
---|
40 | <childnode refid="393" relation="include"> |
---|
41 | </childnode> |
---|
42 | <childnode refid="394" relation="include"> |
---|
43 | </childnode> |
---|
44 | <childnode refid="395" relation="include"> |
---|
45 | </childnode> |
---|
46 | </node> |
---|
47 | <node id="392"> |
---|
48 | <label>itpp/itbase.h</label> |
---|
49 | </node> |
---|
50 | <node id="393"> |
---|
51 | <label>../math/libDC.h</label> |
---|
52 | <link refid="libDC_8h"/> |
---|
53 | <childnode refid="392" relation="include"> |
---|
54 | </childnode> |
---|
55 | </node> |
---|
56 | </incdepgraph> |
---|
57 | <invincdepgraph> |
---|
58 | <node id="406"> |
---|
59 | <label>work/git/mixpp/bdm/stat/merger.h</label> |
---|
60 | <link refid="merger_8h"/> |
---|
61 | </node> |
---|
62 | <node id="405"> |
---|
63 | <label>work/git/mixpp/bdm/stat/emix.h</label> |
---|
64 | <link refid="emix_8h"/> |
---|
65 | <childnode refid="406" relation="include"> |
---|
66 | </childnode> |
---|
67 | <childnode refid="401" relation="include"> |
---|
68 | </childnode> |
---|
69 | </node> |
---|
70 | <node id="400"> |
---|
71 | <label>work/git/mixpp/bdm/estim/ekf_templ.h</label> |
---|
72 | <link refid="ekf__templ_8h"/> |
---|
73 | <childnode refid="401" relation="include"> |
---|
74 | </childnode> |
---|
75 | </node> |
---|
76 | <node id="396"> |
---|
77 | <label>work/git/mixpp/bdm/stat/libEF.h</label> |
---|
78 | <link refid="libEF.h"/> |
---|
79 | <childnode refid="397" relation="include"> |
---|
80 | </childnode> |
---|
81 | <childnode refid="399" relation="include"> |
---|
82 | </childnode> |
---|
83 | <childnode refid="404" relation="include"> |
---|
84 | </childnode> |
---|
85 | <childnode refid="405" relation="include"> |
---|
86 | </childnode> |
---|
87 | <childnode refid="406" relation="include"> |
---|
88 | </childnode> |
---|
89 | </node> |
---|
90 | <node id="404"> |
---|
91 | <label>work/git/mixpp/bdm/estim/libPF.h</label> |
---|
92 | <link refid="libPF_8h"/> |
---|
93 | <childnode refid="401" relation="include"> |
---|
94 | </childnode> |
---|
95 | </node> |
---|
96 | <node id="397"> |
---|
97 | <label>work/git/mixpp/bdm/estim/arx.h</label> |
---|
98 | <link refid="arx_8h"/> |
---|
99 | <childnode refid="398" relation="include"> |
---|
100 | </childnode> |
---|
101 | </node> |
---|
102 | <node id="398"> |
---|
103 | <label>work/git/mixpp/pmsm/sim_var_arx.cpp</label> |
---|
104 | <link refid="sim__var__arx_8cpp"/> |
---|
105 | </node> |
---|
106 | <node id="402"> |
---|
107 | <label>work/git/mixpp/pmsm/sim_var.cpp</label> |
---|
108 | <link refid="sim__var_8cpp"/> |
---|
109 | </node> |
---|
110 | <node id="399"> |
---|
111 | <label>work/git/mixpp/bdm/estim/libKF.h</label> |
---|
112 | <link refid="libKF_8h"/> |
---|
113 | <childnode refid="400" relation="include"> |
---|
114 | </childnode> |
---|
115 | <childnode refid="402" relation="include"> |
---|
116 | </childnode> |
---|
117 | <childnode refid="403" relation="include"> |
---|
118 | </childnode> |
---|
119 | </node> |
---|
120 | <node id="403"> |
---|
121 | <label>work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.h</label> |
---|
122 | <link refid="ekf__obj_8h"/> |
---|
123 | </node> |
---|
124 | <node id="401"> |
---|
125 | <label>work/git/mixpp/pmsm/pmsm_mix.cpp</label> |
---|
126 | <link refid="pmsm__mix_8cpp"/> |
---|
127 | </node> |
---|
128 | </invincdepgraph> |
---|
129 | <innerclass refid="classeEF" prot="public">eEF</innerclass> |
---|
130 | <innerclass refid="classmEF" prot="public">mEF</innerclass> |
---|
131 | <innerclass refid="classenorm" prot="public">enorm</innerclass> |
---|
132 | <innerclass refid="classegiw" prot="public">egiw</innerclass> |
---|
133 | <innerclass refid="classegamma" prot="public">egamma</innerclass> |
---|
134 | <innerclass refid="classeuni" prot="public">euni</innerclass> |
---|
135 | <innerclass refid="classmlnorm" prot="public">mlnorm</innerclass> |
---|
136 | <innerclass refid="classmgamma" prot="public">mgamma</innerclass> |
---|
137 | <innerclass refid="classmgamma__fix" prot="public">mgamma_fix</innerclass> |
---|
138 | <innerclass refid="classeEmp" prot="public">eEmp</innerclass> |
---|
139 | <sectiondef kind="enum"> |
---|
140 | <memberdef kind="enum" id="libEF_8h_199497a3ff630f761cf6bff7babd23212" prot="public" static="no"> |
---|
141 | <name>RESAMPLING_METHOD</name> |
---|
142 | <enumvalue id="libEF_8h_199497a3ff630f761cf6bff7babd2321214208a39f9e86f55ce751ee7b5eb3e42" prot="public"> |
---|
143 | <name>MULTINOMIAL</name> |
---|
144 | <initializer> 0</initializer> |
---|
145 | <briefdescription> |
---|
146 | </briefdescription> |
---|
147 | <detaileddescription> |
---|
148 | </detaileddescription> |
---|
149 | </enumvalue> |
---|
150 | <enumvalue id="libEF_8h_199497a3ff630f761cf6bff7babd2321219c32847f57702dd84a920075b90b2d7" prot="public"> |
---|
151 | <name>STRATIFIED</name> |
---|
152 | <initializer> 1</initializer> |
---|
153 | <briefdescription> |
---|
154 | </briefdescription> |
---|
155 | <detaileddescription> |
---|
156 | </detaileddescription> |
---|
157 | </enumvalue> |
---|
158 | <enumvalue id="libEF_8h_199497a3ff630f761cf6bff7babd23212a792a4f45646dddc20d6b942ac7e7a71" prot="public"> |
---|
159 | <name>SYSTEMATIC</name> |
---|
160 | <initializer> 3</initializer> |
---|
161 | <briefdescription> |
---|
162 | </briefdescription> |
---|
163 | <detaileddescription> |
---|
164 | </detaileddescription> |
---|
165 | </enumvalue> |
---|
166 | <briefdescription> |
---|
167 | <para>Switch between various resampling methods. </para> </briefdescription> |
---|
168 | <detaileddescription> |
---|
169 | </detaileddescription> |
---|
170 | <inbodydescription> |
---|
171 | </inbodydescription> |
---|
172 | <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="305" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" bodystart="305" bodyend="305"/> |
---|
173 | </memberdef> |
---|
174 | </sectiondef> |
---|
175 | <sectiondef kind="var"> |
---|
176 | <memberdef kind="variable" id="libEF_8h_12ae7dcdfebede774dd1b1f16cad10dd9" prot="public" static="no" mutable="no"> |
---|
177 | <type>Uniform_RNG</type> |
---|
178 | <definition>Uniform_RNG UniRNG</definition> |
---|
179 | <argsstring></argsstring> |
---|
180 | <name>UniRNG</name> |
---|
181 | <briefdescription> |
---|
182 | <para>Global Uniform_RNG. </para> </briefdescription> |
---|
183 | <detaileddescription> |
---|
184 | </detaileddescription> |
---|
185 | <inbodydescription> |
---|
186 | </inbodydescription> |
---|
187 | <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="26" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.cpp" bodystart="8" bodyend="-1"/> |
---|
188 | </memberdef> |
---|
189 | <memberdef kind="variable" id="libEF_8h_1395c5925c8792aef3be4c360e91526c0" prot="public" static="no" mutable="no"> |
---|
190 | <type>Normal_RNG</type> |
---|
191 | <definition>Normal_RNG NorRNG</definition> |
---|
192 | <argsstring></argsstring> |
---|
193 | <name>NorRNG</name> |
---|
194 | <briefdescription> |
---|
195 | <para>Global Normal_RNG. </para> </briefdescription> |
---|
196 | <detaileddescription> |
---|
197 | </detaileddescription> |
---|
198 | <inbodydescription> |
---|
199 | </inbodydescription> |
---|
200 | <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="28" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.cpp" bodystart="9" bodyend="-1"/> |
---|
201 | </memberdef> |
---|
202 | <memberdef kind="variable" id="libEF_8h_1884a8348c92a49725b78e2b6ab0bb802" prot="public" static="no" mutable="no"> |
---|
203 | <type><ref refid="classitpp_1_1Gamma__RNG" kindref="compound">Gamma_RNG</ref></type> |
---|
204 | <definition>Gamma_RNG GamRNG</definition> |
---|
205 | <argsstring></argsstring> |
---|
206 | <name>GamRNG</name> |
---|
207 | <briefdescription> |
---|
208 | <para>Global Gamma_RNG. </para> </briefdescription> |
---|
209 | <detaileddescription> |
---|
210 | </detaileddescription> |
---|
211 | <inbodydescription> |
---|
212 | </inbodydescription> |
---|
213 | <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h" line="30" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libEF.cpp" bodystart="10" bodyend="-1"/> |
---|
214 | </memberdef> |
---|
215 | </sectiondef> |
---|
216 | <briefdescription> |
---|
217 | <para>Probability distributions for Exponential Family models. </para> </briefdescription> |
---|
218 | <detaileddescription> |
---|
219 | <para><simplesect kind="author"><para>Vaclav Smidl.</para></simplesect> |
---|
220 | ----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty</para><para>Using IT++ for numerical operations ----------------------------------- </para> </detaileddescription> |
---|
221 | <programlisting> |
---|
222 | <codeline lineno="1"></codeline> |
---|
223 | <codeline lineno="13"><highlight class="preprocessor">#ifndef<sp/>EF_H</highlight></codeline> |
---|
224 | <codeline lineno="14"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>EF_H</highlight></codeline> |
---|
225 | <codeline lineno="15"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline> |
---|
226 | <codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><itpp/itbase.h></highlight><highlight class="normal"></highlight></codeline> |
---|
227 | <codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"../math/libDC.h"</highlight><highlight class="normal"></highlight></codeline> |
---|
228 | <codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="libBM_8h" kindref="compound" tooltip="Bayesian Models (bm) that use Bayes rule to learn from observations.">libBM.h</ref>"</highlight><highlight class="normal"></highlight></codeline> |
---|
229 | <codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"../itpp_ext.h"</highlight><highlight class="normal"></highlight></codeline> |
---|
230 | <codeline lineno="20"><highlight class="normal"></highlight><highlight class="comment">//#include<sp/><std></highlight><highlight class="normal"></highlight></codeline> |
---|
231 | <codeline lineno="21"><highlight class="normal"></highlight></codeline> |
---|
232 | <codeline lineno="22"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline> |
---|
233 | <codeline lineno="23"><highlight class="normal"></highlight></codeline> |
---|
234 | <codeline lineno="24"><highlight class="normal"></highlight></codeline> |
---|
235 | <codeline lineno="26"><highlight class="keyword">extern</highlight><highlight class="normal"><sp/>Uniform_RNG<sp/>UniRNG;</highlight></codeline> |
---|
236 | <codeline lineno="28"><highlight class="keyword">extern</highlight><highlight class="normal"><sp/>Normal_RNG<sp/>NorRNG;</highlight></codeline> |
---|
237 | <codeline lineno="30"><highlight class="keyword">extern</highlight><highlight class="normal"><sp/><ref refid="classitpp_1_1Gamma__RNG" kindref="compound" tooltip="Gamma distribution.">Gamma_RNG</ref><sp/>GamRNG;</highlight></codeline> |
---|
238 | <codeline lineno="31"><highlight class="normal"></highlight></codeline> |
---|
239 | <codeline lineno="38" refid="classeEF" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>{</highlight></codeline> |
---|
240 | <codeline lineno="39"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
241 | <codeline lineno="40"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>eEF()<sp/>:epdf()<sp/>{};</highlight></codeline> |
---|
242 | <codeline lineno="42" refid="classeEF_17e3c63655e8375c76bf1f421245427a7" refkind="member"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeEF_17e3c63655e8375c76bf1f421245427a7" kindref="member" tooltip="default constructor">eEF</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>)<sp/>:<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv<sp/>)<sp/>{};</highlight></codeline> |
---|
243 | <codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">virtual</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeEF_169e5680dac10375d62520d26c672477d" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>()</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>=0;</highlight></codeline> |
---|
244 | <codeline lineno="46" refid="classeEF_1fd88bc35550ec8fe9281d358216d0fcf" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">virtual</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classeEF_1fd88bc35550ec8fe9281d358216d0fcf" kindref="member" tooltip="TODO decide if it is really needed.">tupdate</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>phi,<sp/>mat<sp/>&vbar,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nubar<sp/>)<sp/>{};</highlight></codeline> |
---|
245 | <codeline lineno="48" refid="classeEF_15863718c3b2fb1496dece10c5b745d5c" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">virtual</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classeEF_15863718c3b2fb1496dece10c5b745d5c" kindref="member" tooltip="TODO decide if it is really needed.">dupdate</ref><sp/>(<sp/>mat<sp/>&v,</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu=1.0<sp/>)<sp/>{};</highlight></codeline> |
---|
246 | <codeline lineno="49"><highlight class="normal">};</highlight></codeline> |
---|
247 | <codeline lineno="50"><highlight class="normal"></highlight></codeline> |
---|
248 | <codeline lineno="57" refid="classmEF" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmpdf" kindref="compound" tooltip="Conditional probability density, e.g. modeling some dependencies.">mpdf</ref><sp/>{</highlight></codeline> |
---|
249 | <codeline lineno="58"><highlight class="normal"></highlight></codeline> |
---|
250 | <codeline lineno="59"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
251 | <codeline lineno="61" refid="classmEF_18bf51fe8654d7b83c8c8afeb19409d4f" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmEF_18bf51fe8654d7b83c8c8afeb19409d4f" kindref="member" tooltip="Default constructor.">mEF</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&rv0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&rvc0<sp/>)<sp/>:<ref refid="classmpdf" kindref="compound" tooltip="Conditional probability density, e.g. modeling some dependencies.">mpdf</ref><sp/>(<sp/>rv0,rvc0<sp/>)<sp/>{};</highlight></codeline> |
---|
252 | <codeline lineno="62"><highlight class="normal">};</highlight></codeline> |
---|
253 | <codeline lineno="63"><highlight class="normal"></highlight></codeline> |
---|
254 | <codeline lineno="69"><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
255 | <codeline lineno="70"><highlight class="normal"></highlight></codeline> |
---|
256 | <codeline lineno="71" refid="classenorm" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classenorm" kindref="compound" tooltip="Gaussian density with positive definite (decomposed) covariance matrix.">enorm</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>{</highlight></codeline> |
---|
257 | <codeline lineno="72"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline> |
---|
258 | <codeline lineno="74" refid="classenorm_171fde0d54bba147e00f612577f95ad20" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;</highlight></codeline> |
---|
259 | <codeline lineno="76" refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>;</highlight></codeline> |
---|
260 | <codeline lineno="78" refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>;</highlight></codeline> |
---|
261 | <codeline lineno="79"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
262 | <codeline lineno="80"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>enorm()<sp/>:eEF()<sp/>{};</highlight></codeline> |
---|
263 | <codeline lineno="82"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm_17b5cb487a2570e8109bfdc0df149aa06" kindref="member" tooltip="Default constructor.">enorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>);</highlight></codeline> |
---|
264 | <codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_11394a65caa6e00d42e00cc99b12227af" kindref="member" tooltip="Set mean value mu and covariance R.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&<ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&<ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref><sp/>);</highlight></codeline> |
---|
265 | <codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15b5fd142b6b17ea334597960e3fe126a" kindref="member" tooltip="tupdate in exponential form (not really handy)">tupdate</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>phi,<sp/>mat<sp/>&vbar,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nubar<sp/>);</highlight></codeline> |
---|
266 | <codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15bf185e31e5954fceb90ada3debd2ff2" kindref="member" tooltip="dupdate in exponential form (not really handy)">dupdate</ref><sp/>(<sp/>mat<sp/>&v,</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu=1.0<sp/>);</highlight></codeline> |
---|
267 | <codeline lineno="89"><highlight class="normal"></highlight></codeline> |
---|
268 | <codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
269 | <codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>N<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
270 | <codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b9e1dfd33692d7b3f1a59f17b0e61bd0" kindref="member" tooltip="Compute probability of argument val.">eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>;</highlight></codeline> |
---|
271 | <codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
272 | <codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref><sp/>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
273 | <codeline lineno="96" refid="classenorm_150fa84da7bae02f7af17a98f37566899" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classenorm_150fa84da7bae02f7af17a98f37566899" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;}</highlight></codeline> |
---|
274 | <codeline lineno="97"><highlight class="normal"></highlight></codeline> |
---|
275 | <codeline lineno="98"><highlight class="normal"></highlight><highlight class="comment">//Access<sp/>methods</highlight></codeline> |
---|
276 | <codeline lineno="100" refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" refkind="member"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&<sp/><ref refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" kindref="member" tooltip="returns a pointer to the internal mean value. Use with Care!">_mu</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;}</highlight></codeline> |
---|
277 | <codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
278 | <codeline lineno="103" refid="classenorm_1d892a38f03be12e572ea57d9689cef6b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_1d892a38f03be12e572ea57d9689cef6b" kindref="member" tooltip="access function">set_mu</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>mu0)<sp/>{<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>=mu0;}</highlight></codeline> |
---|
279 | <codeline lineno="104"><highlight class="normal"></highlight></codeline> |
---|
280 | <codeline lineno="106" refid="classenorm_17a5034b25771a84450a990d10fc40ac9" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sq_T&<sp/><ref refid="classenorm_17a5034b25771a84450a990d10fc40ac9" kindref="member" tooltip="returns pointers to the internal variance and its inverse. Use with Care!">_R</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>;}</highlight></codeline> |
---|
281 | <codeline lineno="107"><highlight class="normal"></highlight></codeline> |
---|
282 | <codeline lineno="109" refid="classenorm_19b9f58dc86affa23511c246887420658" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classenorm_19b9f58dc86affa23511c246887420658" kindref="member" tooltip="access method">getR</ref><sp/>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.to_mat();}</highlight></codeline> |
---|
283 | <codeline lineno="110"><highlight class="normal">};</highlight></codeline> |
---|
284 | <codeline lineno="111"><highlight class="normal"></highlight></codeline> |
---|
285 | <codeline lineno="117" refid="classegiw" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>{</highlight></codeline> |
---|
286 | <codeline lineno="118"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline> |
---|
287 | <codeline lineno="120" refid="classegiw_1f343d03ede89db820edf44a6297fa442" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/><ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>;</highlight></codeline> |
---|
288 | <codeline lineno="122" refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" kindref="member" tooltip="Number of data records (degrees of freedom) of sufficient statistics.">nu</ref>;</highlight></codeline> |
---|
289 | <codeline lineno="123"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
290 | <codeline lineno="125" refid="classegiw_1c52a2173c6eb1490edce9c6c7c05d60b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classegiw_1c52a2173c6eb1490edce9c6c7c05d60b" kindref="member" tooltip="Default constructor.">egiw</ref>(<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>,<sp/>mat<sp/>V0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu0):<sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref>(rv),<sp/><ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>(V0),<sp/><ref refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" kindref="member" tooltip="Number of data records (degrees of freedom) of sufficient statistics.">nu</ref>(nu0)<sp/>{</highlight></codeline> |
---|
291 | <codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(rv.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()==<ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>.<ref refid="classldmat_196dfb21865db4f5bd36fa70f9b0b1163" kindref="member" tooltip="access function">rows</ref>(),</highlight><highlight class="stringliteral">"Incompatible<sp/>V0."</highlight><highlight class="normal">);</highlight></codeline> |
---|
292 | <codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
293 | <codeline lineno="128"><highlight class="normal"></highlight></codeline> |
---|
294 | <codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegiw_13d2c1f2ba0f9966781f1e0ae695e8a6f" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
295 | <codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegiw_16deb0ff2859f41ef7cbdf6a842cabb29" kindref="member" tooltip="return expected value">mean</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
296 | <codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegiw_1425cbc53b377274e28c6add942bab62d" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
297 | <codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref><sp/>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
298 | <codeline lineno="133"><highlight class="normal"></highlight></codeline> |
---|
299 | <codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Access</highlight></codeline> |
---|
300 | <codeline lineno="136" refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" refkind="member"><highlight class="comment"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref>&<sp/><ref refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_V</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classegiw_1f343d03ede89db820edf44a6297fa442" kindref="member" tooltip="Extended information matrix of sufficient statistics.">V</ref>;}</highlight></codeline> |
---|
301 | <codeline lineno="138" refid="classegiw_108029c481ff95d24f093df0573879afe" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal">&<sp/><ref refid="classegiw_108029c481ff95d24f093df0573879afe" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_nu</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classegiw_14a2f130b91afe84f6d62fed289d5d453" kindref="member" tooltip="Number of data records (degrees of freedom) of sufficient statistics.">nu</ref>;}</highlight></codeline> |
---|
302 | <codeline lineno="139"><highlight class="normal"></highlight></codeline> |
---|
303 | <codeline lineno="140"><highlight class="normal">};</highlight></codeline> |
---|
304 | <codeline lineno="141"><highlight class="normal"></highlight></codeline> |
---|
305 | <codeline lineno="151" refid="classegamma" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classegamma" kindref="compound" tooltip="Gamma posterior density.">egamma</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>{</highlight></codeline> |
---|
306 | <codeline lineno="152"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline> |
---|
307 | <codeline lineno="154" refid="classegamma_1376cebd8932546c440f21b182910b01b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref>;</highlight></codeline> |
---|
308 | <codeline lineno="156" refid="classegamma_1cfc5f136467488a421ab22f886323790" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>;</highlight></codeline> |
---|
309 | <codeline lineno="157"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/>:</highlight></codeline> |
---|
310 | <codeline lineno="159" refid="classegamma_14b1d34f3b244ea51a58ec10c468788c1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classegamma_14b1d34f3b244ea51a58ec10c468788c1" kindref="member" tooltip="Default constructor.">egamma</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>)<sp/>:<ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>(<sp/>rv<sp/>)<sp/>{};</highlight></codeline> |
---|
311 | <codeline lineno="161" refid="classegamma_18e348b89be82b70471fe8c5630f61339" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classegamma_18e348b89be82b70471fe8c5630f61339" kindref="member" tooltip="Sets parameters.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&a,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&b<sp/>)<sp/>{<ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref>=a,<ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>=b;};</highlight></codeline> |
---|
312 | <codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_18e10c0021b5dfdd9cb62c6959b5ef425" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
313 | <codeline lineno="164"><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>sample<sp/>(<sp/>int<sp/>N<sp/>)<sp/>const;</highlight><highlight class="normal"></highlight></codeline> |
---|
314 | <codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegamma_1de84faac8f9799dfe2777ddbedf997ef" kindref="member" tooltip="TODO: is it used anywhere?">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
315 | <codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classegamma_1d6dbbdb72360f9e54d64501f80318bb6" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref><sp/>()<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">;</highlight></codeline> |
---|
316 | <codeline lineno="168" refid="classegamma_144445c56e60b91b377f207f8d5089790" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classegamma_144445c56e60b91b377f207f8d5089790" kindref="member" tooltip="Returns poiter to alpha and beta. Potentially dengerous: use with care!">_param</ref><sp/>(<sp/>vec*<sp/>&a,<sp/>vec*<sp/>&b<sp/>)<sp/>{a=&<ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref>;b=&<ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>;};</highlight></codeline> |
---|
317 | <codeline lineno="169" refid="classegamma_16ab5ba56f7cdb2e5921c3e77524fa50a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classegamma_16ab5ba56f7cdb2e5921c3e77524fa50a" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{vec<sp/>pom<sp/>(<sp/><ref refid="classegamma_1376cebd8932546c440f21b182910b01b" kindref="member" tooltip="Vector .">alpha</ref><sp/>);<sp/>pom/=<ref refid="classegamma_1cfc5f136467488a421ab22f886323790" kindref="member" tooltip="Vector .">beta</ref>;<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>pom;}</highlight></codeline> |
---|
318 | <codeline lineno="170"><highlight class="normal">};</highlight></codeline> |
---|
319 | <codeline lineno="171"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline> |
---|
320 | <codeline lineno="173"><highlight class="comment">class<sp/>emix<sp/>:<sp/>public<sp/>epdf<sp/>{</highlight></codeline> |
---|
321 | <codeline lineno="174"><highlight class="comment">protected:</highlight></codeline> |
---|
322 | <codeline lineno="175"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>int<sp/>n;</highlight></codeline> |
---|
323 | <codeline lineno="176"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>&w;</highlight></codeline> |
---|
324 | <codeline lineno="177"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array<epdf*><sp/>Coms;</highlight></codeline> |
---|
325 | <codeline lineno="178"><highlight class="comment">public:</highlight></codeline> |
---|
326 | <codeline lineno="180"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>emix<sp/>(<sp/>const<sp/>RV<sp/>&rv,<sp/>vec<sp/>&w0):<sp/>epdf(rv),<sp/>n(w0.length()),<sp/>w(w0),<sp/>Coms(n)<sp/>{};</highlight></codeline> |
---|
327 | <codeline lineno="181"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>void<sp/>set_parameters(<sp/>int<sp/>&i,<sp/>double<sp/>wi,<sp/>epdf*<sp/>ep){w(i)=wi;Coms(i)=ep;}</highlight></codeline> |
---|
328 | <codeline lineno="182"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>mean(){vec<sp/>pom;<sp/>for(int<sp/>i=0;i<n;i++){pom+=Coms(i)->mean()*w(i);}<sp/>return<sp/>pom;};</highlight></codeline> |
---|
329 | <codeline lineno="183"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>sample()<sp/>{it_error<sp/>(<sp/>"Not<sp/>implemented"<sp/>);return<sp/>0;}</highlight></codeline> |
---|
330 | <codeline lineno="184"><highlight class="comment">};</highlight></codeline> |
---|
331 | <codeline lineno="185"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline> |
---|
332 | <codeline lineno="186"><highlight class="normal"></highlight></codeline> |
---|
333 | <codeline lineno="188"><highlight class="normal"></highlight></codeline> |
---|
334 | <codeline lineno="189" refid="classeuni" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classeuni" kindref="compound" tooltip="Uniform distributed density on a rectangular support.">euni</ref>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>{</highlight></codeline> |
---|
335 | <codeline lineno="190"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline> |
---|
336 | <codeline lineno="192" refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref>;</highlight></codeline> |
---|
337 | <codeline lineno="194" refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" kindref="member" tooltip="upper bound on support">high</ref>;</highlight></codeline> |
---|
338 | <codeline lineno="196" refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref>;</highlight></codeline> |
---|
339 | <codeline lineno="198" refid="classeuni_163105490e946e43372d6187ad1bafdda" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref>;</highlight></codeline> |
---|
340 | <codeline lineno="200" refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" kindref="member" tooltip="cache of log( nk )">lnk</ref>;</highlight></codeline> |
---|
341 | <codeline lineno="201"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
342 | <codeline lineno="203" refid="classeuni_12537a6c239cff52e3ba814851a1116cd" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_12537a6c239cff52e3ba814851a1116cd" kindref="member" tooltip="Defualt constructor.">euni</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>)<sp/>:<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv<sp/>)<sp/>{}</highlight></codeline> |
---|
343 | <codeline lineno="204" refid="classeuni_12723d4992900b5c5495bfa03628195ed" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_12723d4992900b5c5495bfa03628195ed" kindref="member" tooltip="Compute probability of argument val.">eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/><sp/></highlight><highlight class="normal">{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref>;}</highlight></codeline> |
---|
344 | <codeline lineno="205" refid="classeuni_106af95d514a6623ad4688bd2ad50ad71" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeuni_106af95d514a6623ad4688bd2ad50ad71" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/><sp/></highlight><highlight class="normal">{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" kindref="member" tooltip="cache of log( nk )">lnk</ref>;}</highlight></codeline> |
---|
345 | <codeline lineno="206" refid="classeuni_14a0e09392be17beaee120ba98fc038cd" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_14a0e09392be17beaee120ba98fc038cd" kindref="member" tooltip="Returns the required moment of the epdf.">sample</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline> |
---|
346 | <codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()<sp/>);<sp/></highlight></codeline> |
---|
347 | <codeline lineno="208"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>#pragma<sp/>omp<sp/>critical</highlight></codeline> |
---|
348 | <codeline lineno="209"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>UniRNG.sample_vector<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>(),smp<sp/>);</highlight></codeline> |
---|
349 | <codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref>+elem_mult(<ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref>,smp);</highlight></codeline> |
---|
350 | <codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
351 | <codeline lineno="213" refid="classeuni_14fd7c6a05100616ad16ece405cad7bf2" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classeuni_14fd7c6a05100616ad16ece405cad7bf2" kindref="member" tooltip="set values of low and high ">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&low0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&high0<sp/>)<sp/>{</highlight></codeline> |
---|
352 | <codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref><sp/>=<sp/>high0-low0;</highlight></codeline> |
---|
353 | <codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>min<sp/>(<sp/><ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref><sp/>)<sp/>>0.0,</highlight><highlight class="stringliteral">"bad<sp/>support"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
354 | <codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref><sp/>=<sp/>low0;</highlight></codeline> |
---|
355 | <codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" kindref="member" tooltip="upper bound on support">high</ref><sp/>=<sp/>high0;</highlight></codeline> |
---|
356 | <codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref><sp/>=<sp/>prod<sp/>(<sp/>1.0/<ref refid="classeuni_152a6ff4a54010f88a6a19fca605c64a4" kindref="member" tooltip="internal">distance</ref><sp/>);</highlight></codeline> |
---|
357 | <codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni_1f445a0ce24f39d14c1a4eed53fc8e2c3" kindref="member" tooltip="cache of log( nk )">lnk</ref><sp/>=<sp/>log<sp/>(<sp/><ref refid="classeuni_163105490e946e43372d6187ad1bafdda" kindref="member" tooltip="normalizing coefficients">nk</ref><sp/>);</highlight></codeline> |
---|
358 | <codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
359 | <codeline lineno="221" refid="classeuni_18050087e421a9cfd1b4b1f8bd33b1cc1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeuni_18050087e421a9cfd1b4b1f8bd33b1cc1" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{vec<sp/>pom=<ref refid="classeuni_171b6d6b41aeb61a7f76f682b72119231" kindref="member" tooltip="upper bound on support">high</ref>;<sp/>pom-=<ref refid="classeuni_1ef42cd8d7645422048d46c46ec5cdac1" kindref="member" tooltip="lower bound on support">low</ref>;<sp/>pom/=2.0;<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>pom;}</highlight></codeline> |
---|
360 | <codeline lineno="222"><highlight class="normal">};</highlight></codeline> |
---|
361 | <codeline lineno="223"><highlight class="normal"></highlight></codeline> |
---|
362 | <codeline lineno="224"><highlight class="normal"></highlight></codeline> |
---|
363 | <codeline lineno="230"><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
364 | <codeline lineno="231" refid="classmlnorm" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmlnorm" kindref="compound" tooltip="Normal distributed linear function with linear function of mean value;.">mlnorm</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>{</highlight></codeline> |
---|
365 | <codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm" kindref="compound" tooltip="Gaussian density with positive definite (decomposed) covariance matrix.">enorm<sq_T></ref><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>;</highlight></codeline> |
---|
366 | <codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A;</highlight></codeline> |
---|
367 | <codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&<sp/>_mu;<sp/></highlight><highlight class="comment">//cached<sp/>epdf.mu;</highlight><highlight class="normal"></highlight></codeline> |
---|
368 | <codeline lineno="236"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
369 | <codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmlnorm_1f927203b3f31171c5c10ffc7caa797f5" kindref="member" tooltip="Constructor.">mlnorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>,<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classmpdf_1acb7dda792b3cd5576f39fa3129abbab" kindref="member" tooltip="random variable in condition">rvc</ref><sp/>);</highlight></codeline> |
---|
370 | <codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_1b6749030c5d5abcb3eb6898f74cea3c0" kindref="member" tooltip="Set A and R.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><sp/>mat<sp/>&A,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&R<sp/>);</highlight></codeline> |
---|
371 | <codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">samplecond</ref><sp/>(<sp/>vec<sp/>&cond,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>&lik<sp/>);</highlight></codeline> |
---|
372 | <codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">samplecond</ref><sp/>(<sp/>vec<sp/>&cond,<sp/>vec<sp/>&lik,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>);</highlight></codeline> |
---|
373 | <codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">condition</ref><sp/>(<sp/>vec<sp/>&cond<sp/>);</highlight></codeline> |
---|
374 | <codeline lineno="247"><highlight class="normal">};</highlight></codeline> |
---|
375 | <codeline lineno="248"><highlight class="normal"></highlight></codeline> |
---|
376 | <codeline lineno="258" refid="classmgamma" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmgamma" kindref="compound" tooltip="Gamma random walk.">mgamma</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>{</highlight></codeline> |
---|
377 | <codeline lineno="259"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline> |
---|
378 | <codeline lineno="261" refid="classmgamma_1612dbf35c770a780027619aaac2c443e" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classegamma" kindref="compound" tooltip="Gamma posterior density.">egamma</ref><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>;</highlight></codeline> |
---|
379 | <codeline lineno="263" refid="classmgamma_143f733cce0245a52363d566099add687" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref>;</highlight></codeline> |
---|
380 | <codeline lineno="265" refid="classmgamma_15e90652837448bcc29707e7412f99691" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec*<sp/><ref refid="classmgamma_15e90652837448bcc29707e7412f99691" kindref="member" tooltip="cache of epdf.beta">_beta</ref>;</highlight></codeline> |
---|
381 | <codeline lineno="266"><highlight class="normal"></highlight></codeline> |
---|
382 | <codeline lineno="267"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
383 | <codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma_1af43e61b86900c0398d5c0ffc83b94e6" kindref="member" tooltip="Constructor.">mgamma</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classmpdf_1acb7dda792b3cd5576f39fa3129abbab" kindref="member" tooltip="random variable in condition">rvc</ref><sp/>);</highlight></codeline> |
---|
384 | <codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmgamma_1a9d646cf758a70126dde7c48790b6e94" kindref="member" tooltip="Set value of k.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref><sp/>);</highlight></codeline> |
---|
385 | <codeline lineno="272" refid="classmgamma_1a61094c9f7a2d64ea77b130cbc031f97" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmgamma_1a61094c9f7a2d64ea77b130cbc031f97" kindref="member" tooltip="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)<sp/>{*<ref refid="classmgamma_15e90652837448bcc29707e7412f99691" kindref="member" tooltip="cache of epdf.beta">_beta</ref>=<ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref>/val;};</highlight></codeline> |
---|
386 | <codeline lineno="273"><highlight class="normal">};</highlight></codeline> |
---|
387 | <codeline lineno="274"><highlight class="normal"></highlight></codeline> |
---|
388 | <codeline lineno="286" refid="classmgamma__fix" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classmgamma__fix" kindref="compound" tooltip="Gamma random walk around a fixed point.">mgamma_fix</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classmgamma" kindref="compound" tooltip="Gamma random walk.">mgamma</ref><sp/>{</highlight></codeline> |
---|
389 | <codeline lineno="287"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline> |
---|
390 | <codeline lineno="289" refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" kindref="member" tooltip="parameter l">l</ref>;</highlight></codeline> |
---|
391 | <codeline lineno="291" refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref>;</highlight></codeline> |
---|
392 | <codeline lineno="292"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
393 | <codeline lineno="294" refid="classmgamma__fix_1b92c3d2e5fd0381033a072e5ef3bcf80" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma__fix_1b92c3d2e5fd0381033a072e5ef3bcf80" kindref="member" tooltip="Constructor.">mgamma_fix</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&<ref refid="classmpdf_1acb7dda792b3cd5576f39fa3129abbab" kindref="member" tooltip="random variable in condition">rvc</ref><sp/>)<sp/>:<sp/><ref refid="classmgamma" kindref="compound" tooltip="Gamma random walk.">mgamma</ref><sp/>(<sp/>rv,rvc<sp/>),<ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref><sp/>(<sp/>rv.count()<sp/>)<sp/>{};</highlight></codeline> |
---|
394 | <codeline lineno="296" refid="classmgamma__fix_1ec6f846896749e27cb7be9fa48dd1cb1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmgamma__fix_1ec6f846896749e27cb7be9fa48dd1cb1" kindref="member" tooltip="Set value of k.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>k0<sp/>,<sp/>vec<sp/>ref0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>l0<sp/>)<sp/>{</highlight></codeline> |
---|
395 | <codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma_1a9d646cf758a70126dde7c48790b6e94" kindref="member" tooltip="Set value of k.">mgamma::set_parameters</ref><sp/>(<sp/>k0<sp/>);</highlight></codeline> |
---|
396 | <codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref>=pow<sp/>(<sp/>ref0,1.0-l0<sp/>);<ref refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" kindref="member" tooltip="parameter l">l</ref>=l0;</highlight></codeline> |
---|
397 | <codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline> |
---|
398 | <codeline lineno="300"><highlight class="normal"></highlight></codeline> |
---|
399 | <codeline lineno="301" refid="classmgamma__fix_16ea3931eec7b7da7b693e45981052460" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmgamma__fix_16ea3931eec7b7da7b693e45981052460" kindref="member" tooltip="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)<sp/>{vec<sp/>mean=elem_mult<sp/>(<sp/><ref refid="classmgamma__fix_181ce49029ecc385418619b200dcafeb0" kindref="member" tooltip="reference vector">refl</ref>,pow<sp/>(<sp/>val,<ref refid="classmgamma__fix_13f48c09caddc298901ad75fe7c0529f6" kindref="member" tooltip="parameter l">l</ref><sp/>)<sp/>);<sp/>*<ref refid="classmgamma_15e90652837448bcc29707e7412f99691" kindref="member" tooltip="cache of epdf.beta">_beta</ref>=<ref refid="classmgamma_143f733cce0245a52363d566099add687" kindref="member" tooltip="Constant .">k</ref>/mean;};</highlight></codeline> |
---|
400 | <codeline lineno="302"><highlight class="normal">};</highlight></codeline> |
---|
401 | <codeline lineno="303"><highlight class="normal"></highlight></codeline> |
---|
402 | <codeline lineno="305" refid="libEF_8h_199497a3ff630f761cf6bff7babd23212" refkind="member"><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="libEF_8h_199497a3ff630f761cf6bff7babd23212" kindref="member" tooltip="Switch between various resampling methods.">RESAMPLING_METHOD</ref><sp/>{<sp/>MULTINOMIAL<sp/>=<sp/>0,<sp/>STRATIFIED<sp/>=<sp/>1,<sp/>SYSTEMATIC<sp/>=<sp/>3<sp/>};</highlight></codeline> |
---|
403 | <codeline lineno="311" refid="classeEmp" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classeEmp" kindref="compound" tooltip="Weighted empirical density.">eEmp</ref>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>{</highlight></codeline> |
---|
404 | <codeline lineno="312"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/>:</highlight></codeline> |
---|
405 | <codeline lineno="314" refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref>;</highlight></codeline> |
---|
406 | <codeline lineno="316" refid="classeEmp_1ae78d144404ddba843c93b171b215de8" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref>;</highlight></codeline> |
---|
407 | <codeline lineno="318" refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array<vec><sp/><ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref>;</highlight></codeline> |
---|
408 | <codeline lineno="319"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
409 | <codeline lineno="321" refid="classeEmp_10c04b073ecd0dae3d498e680ae27e9e4" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeEmp_10c04b073ecd0dae3d498e680ae27e9e4" kindref="member" tooltip="Default constructor.">eEmp</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&rv0<sp/>,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n0<sp/>)<sp/>:<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv0<sp/>),<ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref><sp/>(<sp/>n0<sp/>),<ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref><sp/>(<sp/><ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref><sp/>),<ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref><sp/>(<sp/><ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref><sp/>)<sp/>{};</highlight></codeline> |
---|
410 | <codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classeEmp_16606a656c1b28114f7384c25aaf80e8d" kindref="member" tooltip="Set sample.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&w0,<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>*<sp/>pdf0<sp/>);</highlight></codeline> |
---|
411 | <codeline lineno="325" refid="classeEmp_131b2bfb73b72486a5c89f2ab850c7a9b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec&<sp/><ref refid="classeEmp_131b2bfb73b72486a5c89f2ab850c7a9b" kindref="member" tooltip="Potentially dangerous, use with care.">_w</ref>()<sp/><sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref>;};</highlight></codeline> |
---|
412 | <codeline lineno="327" refid="classeEmp_131b747eca73b16f30370827ba4cc3575" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array<vec>&<sp/><ref refid="classeEmp_131b747eca73b16f30370827ba4cc3575" kindref="member" tooltip="access function">_samples</ref>()<sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref>;};</highlight></codeline> |
---|
413 | <codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/><ref refid="classeEmp_177268292fc4465cb73ddbfb1f2932a59" kindref="member" tooltip="Function performs resampling, i.e. removal of low-weight samples and duplication...">resample</ref><sp/>(<sp/><ref refid="libEF_8h_199497a3ff630f761cf6bff7babd23212" kindref="member" tooltip="Switch between various resampling methods.">RESAMPLING_METHOD</ref><sp/>method<sp/>=<sp/>SYSTEMATIC<sp/>);</highlight></codeline> |
---|
414 | <codeline lineno="331" refid="classeEmp_183f9283f92b805508d896479dc1ccf12" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeEmp_183f9283f92b805508d896479dc1ccf12" kindref="member" tooltip="inherited operation : NOT implemneted">sample</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{it_error<sp/>(<sp/></highlight><highlight class="stringliteral">"Not<sp/>implemented"</highlight><highlight class="normal"><sp/>);</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;}</highlight></codeline> |
---|
415 | <codeline lineno="333" refid="classeEmp_123e7358995400865ad2e278945922fb3" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classeEmp_123e7358995400865ad2e278945922fb3" kindref="member" tooltip="inherited operation : NOT implemneted">evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{it_error<sp/>(<sp/></highlight><highlight class="stringliteral">"Not<sp/>implemented"</highlight><highlight class="normal"><sp/>);</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0.0;}</highlight></codeline> |
---|
416 | <codeline lineno="334" refid="classeEmp_1ba055c19038cc72628d98e25197e982d" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classeEmp_1ba055c19038cc72628d98e25197e982d" kindref="member" tooltip="return expected value">mean</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline> |
---|
417 | <codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>pom=zeros<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()<sp/>);</highlight></codeline> |
---|
418 | <codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;i<<ref refid="classeEmp_18c33034de0e35f03f8bb85d3d67438fd" kindref="member" tooltip="Number of particles.">n</ref>;i++<sp/>)<sp/>{pom+=<ref refid="classeEmp_1a4d6f4bbd6a6824fc39f14676701279a" kindref="member" tooltip="Samples .">samples</ref><sp/>(<sp/>i<sp/>)<sp/>*<ref refid="classeEmp_1ae78d144404ddba843c93b171b215de8" kindref="member" tooltip="Sample weights .">w</ref><sp/>(<sp/>i<sp/>);}</highlight></codeline> |
---|
419 | <codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>pom;</highlight></codeline> |
---|
420 | <codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
421 | <codeline lineno="339"><highlight class="normal">};</highlight></codeline> |
---|
422 | <codeline lineno="340"><highlight class="normal"></highlight></codeline> |
---|
423 | <codeline lineno="341"><highlight class="normal"></highlight></codeline> |
---|
424 | <codeline lineno="343"><highlight class="normal"></highlight></codeline> |
---|
425 | <codeline lineno="344"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
426 | <codeline lineno="345" refid="classenorm_17b5cb487a2570e8109bfdc0df149aa06" refkind="member"><highlight class="normal"><ref refid="classenorm_17b5cb487a2570e8109bfdc0df149aa06" kindref="member" tooltip="Default constructor.">enorm<sq_T>::enorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&rv<sp/>)<sp/>:<ref refid="classeEF" kindref="compound" tooltip="General conjugate exponential family posterior density.">eEF</ref><sp/>(<sp/>rv<sp/>),<sp/>mu<sp/>(<sp/>rv.count()<sp/>),R<sp/>(<sp/>rv.count()<sp/>),dim<sp/>(<sp/>rv.count()<sp/>)<sp/>{};</highlight></codeline> |
---|
427 | <codeline lineno="346"><highlight class="normal"></highlight></codeline> |
---|
428 | <codeline lineno="347"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
429 | <codeline lineno="348" refid="classenorm_11394a65caa6e00d42e00cc99b12227af" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_11394a65caa6e00d42e00cc99b12227af" kindref="member" tooltip="Set mean value mu and covariance R.">enorm<sq_T>::set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&mu0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&R0<sp/>)<sp/>{</highlight></codeline> |
---|
430 | <codeline lineno="349"><highlight class="normal"></highlight><highlight class="comment">//Fixme<sp/>test<sp/>dimensions<sp/>of<sp/>mu0<sp/>and<sp/>R0;</highlight><highlight class="normal"></highlight></codeline> |
---|
431 | <codeline lineno="350"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref><sp/>=<sp/>mu0;</highlight></codeline> |
---|
432 | <codeline lineno="351"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref><sp/>=<sp/>R0;</highlight></codeline> |
---|
433 | <codeline lineno="352"><highlight class="normal">};</highlight></codeline> |
---|
434 | <codeline lineno="353"><highlight class="normal"></highlight></codeline> |
---|
435 | <codeline lineno="354"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
436 | <codeline lineno="355" refid="classenorm_15bf185e31e5954fceb90ada3debd2ff2" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15bf185e31e5954fceb90ada3debd2ff2" kindref="member" tooltip="dupdate in exponential form (not really handy)">enorm<sq_T>::dupdate</ref><sp/>(<sp/>mat<sp/>&v,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu<sp/>)<sp/>{</highlight></codeline> |
---|
437 | <codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
438 | <codeline lineno="357"><highlight class="normal">};</highlight></codeline> |
---|
439 | <codeline lineno="358"><highlight class="normal"></highlight></codeline> |
---|
440 | <codeline lineno="359"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
441 | <codeline lineno="360" refid="classenorm_15b5fd142b6b17ea334597960e3fe126a" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classenorm_15b5fd142b6b17ea334597960e3fe126a" kindref="member" tooltip="tupdate in exponential form (not really handy)">enorm<sq_T>::tupdate</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>phi,<sp/>mat<sp/>&vbar,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nubar<sp/>)<sp/>{</highlight></codeline> |
---|
442 | <codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
443 | <codeline lineno="362"><highlight class="normal">};</highlight></codeline> |
---|
444 | <codeline lineno="363"><highlight class="normal"></highlight></codeline> |
---|
445 | <codeline lineno="364"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
446 | <codeline lineno="365" refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" refkind="member"><highlight class="normal">vec<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">enorm<sq_T>::sample</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline> |
---|
447 | <codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>x<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref><sp/>);</highlight></codeline> |
---|
448 | <codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NorRNG.sample_vector<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>,x<sp/>);</highlight></codeline> |
---|
449 | <codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>=<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.sqrt_mult<sp/>(<sp/>x<sp/>);</highlight></codeline> |
---|
450 | <codeline lineno="369"><highlight class="normal"></highlight></codeline> |
---|
451 | <codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>smp<sp/>+=<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;</highlight></codeline> |
---|
452 | <codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>smp;</highlight></codeline> |
---|
453 | <codeline lineno="372"><highlight class="normal">};</highlight></codeline> |
---|
454 | <codeline lineno="373"><highlight class="normal"></highlight></codeline> |
---|
455 | <codeline lineno="374"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
456 | <codeline lineno="375" refid="classenorm_160f0f3bfa53d6e65843eea9532b16d36" refkind="member"><highlight class="normal">mat<sp/><ref refid="classenorm_160b47544f6181ffd4530d3e415ce12c5" kindref="member" tooltip="Returns the required moment of the epdf.">enorm<sq_T>::sample</ref><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>N<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline> |
---|
457 | <codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>X<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>,N<sp/>);</highlight></codeline> |
---|
458 | <codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>x<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref><sp/>);</highlight></codeline> |
---|
459 | <codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>pom;</highlight></codeline> |
---|
460 | <codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline> |
---|
461 | <codeline lineno="380"><highlight class="normal"></highlight></codeline> |
---|
462 | <codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;i<N;i++<sp/>)<sp/>{</highlight></codeline> |
---|
463 | <codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NorRNG.sample_vector<sp/>(<sp/><ref refid="classenorm_16938fc390a19cdaf6ad4503fcbaada4e" kindref="member" tooltip="dimension (redundant from rv.count() for easier coding )">dim</ref>,x<sp/>);</highlight></codeline> |
---|
464 | <codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pom<sp/>=<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.sqrt_mult<sp/>(<sp/>x<sp/>);</highlight></codeline> |
---|
465 | <codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pom<sp/>+=<ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>;</highlight></codeline> |
---|
466 | <codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>X.set_col<sp/>(<sp/>i,<sp/>pom<sp/>);</highlight></codeline> |
---|
467 | <codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
468 | <codeline lineno="387"><highlight class="normal"></highlight></codeline> |
---|
469 | <codeline lineno="388"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>X;</highlight></codeline> |
---|
470 | <codeline lineno="389"><highlight class="normal">};</highlight></codeline> |
---|
471 | <codeline lineno="390"><highlight class="normal"></highlight></codeline> |
---|
472 | <codeline lineno="391"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
473 | <codeline lineno="392" refid="classenorm_1b9e1dfd33692d7b3f1a59f17b0e61bd0" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b9e1dfd33692d7b3f1a59f17b0e61bd0" kindref="member" tooltip="Compute probability of argument val.">enorm<sq_T>::eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline> |
---|
474 | <codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>pdfl,e;</highlight></codeline> |
---|
475 | <codeline lineno="394"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pdfl<sp/>=<sp/><ref refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" kindref="member" tooltip="Compute log-probability of argument val.">evalpdflog</ref><sp/>(<sp/>val<sp/>);</highlight></codeline> |
---|
476 | <codeline lineno="395"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e<sp/>=<sp/>exp<sp/>(<sp/>pdfl<sp/>);</highlight></codeline> |
---|
477 | <codeline lineno="396"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>e;</highlight></codeline> |
---|
478 | <codeline lineno="397"><highlight class="normal">};</highlight></codeline> |
---|
479 | <codeline lineno="398"><highlight class="normal"></highlight></codeline> |
---|
480 | <codeline lineno="399"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
481 | <codeline lineno="400" refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1609a7c33dbb4fdfab050f3bdd1122401" kindref="member" tooltip="Compute log-probability of argument val.">enorm<sq_T>::evalpdflog</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&val<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline> |
---|
482 | <codeline lineno="401"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>1.83787706640935<sp/>=<sp/>log(2pi)</highlight><highlight class="normal"></highlight></codeline> |
---|
483 | <codeline lineno="402"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><sp/>-0.5*<sp/>(<sp/><sp/>+<ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.invqform<sp/>(<sp/><ref refid="classenorm_171fde0d54bba147e00f612577f95ad20" kindref="member" tooltip="mean value">mu</ref>-val<sp/>)<sp/>)<sp/>-<sp/><ref refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>();</highlight></codeline> |
---|
484 | <codeline lineno="403"><highlight class="normal">};</highlight></codeline> |
---|
485 | <codeline lineno="404"><highlight class="normal"></highlight></codeline> |
---|
486 | <codeline lineno="405"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
487 | <codeline lineno="406" refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classenorm_1b289a36a69db59d182bb6eba9c05d4a8" kindref="member" tooltip="logarithm of the normalizing constant, ">enorm<sq_T>::lognc</ref><sp/>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline> |
---|
488 | <codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>1.83787706640935<sp/>=<sp/>log(2pi)</highlight><highlight class="normal"></highlight></codeline> |
---|
489 | <codeline lineno="408"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-0.5*<sp/>(<sp/><ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.cols()<sp/>*<sp/>1.83787706640935<sp/>+<ref refid="classenorm_14ccc8d8514d644ef1c98d8ab023748a1" kindref="member" tooltip="Covariance matrix in decomposed form.">R</ref>.logdet());</highlight></codeline> |
---|
490 | <codeline lineno="409"><highlight class="normal">};</highlight></codeline> |
---|
491 | <codeline lineno="410"><highlight class="normal"></highlight></codeline> |
---|
492 | <codeline lineno="411"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
493 | <codeline lineno="412" refid="classmlnorm_1f927203b3f31171c5c10ffc7caa797f5" refkind="member"><highlight class="normal"><ref refid="classmlnorm_1f927203b3f31171c5c10ffc7caa797f5" kindref="member" tooltip="Constructor.">mlnorm<sq_T>::mlnorm</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&rv0,<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&rvc0<sp/>)<sp/>:<ref refid="classmEF" kindref="compound" tooltip="Exponential family model.">mEF</ref><sp/>(<sp/>rv0,rvc0<sp/>),<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref><sp/>(<sp/>rv0<sp/>),A<sp/>(<sp/>rv0.count(),rv0.count()<sp/>),<ref refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" kindref="member" tooltip="returns a pointer to the internal mean value. Use with Care!">_mu</ref>(<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.<ref refid="classenorm_10b8cb284e5af920a1b64a21d057ec5ac" kindref="member" tooltip="returns a pointer to the internal mean value. Use with Care!">_mu</ref>())<sp/>{<sp/><ref refid="classmpdf_17aa894208a32f3487827df6d5054424c" kindref="member" tooltip="pointer to internal epdf">ep</ref><sp/>=&<ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>;</highlight></codeline> |
---|
494 | <codeline lineno="413"><highlight class="normal">}</highlight></codeline> |
---|
495 | <codeline lineno="414"><highlight class="normal"></highlight></codeline> |
---|
496 | <codeline lineno="415"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
497 | <codeline lineno="416" refid="classmlnorm_1b6749030c5d5abcb3eb6898f74cea3c0" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_1b6749030c5d5abcb3eb6898f74cea3c0" kindref="member" tooltip="Set A and R.">mlnorm<sq_T>::set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&A0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>sq_T<sp/>&R0<sp/>)<sp/>{</highlight></codeline> |
---|
498 | <codeline lineno="417"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.set_parameters<sp/>(<sp/>zeros<sp/>(<sp/><ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()<sp/>),R0<sp/>);</highlight></codeline> |
---|
499 | <codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>=<sp/>A0;</highlight></codeline> |
---|
500 | <codeline lineno="419"><highlight class="normal">}</highlight></codeline> |
---|
501 | <codeline lineno="420"><highlight class="normal"></highlight></codeline> |
---|
502 | <codeline lineno="421"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
503 | <codeline lineno="422" refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" refkind="member"><highlight class="normal">vec<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">mlnorm<sq_T>::samplecond</ref><sp/>(<sp/>vec<sp/>&cond,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>&lik<sp/>)<sp/>{</highlight></codeline> |
---|
504 | <codeline lineno="423"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-><ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">condition</ref><sp/>(<sp/>cond<sp/>);</highlight></codeline> |
---|
505 | <codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.sample();</highlight></codeline> |
---|
506 | <codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lik<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.eval<sp/>(<sp/>smp<sp/>);</highlight></codeline> |
---|
507 | <codeline lineno="426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>smp;</highlight></codeline> |
---|
508 | <codeline lineno="427"><highlight class="normal">}</highlight></codeline> |
---|
509 | <codeline lineno="428"><highlight class="normal"></highlight></codeline> |
---|
510 | <codeline lineno="429"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
511 | <codeline lineno="430" refid="classmlnorm_1215fb88cc8b95d64cdefd6849abdd1e8" refkind="member"><highlight class="normal">mat<sp/><ref refid="classmlnorm_1decf3e3b5c8e0812e5b4dbe94fa2ae18" kindref="member" tooltip="Generate one sample of the posterior.">mlnorm<sq_T>::samplecond</ref><sp/>(<sp/>vec<sp/>&cond,<sp/>vec<sp/>&lik,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>)<sp/>{</highlight></codeline> |
---|
512 | <codeline lineno="431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline> |
---|
513 | <codeline lineno="432"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dim<sp/>=<sp/><ref refid="classmpdf_1f6687c07ff07d47812dd565368ca59eb" kindref="member" tooltip="modeled random variable">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>();</highlight></codeline> |
---|
514 | <codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Smp<sp/>(<sp/>dim,n<sp/>);</highlight></codeline> |
---|
515 | <codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>smp<sp/>(<sp/>dim<sp/>);</highlight></codeline> |
---|
516 | <codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-><ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">condition</ref><sp/>(<sp/>cond<sp/>);</highlight></codeline> |
---|
517 | <codeline lineno="436"><highlight class="normal"></highlight></codeline> |
---|
518 | <codeline lineno="437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;<sp/>i<n;<sp/>i++<sp/>)<sp/>{</highlight></codeline> |
---|
519 | <codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>smp<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.sample();</highlight></codeline> |
---|
520 | <codeline lineno="439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lik<sp/>(<sp/>i<sp/>)<sp/>=<sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>.eval<sp/>(<sp/>smp<sp/>);</highlight></codeline> |
---|
521 | <codeline lineno="440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Smp.set_col<sp/>(<sp/>i<sp/>,smp<sp/>);</highlight></codeline> |
---|
522 | <codeline lineno="441"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
523 | <codeline lineno="442"><highlight class="normal"></highlight></codeline> |
---|
524 | <codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>Smp;</highlight></codeline> |
---|
525 | <codeline lineno="444"><highlight class="normal">}</highlight></codeline> |
---|
526 | <codeline lineno="445"><highlight class="normal"></highlight></codeline> |
---|
527 | <codeline lineno="446"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>sq_T></highlight></codeline> |
---|
528 | <codeline lineno="447" refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classmlnorm_15232fc7e305eceab4e2bd6a8daa44195" kindref="member" tooltip="Set value of rvc . Result of this operation is stored in epdf use function _ep to...">mlnorm<sq_T>::condition</ref><sp/>(<sp/>vec<sp/>&cond<sp/>)<sp/>{</highlight></codeline> |
---|
529 | <codeline lineno="448"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>_mu<sp/>=<sp/>A*cond;</highlight></codeline> |
---|
530 | <codeline lineno="449"><highlight class="normal"></highlight><highlight class="comment">//R<sp/>is<sp/>already<sp/>assigned;</highlight><highlight class="normal"></highlight></codeline> |
---|
531 | <codeline lineno="450"><highlight class="normal">}</highlight></codeline> |
---|
532 | <codeline lineno="451"><highlight class="normal"></highlight></codeline> |
---|
533 | <codeline lineno="453"><highlight class="normal"></highlight></codeline> |
---|
534 | <codeline lineno="454"><highlight class="normal"></highlight></codeline> |
---|
535 | <codeline lineno="455"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/>//EF_H</highlight></codeline> |
---|
536 | </programlisting> |
---|
537 | <location file="/home/smidl/work/git/mixpp/bdm/stat/libEF.h"/> |
---|
538 | </compounddef> |
---|
539 | </doxygen> |
---|