Changeset 270 for mpdm/merg_pred.cpp
- Timestamp:
- 02/16/09 10:02:08 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
mpdm/merg_pred.cpp
r254 r270 31 31 32 32 //ARX constructor 33 mat V0 = 0.001*eye ( thri. count() ); V0 ( 0,0 ) *= 10; //34 mat V0g = 0.001*eye ( thrg. count() ); V0g ( 0,0 ) *= 10; //33 mat V0 = 0.001*eye ( thri._dsize() ); V0 ( 0,0 ) *= 10; // 34 mat V0g = 0.001*eye ( thrg._dsize() ); V0g ( 0,0 ) *= 10; // 35 35 double nu0 = ord+6.0; 36 36 double frg = 0.95; 37 37 38 ARX P1 ( thri, V0, nu0,frg );39 ARX P2 ( thri, V0, nu0,frg );40 ARX PG ( thrg, V0g, nu0,frg );38 ARX P1; P1.set_statistics( 2, V0, nu0); P1.set_parameters(frg ); 39 ARX P2;P1.set_statistics(2, V0, nu0); P2.set_parameters( frg ); 40 ARX PG;PG.set_statistics(3, V0g, nu0);; PG.set_parameters( frg ); 41 41 //Test estimation 42 42 int ndat = 200; … … 59 59 60 60 Yt.set_subvector ( 0,randn ( ord ) ); //initial values 61 vec rgrg ( thrg. count() -1 ); // constant terms are in!62 vec rgr1 ( thri. count() -1 );63 vec rgr2 ( thri. count() -1 );61 vec rgrg ( thrg._dsize() -1 ); // constant terms are in! 62 vec rgr1 ( thri._dsize() -1 ); 63 vec rgr2 ( thri._dsize() -1 ); 64 64 65 65 vec PredLLs ( 5 ); … … 83 83 // Test predictors 84 84 if ( t>2 ) { 85 mlnorm<ldmat>* P1p = P1.predictor ( y,concat ( ym,u1 ) );86 mlnorm<ldmat>* P2p = P2.predictor ( y,concat ( ym,u2 ) );87 mlnorm<ldmat>* Pgp = PG.predictor ( y,concat ( ym,uu ) );85 mlnorm<ldmat>* P1p = P1.predictor();// ( y,concat ( ym,u1 ) ); 86 mlnorm<ldmat>* P2p = P2.predictor();// ( y,concat ( ym,u2 ) ); 87 mlnorm<ldmat>* Pgp = PG.predictor();// ( y,concat ( ym,uu ) ); 88 88 89 89 Array<mpdf*> A ( 2 ); A ( 0 ) =P1p;A ( 1 ) =P2p; 90 90 merger M ( A ); 91 enorm<ldmat> g0 ( concat ( yy,uu ) ); g0.set_parameters ( "0 0 0 0 ",3*eye ( 4 ) );91 enorm<ldmat> g0;g0.set_rv ( concat ( yy,uu ) ); g0.set_parameters ( "0 0 0 0 ",3*eye ( 4 ) ); 92 92 M.set_parameters ( 1e8, 101,1 ); 93 93 M.merge ( &g0 ); … … 107 107 { 108 108 ARX* Apred = ( ARX* ) M._Mix()._Coms ( 0 ); 109 enorm<ldmat>* MP= Apred-> predictor( concat ( yy,uu ) );109 enorm<ldmat>* MP= Apred->epredictor ();//( concat ( yy,uu ) ); 110 110 enorm<ldmat>* mP1p = ( enorm<ldmat>* ) MP->marginal ( concat ( yy,u1 ) ); 111 111 enorm<ldmat>* mP2p = ( enorm<ldmat>* ) MP->marginal ( concat ( yy,u2 ) );