- Timestamp:
- 11/04/08 14:54:34 (16 years ago)
- Location:
- tests
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/arx_test.cpp
r170 r198 14 14 15 15 //Test constructor 16 mat V0 = 0.00001*eye(ord+1); V0(0.0)*= 10 ; //17 double nu0 = ord+ 1;16 mat V0 = 0.00001*eye(ord+1); V0(0.0)*= 100; // 17 double nu0 = ord+4; 18 18 19 19 RV thr("{theta_and_r }",vec_1(ord+1)); … … 22 22 23 23 //Test estimation 24 int ndat = 100 00;24 int ndat = 100; 25 25 int t,j; 26 26 vec Yt(ndat); … … 28 28 Yt.set_subvector(0,randn(ord)); //initial values 29 29 vec rgr(ord); 30 30 31 31 32 cout << Ar_ep.mean()<<endl; … … 37 38 Ar.bayes(Psi); 38 39 LL(t) = Ar._ll(); 40 41 cout << "y: " << Yt(t) << endl; 42 mlstudent* Pr = Ar.predictor_student(RV("{y }"),RV("{y1 y2 y3 y4 }")); 43 cout << Ar._ll() <<" , " << log(Pr->evalcond(vec_1(Yt(t)),rgr)) <<endl; 44 delete Pr; 39 45 } 40 46 cout << Ar_ep.mean()<<endl; -
tests/merger_iter_test.cpp
r193 r198 11 11 int main() { 12 12 13 //RNG_randomize();13 RNG_randomize(); 14 14 15 15 RV x ( "{x }","1" ); … … 19 19 20 20 enorm<fsqmat> f1 ( xy ); 21 enorm<fsqmat> f2 ( x ); 21 enorm<fsqmat> f2 ( xy ); 22 enorm<fsqmat> f3(y); 22 23 23 f1.set_parameters ( "3 2",mat ( "0.5 0; 0 0.5" ) ); 24 f2.set_parameters ( "3",mat ( "0.5" ) ); 24 f1.set_parameters ( "4 3",mat ( "0.4 0.3; 0.3 0.4" ) ); 25 f2.set_parameters ( "1 3",mat ( "0.3 -0.2; -0.2 0.3" ) ); 26 f3.set_parameters ( "2",mat("0.4") ); 25 27 26 Array<mpdf* > A ( 2);28 Array<mpdf* > A ( 3 ); 27 29 mepdf A1(f1); 28 30 mepdf A2(f2); 31 mepdf A3(f3); 29 32 A ( 0 ) =&A1; 30 33 A ( 1 ) =&A2; 34 A ( 2 ) =&A3; 31 35 32 36 int Npoints=100; … … 42 46 merger M ( A ); 43 47 enorm<fsqmat> g0(xy); 44 g0.set_parameters(vec(" 1 1"),mat("1 0; 0 1"));48 g0.set_parameters(vec("4 4"),mat("1 0; 0 1")); 45 49 46 M.set_parameters(1.2, 100,1);50 M.set_parameters(1.2,400,5); 47 51 M.merge(&g0); 48 52 -
tests/merger_test.cpp
r182 r198 11 11 int main() { 12 12 13 RNG_randomize(); 14 13 15 RV x ( "{x }","1" ); 14 16 … … 42 44 g0.set_parameters(vec("0.0"),mat("100.0")); 43 45 44 M.set_parameters(1.2, 1000,3);46 M.set_parameters(1.2,200,3); 45 47 M.merge(&g0); 46 48 … … 49 51 50 52 it_file it("merger_test.it"); 53 it << Name("x_grid") << x_grid; 51 54 it << Name("lf1") << l_f1; 52 55 it << Name("lf2") << l_f2;