| 8 | <script type="text/javascript"> |
| 9 | <!-- |
| 10 | function changeDisplayState (e){ |
| 11 | var num=this.id.replace(/[^[0-9]/g,''); |
| 12 | var button=this.firstChild; |
| 13 | var sectionDiv=document.getElementById('dynsection'+num); |
| 14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
| 15 | sectionDiv.style.display='block'; |
| 16 | button.src='open.gif'; |
| 17 | }else{ |
| 18 | sectionDiv.style.display='none'; |
| 19 | button.src='closed.gif'; |
| 20 | } |
| 21 | } |
| 22 | function initDynSections(){ |
| 23 | var divs=document.getElementsByTagName('div'); |
| 24 | var sectionCounter=1; |
| 25 | for(var i=0;i<divs.length-1;i++){ |
| 26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
| 27 | var header=divs[i]; |
| 28 | var section=divs[i+1]; |
| 29 | var button=header.firstChild; |
| 30 | if (button!='IMG'){ |
| 31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
| 32 | button=document.createElement('img'); |
| 33 | divs[i].insertBefore(button,divs[i].firstChild); |
| 34 | } |
| 35 | header.style.cursor='pointer'; |
| 36 | header.onclick=changeDisplayState; |
| 37 | header.id='dynheader'+sectionCounter; |
| 38 | button.src='closed.gif'; |
| 39 | section.id='dynsection'+sectionCounter; |
| 40 | section.style.display='none'; |
| 41 | section.style.marginLeft='14px'; |
| 42 | sectionCounter++; |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | window.onload = initDynSections; |
| 47 | --> |
| 48 | </script> |
36 | | <p><center><img src="classbdm_1_1ARX__inherit__graph.png" border="0" usemap="#bdm_1_1ARX__inherit__map" alt="Inheritance graph"></center> |
37 | | <map name="bdm_1_1ARX__inherit__map"> |
38 | | <area shape="rect" href="classbdm_1_1BMEF.html" title="Estimator for Exponential family." alt="" coords="15,161,108,188"><area shape="rect" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities." alt="" coords="23,84,100,111"><area shape="rect" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects." alt="" coords="5,7,117,33"></map> |
39 | | <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> |
| 76 | |
| 77 | <p><center><img src="classbdm_1_1ARX.png" usemap="#bdm::ARX_map" border="0" alt=""></center> |
| 78 | <map name="bdm::ARX_map"> |
| 79 | <area href="classbdm_1_1BMEF.html" alt="bdm::BMEF" shape="rect" coords="0,112,86,136"> |
| 80 | <area href="classbdm_1_1BM.html" alt="bdm::BM" shape="rect" coords="0,56,86,80"> |
| 81 | <area href="classbdm_1_1bdmroot.html" alt="bdm::bdmroot" shape="rect" coords="0,0,86,24"> |
| 82 | </map> |
| 83 | </div> |
52 | | Extension for time-variant parameters <img class="formulaInl" alt="$\theta_t,r_t$" src="form_55.png"> may be achived using exponential forgetting (Kulhavy and Zarrop, 1993). In such a case, the forgetting factor <code>frg</code> <img class="formulaInl" alt="$\in <0,1>$" src="form_56.png"> should be given in the constructor. Time-invariant parameters are estimated for <code>frg</code> = 1. <table border="0" cellpadding="0" cellspacing="0"> |
| 96 | See <a class="el" href="tut_arx.html">Theory of ARX model estimation</a> for mathematical treatment.<p> |
| 97 | The easiest way how to use the class is: <div class="fragment"><pre class="fragment"><span class="preprocessor">#include <<a class="code" href="arx_8h.html" title="Bayesian Filtering for generalized autoregressive (ARX) model.">estim/arx.h</a>></span> |
| 98 | <span class="keyword">using namespace </span>bdm; |
| 99 | |
| 100 | <span class="comment">// estimation of AR(0) model</span> |
| 101 | <span class="keywordtype">int</span> main() { |
| 102 | <span class="comment">//prior </span> |
| 103 | mat V0 = 0.00001*eye(2); V0(0,0)= 0.1; <span class="comment">//</span> |
| 104 | ARX Ar; |
| 105 | Ar.set_statistics(1, V0); <span class="comment">//nu is default (set to have finite moments)</span> |
| 106 | <span class="comment">// forgetting is default: 1.0</span> |
| 107 | mat Data = concat_vertical( randn(1,100), ones(1,100) ); |
| 108 | Ar.bayesB( Data); |
| 109 | |
| 110 | cout << <span class="stringliteral">"Expected value of Theta is: "</span> << Ar.posterior().mean() <<endl; |
| 111 | } |
| 112 | </pre></div> <table border="0" cellpadding="0" cellspacing="0"> |
55 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="43ed6114f04a3a8756fe2b42eaa35f98"></a><!-- doxytag: member="bdm::ARX::ARX" ref="43ed6114f04a3a8756fe2b42eaa35f98" args="(const double frg0=1.0)" --> |
56 | | </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1ARX.html#43ed6114f04a3a8756fe2b42eaa35f98">ARX</a> (const double frg0=1.0)</td></tr> |
57 | | |
58 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Full constructor. <br></td></tr> |
59 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="73a55a3d66bfbeeee4df6c2ae40920ed"></a><!-- doxytag: member="bdm::ARX::ARX" ref="73a55a3d66bfbeeee4df6c2ae40920ed" args="(const ARX &A0)" --> |
60 | | </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1ARX.html#73a55a3d66bfbeeee4df6c2ae40920ed">ARX</a> (const <a class="el" href="classbdm_1_1ARX.html">ARX</a> &A0)</td></tr> |
61 | | |
62 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <br></td></tr> |
63 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="60c40b5c6abc4c7e464b4ccae64a5a61"></a><!-- doxytag: member="bdm::ARX::_copy_" ref="60c40b5c6abc4c7e464b4ccae64a5a61" args="()" --> |
64 | | <a class="el" href="classbdm_1_1ARX.html">ARX</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1ARX.html#60c40b5c6abc4c7e464b4ccae64a5a61">_copy_</a> ()</td></tr> |
65 | | |
66 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Auxiliary function. <br></td></tr> |
67 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cab0a1de5355b1027d24fd3d4862c9b0"></a><!-- doxytag: member="bdm::ARX::set_parameters" ref="cab0a1de5355b1027d24fd3d4862c9b0" args="(const ldmat &V0, const double &nu0)" --> |
68 | | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1ARX.html#cab0a1de5355b1027d24fd3d4862c9b0">set_parameters</a> (const <a class="el" href="classldmat.html">ldmat</a> &V0, const double &nu0)</td></tr> |
69 | | |
70 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set sufficient statistics. <br></td></tr> |
74 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">get statistics from another model <br></td></tr> |
75 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1974409e022ea1efb3404b5c2fde66ad"></a><!-- doxytag: member="bdm::ARX::get_parameters" ref="1974409e022ea1efb3404b5c2fde66ad" args="(mat &V0, double &nu0)" --> |
76 | | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1ARX.html#1974409e022ea1efb3404b5c2fde66ad">get_parameters</a> (mat &V0, double &nu0)</td></tr> |
77 | | |
78 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns sufficient statistics. <br></td></tr> |
| 118 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set sufficient statistics. <br></td></tr> |
| 119 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5912dbcf28ae711e30b08c2fa766a3e6"></a><!-- doxytag: member="bdm::ARX::_copy_" ref="5912dbcf28ae711e30b08c2fa766a3e6" args="(bool changerv=false)" --> |
| 120 | <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BMEF.html#5912dbcf28ae711e30b08c2fa766a3e6">_copy_</a> (bool changerv=false)</td></tr> |
| 121 | |
| 122 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flatten the posterior as if to keep nu0 data. <br></td></tr> |
| 123 | <tr><td colspan="2"><div class="groupHeader">Constructors</div></td></tr> |
| 124 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="43ed6114f04a3a8756fe2b42eaa35f98"></a><!-- doxytag: member="bdm::ARX::ARX" ref="43ed6114f04a3a8756fe2b42eaa35f98" args="(const double frg0=1.0)" --> |
| 125 | </td><td class="memItemRight" valign="bottom"><b>ARX</b> (const double frg0=1.0)</td></tr> |
| 126 | |
| 127 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="73a55a3d66bfbeeee4df6c2ae40920ed"></a><!-- doxytag: member="bdm::ARX::ARX" ref="73a55a3d66bfbeeee4df6c2ae40920ed" args="(const ARX &A0)" --> |
| 128 | </td><td class="memItemRight" valign="bottom"><b>ARX</b> (const <a class="el" href="classbdm_1_1ARX.html">ARX</a> &A0)</td></tr> |
| 129 | |
| 130 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classbdm_1_1ARX.html">ARX</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1ARX.html#60c40b5c6abc4c7e464b4ccae64a5a61">_copy_</a> ()</td></tr> |
| 131 | |
| 132 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7aef6fe827f15427d534e6fb2c220e04"></a><!-- doxytag: member="bdm::ARX::set_parameters" ref="7aef6fe827f15427d534e6fb2c220e04" args="(double frg0)" --> |
| 133 | void </td><td class="memItemRight" valign="bottom"><b>set_parameters</b> (double frg0)</td></tr> |
| 134 | |
| 135 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f859f53eab269845a9064bbd92f841af"></a><!-- doxytag: member="bdm::ARX::set_statistics" ref="f859f53eab269845a9064bbd92f841af" args="(int dimx0, const ldmat V0, double nu0=-1.0)" --> |
| 136 | void </td><td class="memItemRight" valign="bottom"><b>set_statistics</b> (int dimx0, const <a class="el" href="classldmat.html">ldmat</a> V0, double nu0=-1.0)</td></tr> |
| 137 | |
| 138 | <tr><td colspan="2"><div class="groupHeader">Mathematical operations</div></td></tr> |
115 | | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5912dbcf28ae711e30b08c2fa766a3e6"></a><!-- doxytag: member="bdm::ARX::_copy_" ref="5912dbcf28ae711e30b08c2fa766a3e6" args="(bool changerv=false)" --> |
116 | | <a class="el" href="classbdm_1_1BMEF.html">BMEF</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1BMEF.html#5912dbcf28ae711e30b08c2fa766a3e6">_copy_</a> (bool changerv=false)</td></tr> |
117 | | |
118 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Flatten the posterior as if to keep nu0 data. <br></td></tr> |
| 173 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5a96a50d212648f049122a31d9553618"></a><!-- doxytag: member="bdm::ARX::posterior" ref="5a96a50d212648f049122a31d9553618" args="() const " --> |
| 174 | const <a class="el" href="classbdm_1_1egiw.html">egiw</a> & </td><td class="memItemRight" valign="bottom"><b>posterior</b> () const </td></tr> |
| 175 | |
| 176 | <tr><td colspan="2"><div class="groupHeader">Connection</div></td></tr> |
| 177 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="df3dc1b90efc0cc54a3a6e5e858542d1"></a><!-- doxytag: member="bdm::ARX::set_drv" ref="df3dc1b90efc0cc54a3a6e5e858542d1" args="(const RV &drv0)" --> |
| 178 | void </td><td class="memItemRight" valign="bottom"><b>set_drv</b> (const <a class="el" href="classbdm_1_1RV.html">RV</a> &drv0)</td></tr> |
| 179 | |
| 180 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7b96872783ab72e135b7b9ee26ef0577"></a><!-- doxytag: member="bdm::ARX::get_yrv" ref="7b96872783ab72e135b7b9ee26ef0577" args="()" --> |
| 181 | <a class="el" href="classbdm_1_1RV.html">RV</a> & </td><td class="memItemRight" valign="bottom"><b>get_yrv</b> ()</td></tr> |
| 182 | |
| 246 | <a class="anchor" name="60c40b5c6abc4c7e464b4ccae64a5a61"></a><!-- doxytag: member="bdm::ARX::_copy_" ref="60c40b5c6abc4c7e464b4ccae64a5a61" args="()" --> |
| 247 | <div class="memitem"> |
| 248 | <div class="memproto"> |
| 249 | <table class="memname"> |
| 250 | <tr> |
| 251 | <td class="memname"><a class="el" href="classbdm_1_1ARX.html">ARX</a> * bdm::ARX::_copy_ </td> |
| 252 | <td>(</td> |
| 253 | <td class="paramname"> </td> |
| 254 | <td> ) </td> |
| 255 | <td><code> [virtual]</code></td> |
| 256 | </tr> |
| 257 | </table> |
| 258 | </div> |
| 259 | <div class="memdoc"> |
| 260 | |
| 261 | <p> |
| 262 | Copy function required in vectors, Arrays of <a class="el" href="classbdm_1_1BM.html" title="Bayesian Model of a system, i.e. all uncertainty is modeled by probabilities.">BM</a> etc. Have to be DELETED manually! Prototype: <div class="fragment"><pre class="fragment"> BM* <a class="code" href="classbdm_1_1ARX.html#60c40b5c6abc4c7e464b4ccae64a5a61">_copy_</a>(){<span class="keywordflow">return</span> <span class="keyword">new</span> BM(*<span class="keyword">this</span>);} |
| 263 | </pre></div> |
| 264 | <p>Reimplemented from <a class="el" href="classbdm_1_1BM.html#c0f027ff91d8459937c6f60ff8e553ff">bdm::BM</a>.</p> |
| 265 | |
| 266 | </div> |
| 267 | </div><p> |
227 | | <p>References <a class="el" href="libEF_8h-source.html#l00204">bdm::egiw::_nu()</a>, <a class="el" href="libEF_8h-source.html#l00202">bdm::egiw::_V()</a>, <a class="el" href="arx_8h-source.html#l00038">est</a>, <a class="el" href="libBM_8h-source.html#l00583">bdm::BM::evalll</a>, <a class="el" href="libEF_8h-source.html#l00077">bdm::BMEF::frg</a>, <a class="el" href="libEF_8h-source.html#l00079">bdm::BMEF::last_lognc</a>, <a class="el" href="libEF_8cpp-source.html#l00044">bdm::egiw::lognc()</a>, <a class="el" href="arx_8h-source.html#l00042">nu</a>, <a class="el" href="libDC_8cpp-source.html#l00058">ldmat::opupdt()</a>, <a class="el" href="libEF_8h-source.html#l00197">bdm::egiw::pow()</a>, and <a class="el" href="arx_8h-source.html#l00040">V</a>.</p> |
| 319 | <p>References <a class="el" href="libEF_8h-source.html#l00204">bdm::egiw::_nu()</a>, <a class="el" href="libEF_8h-source.html#l00202">bdm::egiw::_V()</a>, <a class="el" href="arx_8h-source.html#l00047">est</a>, <a class="el" href="libBM_8h-source.html#l00603">bdm::BM::evalll</a>, <a class="el" href="libEF_8h-source.html#l00077">bdm::BMEF::frg</a>, <a class="el" href="libEF_8h-source.html#l00079">bdm::BMEF::last_lognc</a>, <a class="el" href="libEF_8cpp-source.html#l00044">bdm::egiw::lognc()</a>, <a class="el" href="arx_8h-source.html#l00051">nu</a>, <a class="el" href="libDC_8cpp-source.html#l00058">ldmat::opupdt()</a>, <a class="el" href="libEF_8h-source.html#l00197">bdm::egiw::pow()</a>, and <a class="el" href="arx_8h-source.html#l00049">V</a>.</p> |
254 | | <p>References <a class="el" href="libBM_8h-source.html#l00272">bdm::epdf::dimension()</a>, <a class="el" href="arx_8h-source.html#l00038">est</a>, <a class="el" href="libEF_8cpp-source.html#l00107">bdm::egiw::mean_mat()</a>, <a class="el" href="libDC_8h-source.html#l00289">ldmat::rows()</a>, <a class="el" href="libEF_8h-source.html#l00762">bdm::mlnorm< sq_T >::set_parameters()</a>, and <a class="el" href="arx_8h-source.html#l00040">V</a>.</p> |
| 346 | <p>References <a class="el" href="libBM_8h-source.html#l00281">bdm::epdf::dimension()</a>, <a class="el" href="arx_8h-source.html#l00047">est</a>, <a class="el" href="libEF_8cpp-source.html#l00107">bdm::egiw::mean_mat()</a>, <a class="el" href="libDC_8h-source.html#l00289">ldmat::rows()</a>, <a class="el" href="libEF_8h-source.html#l00776">bdm::mlnorm< sq_T >::set_parameters()</a>, and <a class="el" href="arx_8h-source.html#l00049">V</a>.</p> |
279 | | <p>References <a class="el" href="libBM_8h-source.html#l00272">bdm::epdf::dimension()</a>, <a class="el" href="bdm_2estim_2arx_8cpp-source.html#l00132">bdm::egiw_bestbelow()</a>, <a class="el" href="arx_8h-source.html#l00038">est</a>, and <a class="el" href="libEF_8cpp-source.html#l00044">bdm::egiw::lognc()</a>.</p> |
280 | | |
| 371 | <p>References <a class="el" href="libBM_8h-source.html#l00281">bdm::epdf::dimension()</a>, <a class="el" href="arx_8h-source.html#l00047">est</a>, and <a class="el" href="libEF_8cpp-source.html#l00044">bdm::egiw::lognc()</a>.</p> |
| 372 | |
| 373 | </div> |
| 374 | </div><p> |
| 375 | <hr><h2>Member Data Documentation</h2> |
| 376 | <a class="anchor" name="363aaa55b2ab3eec602510cdf53e84ef"></a><!-- doxytag: member="bdm::ARX::_yrv" ref="363aaa55b2ab3eec602510cdf53e84ef" args="" --> |
| 377 | <div class="memitem"> |
| 378 | <div class="memproto"> |
| 379 | <table class="memname"> |
| 380 | <tr> |
| 381 | <td class="memname"><a class="el" href="classbdm_1_1RV.html">RV</a> <a class="el" href="classbdm_1_1ARX.html#363aaa55b2ab3eec602510cdf53e84ef">bdm::ARX::_yrv</a><code> [protected]</code> </td> |
| 382 | </tr> |
| 383 | </table> |
| 384 | </div> |
| 385 | <div class="memdoc"> |
| 386 | |
| 387 | <p> |
| 388 | description of modelled data <img class="formulaInl" alt="$ y_t $" src="form_118.png"> in the likelihood function Do NOT access directly, only via <code>get_yrv()</code>. |