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

Revision 722, 478 bytes (checked in by mido, 15 years ago)

astyler run over all test sources
general_suite added
cleanup of \test directory finished

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