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="bdm_2estim_2arx_8cpp" kind="file"> |
---|
4 | <compoundname>arx.cpp</compoundname> |
---|
5 | <includes refid="arx_8h" local="yes">arx.h</includes> |
---|
6 | <incdepgraph> |
---|
7 | <node id="188"> |
---|
8 | <label>libBM.h</label> |
---|
9 | <link refid="libBM_8h"/> |
---|
10 | <childnode refid="186" relation="include"> |
---|
11 | </childnode> |
---|
12 | </node> |
---|
13 | <node id="191"> |
---|
14 | <label>../itpp_ext.h</label> |
---|
15 | <link refid="itpp__ext_8h-source"/> |
---|
16 | <childnode refid="186" relation="include"> |
---|
17 | </childnode> |
---|
18 | </node> |
---|
19 | <node id="189"> |
---|
20 | <label>../stat/libEF.h</label> |
---|
21 | <link refid="libEF_8h"/> |
---|
22 | <childnode refid="186" relation="include"> |
---|
23 | </childnode> |
---|
24 | <childnode refid="190" relation="include"> |
---|
25 | </childnode> |
---|
26 | <childnode refid="188" relation="include"> |
---|
27 | </childnode> |
---|
28 | <childnode refid="191" relation="include"> |
---|
29 | </childnode> |
---|
30 | </node> |
---|
31 | <node id="185"> |
---|
32 | <label>arx.h</label> |
---|
33 | <link refid="arx_8h"/> |
---|
34 | <childnode refid="186" relation="include"> |
---|
35 | </childnode> |
---|
36 | <childnode refid="187" relation="include"> |
---|
37 | </childnode> |
---|
38 | <childnode refid="189" relation="include"> |
---|
39 | </childnode> |
---|
40 | </node> |
---|
41 | <node id="187"> |
---|
42 | <label>../stat/libFN.h</label> |
---|
43 | <link refid="libFN_8h-source"/> |
---|
44 | <childnode refid="186" relation="include"> |
---|
45 | </childnode> |
---|
46 | <childnode refid="188" relation="include"> |
---|
47 | </childnode> |
---|
48 | </node> |
---|
49 | <node id="186"> |
---|
50 | <label>itpp/itbase.h</label> |
---|
51 | </node> |
---|
52 | <node id="184"> |
---|
53 | <label>work/git/mixpp/bdm/estim/arx.cpp</label> |
---|
54 | <link refid="bdm/estim/arx.cpp"/> |
---|
55 | <childnode refid="185" relation="include"> |
---|
56 | </childnode> |
---|
57 | </node> |
---|
58 | <node id="190"> |
---|
59 | <label>../math/libDC.h</label> |
---|
60 | <link refid="libDC_8h"/> |
---|
61 | <childnode refid="186" relation="include"> |
---|
62 | </childnode> |
---|
63 | </node> |
---|
64 | </incdepgraph> |
---|
65 | <sectiondef kind="func"> |
---|
66 | <memberdef kind="function" id="bdm_2estim_2arx_8cpp_1d5bd9c8ac7c67d44b621bb06282c0dc5" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
67 | <type>double</type> |
---|
68 | <definition>double egiw_bestbelow</definition> |
---|
69 | <argsstring>(egiw Eg, egiw Eg0, double Egll, ivec &indeces)</argsstring> |
---|
70 | <name>egiw_bestbelow</name> |
---|
71 | <param> |
---|
72 | <type><ref refid="classegiw" kindref="compound">egiw</ref></type> |
---|
73 | <declname>Eg</declname> |
---|
74 | </param> |
---|
75 | <param> |
---|
76 | <type><ref refid="classegiw" kindref="compound">egiw</ref></type> |
---|
77 | <declname>Eg0</declname> |
---|
78 | </param> |
---|
79 | <param> |
---|
80 | <type>double</type> |
---|
81 | <declname>Egll</declname> |
---|
82 | </param> |
---|
83 | <param> |
---|
84 | <type>ivec &</type> |
---|
85 | <declname>indeces</declname> |
---|
86 | </param> |
---|
87 | <briefdescription> |
---|
88 | <para>Return the best structure. </para> </briefdescription> |
---|
89 | <detaileddescription> |
---|
90 | <para><parameterlist kind="param"><parameteritem> |
---|
91 | <parameternamelist> |
---|
92 | <parametername>Eg</parametername> |
---|
93 | </parameternamelist> |
---|
94 | <parameterdescription> |
---|
95 | <para>a copy of GiW density that is being examined </para></parameterdescription> |
---|
96 | </parameteritem> |
---|
97 | <parameteritem> |
---|
98 | <parameternamelist> |
---|
99 | <parametername>Eg0</parametername> |
---|
100 | </parameternamelist> |
---|
101 | <parameterdescription> |
---|
102 | <para>a copy of prior GiW density before estimation </para></parameterdescription> |
---|
103 | </parameteritem> |
---|
104 | <parameteritem> |
---|
105 | <parameternamelist> |
---|
106 | <parametername>Egll</parametername> |
---|
107 | </parameternamelist> |
---|
108 | <parameterdescription> |
---|
109 | <para>likelihood of the current Eg </para></parameterdescription> |
---|
110 | </parameteritem> |
---|
111 | <parameteritem> |
---|
112 | <parameternamelist> |
---|
113 | <parametername>indeces</parametername> |
---|
114 | </parameternamelist> |
---|
115 | <parameterdescription> |
---|
116 | <para>current indeces </para></parameterdescription> |
---|
117 | </parameteritem> |
---|
118 | </parameterlist> |
---|
119 | <simplesect kind="return"><para>best likelihood in the structure below the given one </para></simplesect> |
---|
120 | </para> </detaileddescription> |
---|
121 | <inbodydescription> |
---|
122 | </inbodydescription> |
---|
123 | <location file="/home/smidl/work/git/mixpp/bdm/estim/arx.cpp" line="33" bodyfile="/home/smidl/work/git/mixpp/bdm/estim/arx.cpp" bodystart="33" bodyend="80"/> |
---|
124 | </memberdef> |
---|
125 | </sectiondef> |
---|
126 | <briefdescription> |
---|
127 | </briefdescription> |
---|
128 | <detaileddescription> |
---|
129 | </detaileddescription> |
---|
130 | <programlisting> |
---|
131 | <codeline lineno="1"><highlight class="preprocessor">#include<sp/>"<ref refid="arx_8h" kindref="compound" tooltip="Bayesian Filtering for generalized autoregressive (ARX) model.">arx.h</ref>"</highlight><highlight class="normal"></highlight></codeline> |
---|
132 | <codeline lineno="2"><highlight class="normal"></highlight></codeline> |
---|
133 | <codeline lineno="3"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline> |
---|
134 | <codeline lineno="4"><highlight class="normal"></highlight></codeline> |
---|
135 | <codeline lineno="5" refid="classARX_1ba82c956ca893826811aefe1e4af465d" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classARX_1ba82c956ca893826811aefe1e4af465d" kindref="member" tooltip="Here .">ARX::bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&dt<sp/>)<sp/>{</highlight></codeline> |
---|
136 | <codeline lineno="6"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>lnc;</highlight></codeline> |
---|
137 | <codeline lineno="7"><highlight class="normal"></highlight></codeline> |
---|
138 | <codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classARX_1e467144efb0a5acbc10dba4eff8638fe" kindref="member" tooltip="forgetting factor">frg</ref><1.0)<sp/>{</highlight></codeline> |
---|
139 | <codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX_12291297861dd74ca0175a01f910a0ef7" kindref="member" tooltip="cached value of est.V">V</ref>*=<ref refid="classARX_1e467144efb0a5acbc10dba4eff8638fe" kindref="member" tooltip="forgetting factor">frg</ref>;</highlight></codeline> |
---|
140 | <codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX_1a4182c281098b2d86b62518a7493d9be" kindref="member" tooltip="cached value of est.nu">nu</ref>*=<ref refid="classARX_1e467144efb0a5acbc10dba4eff8638fe" kindref="member" tooltip="forgetting factor">frg</ref>;</highlight></codeline> |
---|
141 | <codeline lineno="11"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classBM_1bf6fb59b30141074f8ee1e2f43d03129" kindref="member" tooltip="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</ref>)<sp/>{</highlight></codeline> |
---|
142 | <codeline lineno="12"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX_16d0cd0f0734aa77cdc5e48f1cf6737ec" kindref="member" tooltip="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</ref><sp/>=<sp/><ref refid="classARX_1691d023662beffa1dda611b416c0e27e" kindref="member" tooltip="Posterior estimate of in the form of Normal-inverse Wishart density.">est</ref>.<ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>();</highlight></codeline> |
---|
143 | <codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
144 | <codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
145 | <codeline lineno="15"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX_12291297861dd74ca0175a01f910a0ef7" kindref="member" tooltip="cached value of est.V">V</ref>.<ref refid="classldmat_10f0f6e083e6d947cf58097ffce3ccd1a" kindref="member">opupdt</ref><sp/>(<sp/>dt,1.0);</highlight></codeline> |
---|
146 | <codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX_1a4182c281098b2d86b62518a7493d9be" kindref="member" tooltip="cached value of est.nu">nu</ref>+=1.0;</highlight></codeline> |
---|
147 | <codeline lineno="17"><highlight class="normal"></highlight></codeline> |
---|
148 | <codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/><ref refid="classBM_1bf6fb59b30141074f8ee1e2f43d03129" kindref="member" tooltip="If true, the filter will compute likelihood of the data record and store it in ll...">evalll</ref><sp/>)<sp/>{</highlight></codeline> |
---|
149 | <codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lnc<sp/>=<sp/><ref refid="classARX_1691d023662beffa1dda611b416c0e27e" kindref="member" tooltip="Posterior estimate of in the form of Normal-inverse Wishart density.">est</ref>.<ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>();</highlight></codeline> |
---|
150 | <codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classBM_15623fef6572a08c2b53b8c87b82dc979" kindref="member" tooltip="Logarithm of marginalized data likelihood.">ll</ref><sp/>=<sp/>lnc<sp/>-<sp/><ref refid="classARX_16d0cd0f0734aa77cdc5e48f1cf6737ec" kindref="member" tooltip="cached value of lognc() in the previous step (used in evaluation of ll )">last_lognc</ref>;</highlight></codeline> |
---|
151 | <codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>last_lognc<sp/>=<sp/>lnc;</highlight></codeline> |
---|
152 | <codeline lineno="22"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX_164ea7c8ff48bf2548bac3e985e24da19" kindref="member" tooltip="total likelihood">tll</ref><sp/>+=<ref refid="classBM_15623fef6572a08c2b53b8c87b82dc979" kindref="member" tooltip="Logarithm of marginalized data likelihood.">ll</ref>;</highlight></codeline> |
---|
153 | <codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
154 | <codeline lineno="24"><highlight class="normal">}</highlight></codeline> |
---|
155 | <codeline lineno="25"><highlight class="normal"></highlight></codeline> |
---|
156 | <codeline lineno="33"><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>egiw_bestbelow<sp/>(<sp/><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>Eg,<sp/><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>Eg0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Egll,<sp/>ivec<sp/>&indeces<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//parameter<sp/>Eg<sp/>is<sp/>a<sp/>copy!</highlight><highlight class="normal"></highlight></codeline> |
---|
157 | <codeline lineno="34"><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/>Vo<sp/>=<sp/>Eg.<ref refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_V</ref>();<sp/></highlight><highlight class="comment">//copy</highlight><highlight class="normal"></highlight></codeline> |
---|
158 | <codeline lineno="35"><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/>Vo0<sp/>=<sp/>Eg.<ref refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_V</ref>();<sp/></highlight><highlight class="comment">//copy</highlight><highlight class="normal"></highlight></codeline> |
---|
159 | <codeline lineno="36"><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/>Vp<sp/>=<sp/>Eg.<ref refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_V</ref>();<sp/></highlight><highlight class="comment">//<sp/>pointer<sp/>into<sp/>Eg</highlight><highlight class="normal"></highlight></codeline> |
---|
160 | <codeline lineno="37"><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/>Vp0<sp/>=<sp/>Eg.<ref refid="classegiw_1533e792e1175bfa06d5d595dc5d080d5" kindref="member" tooltip="returns a pointer to the internal statistics. Use with Care!">_V</ref>();<sp/></highlight><highlight class="comment">//<sp/>pointer<sp/>into<sp/>Eg</highlight><highlight class="normal"></highlight></codeline> |
---|
161 | <codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>end<sp/>=<sp/>Vp.<ref refid="classldmat_196dfb21865db4f5bd36fa70f9b0b1163" kindref="member" tooltip="access function">rows</ref>()-1;</highlight></codeline> |
---|
162 | <codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline> |
---|
163 | <codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Li;</highlight></codeline> |
---|
164 | <codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Li0;</highlight></codeline> |
---|
165 | <codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>maxll=Egll;</highlight></codeline> |
---|
166 | <codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>tmpll=Egll;</highlight></codeline> |
---|
167 | <codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>belll=Egll;</highlight></codeline> |
---|
168 | <codeline lineno="45"><highlight class="normal"></highlight></codeline> |
---|
169 | <codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>tmpindeces;</highlight></codeline> |
---|
170 | <codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>maxindeces=indeces;</highlight></codeline> |
---|
171 | <codeline lineno="48"><highlight class="normal"></highlight></codeline> |
---|
172 | <codeline lineno="49"><highlight class="normal"></highlight></codeline> |
---|
173 | <codeline lineno="50"><highlight class="normal">cout<sp/><<<sp/></highlight><highlight class="stringliteral">"bb:("</highlight><highlight class="normal"><sp/><<<sp/>indeces<sp/><<</highlight><highlight class="stringliteral">")<sp/>ll="</highlight><highlight class="normal"><sp/><<<sp/>Egll<sp/><<endl;</highlight></codeline> |
---|
174 | <codeline lineno="51"><highlight class="normal"></highlight></codeline> |
---|
175 | <codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//try<sp/>to<sp/>remove<sp/>only<sp/>one<sp/>rv</highlight><highlight class="normal"></highlight></codeline> |
---|
176 | <codeline lineno="53"><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<end;i++<sp/>)<sp/>{</highlight></codeline> |
---|
177 | <codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//copy<sp/>original</highlight><highlight class="normal"></highlight></codeline> |
---|
178 | <codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Li<sp/>=<sp/>Vo.<ref refid="classldmat_15f44f100248c6627314afaa653b9e5bd" kindref="member" tooltip="Access functions.">_L</ref>();</highlight></codeline> |
---|
179 | <codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Li0<sp/>=<sp/>Vo0.<ref refid="classldmat_15f44f100248c6627314afaa653b9e5bd" kindref="member" tooltip="Access functions.">_L</ref>();</highlight></codeline> |
---|
180 | <codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//remove<sp/>stuff</highlight><highlight class="normal"></highlight></codeline> |
---|
181 | <codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Li.del_col<sp/>(<sp/>i+1<sp/>);</highlight></codeline> |
---|
182 | <codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Li0.del_col<sp/>(<sp/>i+1<sp/>);</highlight></codeline> |
---|
183 | <codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Vp.<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general into pure .">ldform</ref><sp/>(<sp/>Li,Vo.<ref refid="classldmat_1282c879f50aa9ef934e7f46d86881582" kindref="member" tooltip="Access functions.">_D</ref>()<sp/>);</highlight></codeline> |
---|
184 | <codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Vp0.<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general into pure .">ldform</ref><sp/>(<sp/>Li0,Vo0.<ref refid="classldmat_1282c879f50aa9ef934e7f46d86881582" kindref="member" tooltip="Access functions.">_D</ref>()<sp/>);</highlight></codeline> |
---|
185 | <codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpll<sp/>=<sp/>Eg.<ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>()-Eg0.<ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>();<sp/></highlight><highlight class="comment">//<sp/>likelihood<sp/>is<sp/>difference<sp/>of<sp/>norm.<sp/>coefs.</highlight><highlight class="normal"></highlight></codeline> |
---|
186 | <codeline lineno="63"><highlight class="normal"></highlight></codeline> |
---|
187 | <codeline lineno="64"><highlight class="normal">cout<sp/><<<sp/></highlight><highlight class="stringliteral">"i=("</highlight><highlight class="normal"><sp/><<<sp/>i<sp/><<</highlight><highlight class="stringliteral">")<sp/>ll="</highlight><highlight class="normal"><sp/><<<sp/>tmpll<sp/><<endl;</highlight></codeline> |
---|
188 | <codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
189 | <codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
190 | <codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>tmpll<sp/>><sp/>Egll<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//increase<sp/>of<sp/>the<sp/>likelihood</highlight><highlight class="normal"></highlight></codeline> |
---|
191 | <codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpindeces<sp/>=<sp/>indeces;</highlight></codeline> |
---|
192 | <codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpindeces.del<sp/>(<sp/>i<sp/>);</highlight></codeline> |
---|
193 | <codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//search<sp/>for<sp/>a<sp/>better<sp/>match<sp/>in<sp/>this<sp/>substructure</highlight><highlight class="normal"></highlight></codeline> |
---|
194 | <codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>belll=egiw_bestbelow<sp/>(<sp/>Eg,<sp/>Eg0,<sp/>tmpll,<sp/>tmpindeces<sp/>);</highlight></codeline> |
---|
195 | <codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>belll>maxll<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//better<sp/>match<sp/>found</highlight><highlight class="normal"></highlight></codeline> |
---|
196 | <codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>maxll<sp/>=<sp/>belll;</highlight></codeline> |
---|
197 | <codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>maxindeces<sp/>=<sp/>tmpindeces;</highlight></codeline> |
---|
198 | <codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
199 | <codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
200 | <codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
201 | <codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>indeces<sp/>=<sp/>maxindeces;</highlight></codeline> |
---|
202 | <codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>maxll;</highlight></codeline> |
---|
203 | <codeline lineno="80"><highlight class="normal">}</highlight></codeline> |
---|
204 | <codeline lineno="81"><highlight class="normal"></highlight></codeline> |
---|
205 | <codeline lineno="82" refid="classARX_1130bb7336aac681ce14b027b8f1409fa" refkind="member"><highlight class="normal">ivec<sp/><ref refid="classARX_1130bb7336aac681ce14b027b8f1409fa" kindref="member" tooltip="Brute force structure estimation.">ARX::structure_est</ref><sp/>(<sp/><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>est0<sp/>)<sp/>{</highlight></codeline> |
---|
206 | <codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>ind=linspace<sp/>(<sp/>1,<ref refid="classBM_1af00f0612fabe66241dd507188cdbf88" kindref="member" tooltip="Random variable of the posterior.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()-1<sp/>);</highlight></codeline> |
---|
207 | <codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>egiw_bestbelow<sp/>(<sp/><ref refid="classARX_1691d023662beffa1dda611b416c0e27e" kindref="member" tooltip="Posterior estimate of in the form of Normal-inverse Wishart density.">est</ref>,<sp/>est0,<sp/><ref refid="classARX_1691d023662beffa1dda611b416c0e27e" kindref="member" tooltip="Posterior estimate of in the form of Normal-inverse Wishart density.">est</ref>.<ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>()-<sp/>est0.<ref refid="classegiw_170eb1a0b88459b227f919b425b0d3359" kindref="member" tooltip="logarithm of the normalizing constant, ">lognc</ref>(),<sp/>ind<sp/>);</highlight></codeline> |
---|
208 | <codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ind;</highlight></codeline> |
---|
209 | <codeline lineno="86"><highlight class="normal">}</highlight></codeline> |
---|
210 | </programlisting> |
---|
211 | <location file="/home/smidl/work/git/mixpp/bdm/estim/arx.cpp"/> |
---|
212 | </compounddef> |
---|
213 | </doxygen> |
---|