root/library/tests/tutorial/arx_simple.cpp @ 1323

Revision 1323, 0.5 kB (checked in by smidl, 13 years ago)

arx simple is now 2nd order

  • Property svn:eol-style set to native
Line 
1#include "estim/arx.h"
2using namespace bdm;
3
4// estimation of AR(0) model
5int main() {
6    //prior
7    mat V0 = 0.00001 * eye ( 3 );
8    V0 ( 0, 0 ) = 0.1; //
9    ARX Ar;
10    Ar.set_statistics ( 1, V0 ); //nu is default (set to have finite moments)
11    Ar.set_constant ( false );
12    Ar.validate();
13    // forgetting is default: 1.0
14    Ar.bayes_batch ( randn ( 1, 3400 ), randn(2,3400) );
15
16    cout << "Expected value of Theta is: " << Ar.posterior().mean() << endl;
17    cout << "NC of posterior: " << Ar.posterior().lognc() << endl;
18}
Note: See TracBrowser for help on using the browser.