[261] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 3 | <title>mixpp: Example of ARX model estimation</title> |
---|
| 4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 5 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
| 6 | </head><body> |
---|
| 7 | <!-- Generated by Doxygen 1.5.6 --> |
---|
| 8 | <div class="navigation" id="top"> |
---|
| 9 | <div class="tabs"> |
---|
| 10 | <ul> |
---|
| 11 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
| 12 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
| 13 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
| 14 | <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
---|
| 15 | <li><a href="classes.html"><span>Classes</span></a></li> |
---|
| 16 | <li><a href="files.html"><span>Files</span></a></li> |
---|
| 17 | </ul> |
---|
| 18 | </div> |
---|
[271] | 19 | <div class="navpath"><a class="el" href="manual.html">User Manual</a> |
---|
| 20 | </div> |
---|
[261] | 21 | </div> |
---|
| 22 | <div class="contents"> |
---|
| 23 | <h1><a class="anchor" name="arx">Example of ARX model estimation </a></h1>Here, we use the <code>ARX</code> class to estimate parameters and structure. ARX model is defined as follows: <p class="formulaDsp"> |
---|
| 24 | <img class="formulaDsp" alt="\[ y_t = \theta' \psi_t + \rho e_t \]" src="form_101.png"> |
---|
| 25 | <p> |
---|
| 26 | where <img class="formulaInl" alt="$y_t$" src="form_94.png"> is the system output, <img class="formulaInl" alt="$[\theta,\rho]$" src="form_95.png"> is vector of unknown parameters, <img class="formulaInl" alt="$\psi_t$" src="form_102.png"> is an vector of data-dependent regressors, and noise <img class="formulaInl" alt="$e_t$" src="form_54.png"> is assumed to be Normal distributed <img class="formulaInl" alt="$\mathcal{N}(0,1)$" src="form_97.png">.<p> |
---|
| 27 | Special cases include:...<h2><a class="anchor" name="math"> |
---|
| 28 | Mathematical background:</a></h2> |
---|
| 29 | This particular model belongs to the exponential family, hence it has conjugate distribution of the Gauss-inverse-Wishart form (class egiw). See, [reference] for details.<p> |
---|
| 30 | For this model, structure estimation is a form of model selection procedure. Specifically, we compare hypotheses that the data were generated by the full model with hypotheses that some regressors in vector <img class="formulaInl" alt="$\psi$" src="form_67.png"> are redundant. The number of possible hypotheses is then the number of all possible combinations of all regressors.<h2><a class="anchor" name="soft"> |
---|
| 31 | Software implementation:</a></h2> |
---|
| 32 | Estimation with this class of model is perfromed by class ARX which is derived from class BMEF (estimation of exponential family). The posterior density ( ARX::_epdf() ) is class egiw, which represents Gauss-inverse-Wishart density.<p> |
---|
| 33 | Structure estimation is implemented in method ARX::structure_est() which uses brute force tree search approach.<h2><a class="anchor" name="exa"> |
---|
| 34 | Examples of Use:</a></h2> |
---|
| 35 | There are many ways how to use the object.<ul> |
---|
[271] | 36 | <li>Pure C++, see below, or unit testing file of class ARX, <a class="el" href="arx__test_8cpp.html">arx_test.cpp</a>.</li><li>C++ application <code>estimator</code> with UI configuration file, <a class="el" href="arx_ui.html">Running experiment <code>estimator</code> with ARX data fields</a>.</li><li>Matlab .mex file <code>estimator</code> with UI configuration file, <a class="el" href="arx_ui.html">Running experiment <code>estimator</code> with ARX data fields</a>.</li></ul> |
---|
| 37 | <p> |
---|
| 38 | The easiest way how to use class ARX 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> |
---|
| 39 | <span class="keyword">using namespace </span>bdm; |
---|
| 40 | |
---|
| 41 | <span class="comment">// estimation of AR(0) model</span> |
---|
| 42 | <span class="keywordtype">int</span> main() { |
---|
| 43 | <span class="comment">//prior </span> |
---|
| 44 | mat V0 = 0.00001*eye(2); V0(0,0)= 0.1; <span class="comment">//</span> |
---|
| 45 | ARX Ar; |
---|
| 46 | Ar.set_statistics(1, V0); <span class="comment">//nu is default (set to have finite moments)</span> |
---|
| 47 | <span class="comment">// forgetting is default: 1.0</span> |
---|
| 48 | mat Data = concat_vertical( randn(1,100), ones(1,100) ); |
---|
| 49 | Ar.bayesB( Data); |
---|
| 50 | |
---|
| 51 | cout << <span class="stringliteral">"Expected value of Theta is: "</span> << Ar.posterior().mean() <<endl; |
---|
| 52 | } |
---|
| 53 | </pre></div><p> |
---|
| 54 | Here, it is assumed that </div> |
---|
| 55 | <hr size="1"><address style="text-align: right;"><small>Generated on Sun Feb 15 21:43:51 2009 for mixpp by |
---|
[261] | 56 | <a href="http://www.doxygen.org/index.html"> |
---|
| 57 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> |
---|
| 58 | </body> |
---|
| 59 | </html> |
---|