|
Revision 116, 0.7 kB
(checked in by smidl, 17 years ago)
|
|
MEX linking with bdm
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | #include "../../bdm/estim/arx.h" |
|---|
| 2 | |
|---|
| 3 | using namespace itpp; |
|---|
| 4 | |
|---|
| 5 | int main() { |
|---|
| 6 | it_file itf("DD"); |
|---|
| 7 | // Convert input variables to IT++ format |
|---|
| 8 | mat Data; |
|---|
| 9 | itf >> Name("DD") >> Data; |
|---|
| 10 | |
|---|
| 11 | // ------------------ Start of routine --------------------------- |
|---|
| 12 | int ndat=Data.cols(); |
|---|
| 13 | int npsi=Data.rows(); |
|---|
| 14 | RV thr ( "1","{ theta_r }",vec_1 ( npsi ),vec_1 ( 0 ) ); |
|---|
| 15 | |
|---|
| 16 | mat V0=1e-8*eye ( npsi ); //V0 ( 0,0 ) *=1.0; |
|---|
| 17 | double nu0=3; |
|---|
| 18 | ARX Ar ( thr,V0,nu0 ); |
|---|
| 19 | // estimate |
|---|
| 20 | for (int i=0;i<ndat;i++ ) {Ar.bayes ( Data.get_col ( i ) ); } |
|---|
| 21 | |
|---|
| 22 | vec th = Ar._epdf().mean(); |
|---|
| 23 | |
|---|
| 24 | // ------------------ End of routine ----------------------------- |
|---|
| 25 | |
|---|
| 26 | cout << th <<endl; |
|---|
| 27 | |
|---|
| 28 | double ll=Ar._ll(); |
|---|
| 29 | cout << ll <<endl; |
|---|
| 30 | |
|---|
| 31 | ivec str = Ar.structure_est ( egiw ( thr,V0,nu0 ) ); |
|---|
| 32 | cout << str <<endl; |
|---|
| 33 | } |
|---|