root/tests/tutorial/arx_simple.cpp
@
272
| Revision 272, 419 bytes (checked in by smidl, 17 years ago) |
|---|
| Rev | Line | |
|---|---|---|
| [272] | 1 | #include <estim/arx.h> |
| 2 | using namespace bdm; | |
| 3 | ||
| 4 | // estimation of AR(0) model | |
| 5 | int main() { | |
| 6 | //prior | |
| 7 | mat V0 = 0.00001*eye(2); V0(0,0)= 0.1; // | |
| 8 | ARX Ar; | |
| 9 | Ar.set_statistics(1, V0); //nu is default (set to have finite moments) | |
| 10 | // forgetting is default: 1.0 | |
| 11 | mat Data = concat_vertical( randn(1,100), ones(1,100) ); | |
| 12 | Ar.bayesB( Data); | |
| 13 | ||
| 14 | cout << "Expected value of Theta is: " << Ar.posterior().mean() <<endl; | |
| 15 | } |
Note: See TracBrowser
for help on using the browser.
