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="sim__var__arx_8cpp" kind="file"> |
---|
4 | <compoundname>sim_var_arx.cpp</compoundname> |
---|
5 | <includes local="no">itpp/itbase.h</includes> |
---|
6 | <includes refid="arx_8h" local="no">estim/arx.h</includes> |
---|
7 | <includes refid="loggers_8h" local="no">stat/loggers.h</includes> |
---|
8 | <incdepgraph> |
---|
9 | <node id="677"> |
---|
10 | <label>stat/loggers.h</label> |
---|
11 | <link refid="loggers_8h"/> |
---|
12 | <childnode refid="670" relation="include"> |
---|
13 | </childnode> |
---|
14 | <childnode refid="673" relation="include"> |
---|
15 | </childnode> |
---|
16 | <childnode refid="676" relation="include"> |
---|
17 | </childnode> |
---|
18 | </node> |
---|
19 | <node id="673"> |
---|
20 | <label>libBM.h</label> |
---|
21 | <link refid="libBM_8h"/> |
---|
22 | <childnode refid="670" relation="include"> |
---|
23 | </childnode> |
---|
24 | </node> |
---|
25 | <node id="676"> |
---|
26 | <label>../itpp_ext.h</label> |
---|
27 | <link refid="itpp__ext_8h-source"/> |
---|
28 | <childnode refid="670" relation="include"> |
---|
29 | </childnode> |
---|
30 | </node> |
---|
31 | <node id="674"> |
---|
32 | <label>../stat/libEF.h</label> |
---|
33 | <link refid="libEF_8h"/> |
---|
34 | <childnode refid="670" relation="include"> |
---|
35 | </childnode> |
---|
36 | <childnode refid="675" relation="include"> |
---|
37 | </childnode> |
---|
38 | <childnode refid="673" relation="include"> |
---|
39 | </childnode> |
---|
40 | <childnode refid="676" relation="include"> |
---|
41 | </childnode> |
---|
42 | </node> |
---|
43 | <node id="671"> |
---|
44 | <label>estim/arx.h</label> |
---|
45 | <link refid="arx_8h"/> |
---|
46 | <childnode refid="670" relation="include"> |
---|
47 | </childnode> |
---|
48 | <childnode refid="672" relation="include"> |
---|
49 | </childnode> |
---|
50 | <childnode refid="674" relation="include"> |
---|
51 | </childnode> |
---|
52 | </node> |
---|
53 | <node id="672"> |
---|
54 | <label>../stat/libFN.h</label> |
---|
55 | <link refid="libFN_8h-source"/> |
---|
56 | <childnode refid="670" relation="include"> |
---|
57 | </childnode> |
---|
58 | <childnode refid="673" relation="include"> |
---|
59 | </childnode> |
---|
60 | </node> |
---|
61 | <node id="669"> |
---|
62 | <label>work/git/mixpp/pmsm/sim_var_arx.cpp</label> |
---|
63 | <link refid="sim_var_arx.cpp"/> |
---|
64 | <childnode refid="670" relation="include"> |
---|
65 | </childnode> |
---|
66 | <childnode refid="671" relation="include"> |
---|
67 | </childnode> |
---|
68 | <childnode refid="677" relation="include"> |
---|
69 | </childnode> |
---|
70 | </node> |
---|
71 | <node id="670"> |
---|
72 | <label>itpp/itbase.h</label> |
---|
73 | </node> |
---|
74 | <node id="675"> |
---|
75 | <label>../math/libDC.h</label> |
---|
76 | <link refid="libDC_8h"/> |
---|
77 | <childnode refid="670" relation="include"> |
---|
78 | </childnode> |
---|
79 | </node> |
---|
80 | </incdepgraph> |
---|
81 | <sectiondef kind="func"> |
---|
82 | <memberdef kind="function" id="sim__var__arx_8cpp_1b1fe6b48b3275ef1f646350a4fe3fc39" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
83 | <type>vec</type> |
---|
84 | <definition>vec getPsi_a</definition> |
---|
85 | <argsstring>(int t, mat &D, mat &Du, mat &X)</argsstring> |
---|
86 | <name>getPsi_a</name> |
---|
87 | <param> |
---|
88 | <type>int</type> |
---|
89 | <declname>t</declname> |
---|
90 | </param> |
---|
91 | <param> |
---|
92 | <type>mat &</type> |
---|
93 | <declname>D</declname> |
---|
94 | </param> |
---|
95 | <param> |
---|
96 | <type>mat &</type> |
---|
97 | <declname>Du</declname> |
---|
98 | </param> |
---|
99 | <param> |
---|
100 | <type>mat &</type> |
---|
101 | <declname>X</declname> |
---|
102 | </param> |
---|
103 | <briefdescription> |
---|
104 | </briefdescription> |
---|
105 | <detaileddescription> |
---|
106 | </detaileddescription> |
---|
107 | <inbodydescription> |
---|
108 | </inbodydescription> |
---|
109 | <location file="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" line="20" bodyfile="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" bodystart="80" bodyend="90"/> |
---|
110 | </memberdef> |
---|
111 | <memberdef kind="function" id="sim__var__arx_8cpp_14f3629067a336e659e88e55c7a93bc21" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
112 | <type>vec</type> |
---|
113 | <definition>vec getPsi_b</definition> |
---|
114 | <argsstring>(int t, mat &D, mat &Du, mat &X)</argsstring> |
---|
115 | <name>getPsi_b</name> |
---|
116 | <param> |
---|
117 | <type>int</type> |
---|
118 | <declname>t</declname> |
---|
119 | </param> |
---|
120 | <param> |
---|
121 | <type>mat &</type> |
---|
122 | <declname>D</declname> |
---|
123 | </param> |
---|
124 | <param> |
---|
125 | <type>mat &</type> |
---|
126 | <declname>Du</declname> |
---|
127 | </param> |
---|
128 | <param> |
---|
129 | <type>mat &</type> |
---|
130 | <declname>X</declname> |
---|
131 | </param> |
---|
132 | <briefdescription> |
---|
133 | </briefdescription> |
---|
134 | <detaileddescription> |
---|
135 | </detaileddescription> |
---|
136 | <inbodydescription> |
---|
137 | </inbodydescription> |
---|
138 | <location file="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" line="21" bodyfile="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" bodystart="92" bodyend="102"/> |
---|
139 | </memberdef> |
---|
140 | <memberdef kind="function" id="sim__var__arx_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
141 | <type>int</type> |
---|
142 | <definition>int main</definition> |
---|
143 | <argsstring>()</argsstring> |
---|
144 | <name>main</name> |
---|
145 | <briefdescription> |
---|
146 | </briefdescription> |
---|
147 | <detaileddescription> |
---|
148 | </detaileddescription> |
---|
149 | <inbodydescription> |
---|
150 | </inbodydescription> |
---|
151 | <location file="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" line="23" bodyfile="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" bodystart="23" bodyend="78"/> |
---|
152 | </memberdef> |
---|
153 | </sectiondef> |
---|
154 | <briefdescription> |
---|
155 | <para>Models for synchronous electric drive using IT++ and BDM. </para> </briefdescription> |
---|
156 | <detaileddescription> |
---|
157 | <para><simplesect kind="author"><para>Vaclav Smidl.</para></simplesect> |
---|
158 | ----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty</para><para>Using IT++ for numerical operations ----------------------------------- </para> </detaileddescription> |
---|
159 | <programlisting> |
---|
160 | <codeline lineno="1"></codeline> |
---|
161 | <codeline lineno="13"><highlight class="preprocessor">#include<sp/><itpp/itbase.h></highlight><highlight class="normal"></highlight></codeline> |
---|
162 | <codeline lineno="14"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="arx_8h" kindref="compound" tooltip="Bayesian Filtering for generalized autoregressive (ARX) model.">estim/arx.h</ref>></highlight><highlight class="normal"></highlight></codeline> |
---|
163 | <codeline lineno="15"><highlight class="normal"></highlight></codeline> |
---|
164 | <codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="loggers_8h" kindref="compound" tooltip="Loggers for storing results of experiments.">stat/loggers.h</ref>></highlight><highlight class="normal"></highlight></codeline> |
---|
165 | <codeline lineno="17"><highlight class="normal"></highlight></codeline> |
---|
166 | <codeline lineno="18"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline> |
---|
167 | <codeline lineno="19"><highlight class="normal"></highlight></codeline> |
---|
168 | <codeline lineno="20"><highlight class="normal">vec<sp/>getPsi_a<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&D,<sp/>mat<sp/>&Du<sp/>,<sp/>mat<sp/>&X<sp/>);</highlight></codeline> |
---|
169 | <codeline lineno="21"><highlight class="normal">vec<sp/>getPsi_b<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&D,<sp/>mat<sp/>&Du<sp/>,<sp/>mat<sp/>&X<sp/>);</highlight></codeline> |
---|
170 | <codeline lineno="22"><highlight class="normal"></highlight></codeline> |
---|
171 | <codeline lineno="23"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="sim__var_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" kindref="member" tooltip="Extended Kalman filter with unknown Q.">main</ref>()<sp/>{</highlight></codeline> |
---|
172 | <codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Kalman<sp/>filter</highlight><highlight class="normal"></highlight></codeline> |
---|
173 | <codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Ndat<sp/>=<sp/>90000;</highlight></codeline> |
---|
174 | <codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>D;</highlight></codeline> |
---|
175 | <codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Du;</highlight></codeline> |
---|
176 | <codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>X;</highlight></codeline> |
---|
177 | <codeline lineno="29"><highlight class="normal"></highlight></codeline> |
---|
178 | <codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdirfilelog" kindref="compound" tooltip="Logging into dirfile with buffer in memory.">dirfilelog</ref><sp/>L<sp/>(<sp/></highlight><highlight class="stringliteral">"exp/sim_var_arx"</highlight><highlight class="normal">,1000<sp/>);</highlight></codeline> |
---|
179 | <codeline lineno="31"><highlight class="normal"></highlight></codeline> |
---|
180 | <codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_file<sp/>itf<sp/>(<sp/></highlight><highlight class="stringliteral">"sim_var.it"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
181 | <codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>itf<sp/>>><sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">"D"</highlight><highlight class="normal"><sp/>)<sp/>>><sp/>D;</highlight></codeline> |
---|
182 | <codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>itf<sp/>>><sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">"Du"</highlight><highlight class="normal"><sp/>)<sp/>>><sp/>Du;</highlight></codeline> |
---|
183 | <codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>itf<sp/>>><sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">"X"</highlight><highlight class="normal"><sp/>)<sp/>>><sp/>X;</highlight></codeline> |
---|
184 | <codeline lineno="36"><highlight class="normal"></highlight></codeline> |
---|
185 | <codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array<std::string><sp/>Names<sp/>=<sp/></highlight><highlight class="stringliteral">"{ia<sp/>ib<sp/>om<sp/>dom<sp/>r<sp/>}"</highlight><highlight class="normal">;</highlight></codeline> |
---|
186 | <codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rglen<sp/>=<sp/>Names.length();</highlight></codeline> |
---|
187 | <codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Regressor</highlight><highlight class="normal"></highlight></codeline> |
---|
188 | <codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rgr<sp/>(<sp/>Names<sp/>);</highlight></codeline> |
---|
189 | <codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>V0<sp/>=<sp/>0.0001*eye<sp/>(<sp/>rglen<sp/>);<sp/>V0<sp/>(<sp/>0,0<sp/>)<sp/>=200;</highlight></codeline> |
---|
190 | <codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu0<sp/>=<sp/>rglen+1;</highlight></codeline> |
---|
191 | <codeline lineno="43"><highlight class="normal"></highlight></codeline> |
---|
192 | <codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Autoregressive<sp/>model</highlight><highlight class="normal"></highlight></codeline> |
---|
193 | <codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX" kindref="compound" tooltip="Linear Autoregressive model with Gaussian noise.">ARX</ref><sp/>Ar_a<sp/>(<sp/>rgr,V0,nu0<sp/>,0.95<sp/>);</highlight></codeline> |
---|
194 | <codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX" kindref="compound" tooltip="Linear Autoregressive model with Gaussian noise.">ARX</ref><sp/>Ar_b<sp/>(<sp/>rgr,V0,nu0<sp/>,0.95<sp/>);</highlight></codeline> |
---|
195 | <codeline lineno="47"><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>&<sp/>pA=<sp/>Ar_a._epdf();</highlight></codeline> |
---|
196 | <codeline lineno="48"><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>&<sp/>pB=<sp/>Ar_b._epdf();</highlight></codeline> |
---|
197 | <codeline lineno="49"><highlight class="normal"></highlight></codeline> |
---|
198 | <codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rta<sp/>(<sp/></highlight><highlight class="stringliteral">"{th_a<sp/>}"</highlight><highlight class="normal">,vec_1<sp/>(<sp/>rglen<sp/>)<sp/>);</highlight></codeline> |
---|
199 | <codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rtb<sp/>(<sp/></highlight><highlight class="stringliteral">"{th_b<sp/>}"</highlight><highlight class="normal">,vec_1<sp/>(<sp/>rglen<sp/>)<sp/>);</highlight></codeline> |
---|
200 | <codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>tha_log<sp/>=<sp/>L.add<sp/>(<sp/>rta,</highlight><highlight class="stringliteral">""</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
201 | <codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>thb_log<sp/>=<sp/>L.add<sp/>(<sp/>rtb,</highlight><highlight class="stringliteral">""</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
202 | <codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.init();</highlight></codeline> |
---|
203 | <codeline lineno="55"><highlight class="normal"></highlight></codeline> |
---|
204 | <codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Psi<sp/>(<sp/>rglen<sp/>);</highlight></codeline> |
---|
205 | <codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Save<sp/>(<sp/>13<sp/>);</highlight></codeline> |
---|
206 | <codeline lineno="58"><highlight class="normal"><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/>t=2;<sp/>t<Ndat;<sp/>t++<sp/>)<sp/>{</highlight></codeline> |
---|
207 | <codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>=getPsi_a<sp/>(<sp/>t,<sp/>D,Du<sp/>,X<sp/>);</highlight></codeline> |
---|
208 | <codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar_a.bayes<sp/>(<sp/>Psi<sp/>);</highlight></codeline> |
---|
209 | <codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>=getPsi_b<sp/>(<sp/>t,<sp/>D,Du<sp/>,X<sp/>);</highlight></codeline> |
---|
210 | <codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar_b.bayes<sp/>(<sp/>Psi<sp/>);</highlight></codeline> |
---|
211 | <codeline lineno="63"><highlight class="normal"></highlight></codeline> |
---|
212 | <codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Save<sp/>=<sp/>pA.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>();</highlight></codeline> |
---|
213 | <codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.logit<sp/>(<sp/>tha_log,<sp/>Save<sp/>);</highlight></codeline> |
---|
214 | <codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Save<sp/>=<sp/>pB.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>();</highlight></codeline> |
---|
215 | <codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.logit<sp/>(<sp/>thb_log,<sp/>Save<sp/>);</highlight></codeline> |
---|
216 | <codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.step();</highlight></codeline> |
---|
217 | <codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
218 | <codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.finalize();</highlight></codeline> |
---|
219 | <codeline lineno="71"><highlight class="normal"></highlight></codeline> |
---|
220 | <codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>bestind<sp/>=<sp/>Ar_a.structure_est<sp/>(<sp/><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>(<sp/>rgr,V0,nu0<sp/>)<sp/>);</highlight></codeline> |
---|
221 | <codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>bestind2<sp/>=<sp/>Ar_b.structure_est<sp/>(<sp/><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>(<sp/>rgr,V0,nu0<sp/>)<sp/>);</highlight></codeline> |
---|
222 | <codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/><<<sp/>bestind<sp/><<endl;</highlight></codeline> |
---|
223 | <codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/><<<sp/>bestind2<sp/><<endl;</highlight></codeline> |
---|
224 | <codeline lineno="76"><highlight class="normal"></highlight></codeline> |
---|
225 | <codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline> |
---|
226 | <codeline lineno="78"><highlight class="normal">}</highlight></codeline> |
---|
227 | <codeline lineno="79"><highlight class="normal"></highlight></codeline> |
---|
228 | <codeline lineno="80"><highlight class="normal">vec<sp/>getPsi_a<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&D,<sp/>mat<sp/>&Du,<sp/>mat<sp/>&X<sp/>)<sp/>{</highlight></codeline> |
---|
229 | <codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Psi<sp/>(<sp/>5<sp/>);</highlight></codeline> |
---|
230 | <codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>0<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,0<sp/>)-Du<sp/>(<sp/>t,0<sp/>);<sp/></highlight><highlight class="comment">//<sp/>a=0</highlight><highlight class="normal"></highlight></codeline> |
---|
231 | <codeline lineno="83"><highlight class="normal"></highlight></codeline> |
---|
232 | <codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>1<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,2<sp/>);</highlight></codeline> |
---|
233 | <codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>2<sp/>)<sp/>=<sp/>D(t,2)-D(t-1,2<sp/>);</highlight></codeline> |
---|
234 | <codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>3<sp/>)<sp/>=<sp/>D(t,0)-D(t-1,0<sp/>);</highlight></codeline> |
---|
235 | <codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>4<sp/>)<sp/>=<sp/>X<sp/>(<sp/>t,2<sp/>)<sp/>-<sp/>X<sp/>(<sp/>t-1,2<sp/>);</highlight></codeline> |
---|
236 | <codeline lineno="88"><highlight class="normal"></highlight></codeline> |
---|
237 | <codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>Psi;</highlight></codeline> |
---|
238 | <codeline lineno="90"><highlight class="normal">}</highlight></codeline> |
---|
239 | <codeline lineno="91"><highlight class="normal"></highlight></codeline> |
---|
240 | <codeline lineno="92"><highlight class="normal">vec<sp/>getPsi_b<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&D,<sp/>mat<sp/>&Du,<sp/>mat<sp/>&X<sp/>)<sp/>{</highlight></codeline> |
---|
241 | <codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Psi<sp/>(<sp/>5<sp/>);</highlight></codeline> |
---|
242 | <codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>0<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,1<sp/>)-Du<sp/>(<sp/>t,1<sp/>);<sp/></highlight><highlight class="comment">//b=1</highlight><highlight class="normal"></highlight></codeline> |
---|
243 | <codeline lineno="95"><highlight class="normal"></highlight></codeline> |
---|
244 | <codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>1<sp/>)<sp/>=<sp/>D(t,3);</highlight></codeline> |
---|
245 | <codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>2<sp/>)<sp/>=<sp/>D(t,3)-D(t-1,3<sp/>);</highlight></codeline> |
---|
246 | <codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>3<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,1<sp/>)-D(t-1,1);</highlight></codeline> |
---|
247 | <codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>4<sp/>)<sp/>=<sp/>X<sp/>(<sp/>t,2<sp/>)<sp/>-<sp/>X<sp/>(<sp/>t-1,2<sp/>);</highlight></codeline> |
---|
248 | <codeline lineno="100"><highlight class="normal"></highlight></codeline> |
---|
249 | <codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>Psi;</highlight></codeline> |
---|
250 | <codeline lineno="102"><highlight class="normal">}</highlight></codeline> |
---|
251 | </programlisting> |
---|
252 | <location file="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp"/> |
---|
253 | </compounddef> |
---|
254 | </doxygen> |
---|