- Timestamp:
- 02/16/09 10:02:08 (16 years ago)
- Location:
- mpdm
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
mpdm/merg_2a.cpp
r254 r270 39 39 mat V0 = 0.001*eye ( 3 ); V0 ( 0,0 ) = 1; // 40 40 41 ARX P1 ( concat ( ab,r ), V0, -1 ); 42 ARX P2 ( concat ( ac,r ), V0, -1 ); 41 ARX P1; 42 P1.set_statistics(2, V0, -1 ); 43 ARX P2; 44 P2.set_statistics(2, V0, -1 ); 43 45 44 46 //Test estimation … … 62 64 63 65 //Proposal 64 enorm<ldmat> g0 ( ab ); g0.set_parameters ( "1 1 ",mat ( "1 0; 0 1" ) ); 65 egamma g1 ( r ); g1.set_parameters ( "2 ", "2" ); 66 enorm<ldmat> g2 ( c ); g2.set_parameters ( "1 ",mat ( "1" ) ); 66 enorm<ldmat> g0; 67 g0.set_parameters ( "1 1 ",mat ( "1 0; 0 1" ) ); 68 egamma g1; 69 g1.set_parameters ( "2 ", "2" ); 70 enorm<ldmat> g2; 71 g2.set_parameters ( "1 ",mat ( "1" ) ); 67 72 68 73 Array<const epdf*> A ( 3 ); A ( 0 ) = &g0; A ( 1 ) =&g1; A(2) = &g2; -
mpdm/merg_giw.cpp
r254 r270 37 37 mat V0g = 0.001*eye ( 3 ); V0g ( 0,0 ) = 1; // 38 38 39 ARX P1 ( concat ( a1,r ), V0, -1 );40 ARX P2 ( concat ( a2,r ), V0, -1 );41 ARX PG ( all, V0g, -1 ); //or -1?39 ARX P1; P1.set_statistics(2, V0, -1 ); 40 ARX P2; P2.set_statistics(2, V0, -1 ); 41 ARX PG; PG.set_statistics(3, V0g, -1 ); //or -1? 42 42 // ARX PGk ( all, V0g, -1 ); 43 43 … … 63 63 64 64 //Proposal 65 enorm<ldmat> g0 66 egamma g1 ( r ); g1.set_parameters ( "2 ", "2" );67 enorm<ldmat> g2 ( a2 ); g2.set_parameters ( "1 ",mat ( "1" ) );65 enorm<ldmat> g0; g0.set_rv( a1 ); g0.set_parameters ( "1 ",mat ( "1" ) ); 66 egamma g1; g1.set_rv ( r ); g1.set_parameters ( "2 ", "2" ); 67 enorm<ldmat> g2; g2.set_rv ( a2 ); g2.set_parameters ( "1 ",mat ( "1" ) ); 68 68 69 69 Array<const epdf*> A ( 3 ); A ( 0 ) = &g0; A ( 1 ) =&g1; A ( 2 ) = &g2; -
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 ) ); -
mpdm/merger_iter_cond.cpp
r262 r270 21 21 all.add ( u2 ); 22 22 23 mlnorm<fsqmat> f1 ( y ,u1 );24 mlnorm<fsqmat> f2 ( y ,u2 );23 mlnorm<fsqmat> f1; f1.set_rv( y ); f1.set_rvc( u1 ); 24 mlnorm<fsqmat> f2; f2.set_rv( y ); f2.set_rvc( u2 ); 25 25 26 26 //Differneces in constant term are essential … … 33 33 34 34 merger M ( A ); 35 enorm<fsqmat> g0 ( all );35 enorm<fsqmat> g0; g0.set_rv ( all ); 36 36 g0.set_parameters ( vec ( "1 -1 1" ),3*eye ( 3 ));// +1*ones ( 3,3 ) ); 37 37 … … 50 50 51 51 MixEF &MM = M._Mix(); 52 epdf* MP = MM._Coms ( 0 )-> predictor ( all);52 epdf* MP = MM._Coms ( 0 )->epredictor ( ); 53 53 54 54 RV yu1 = y; yu1.add ( u1 );