- Timestamp:
- 11/13/08 20:00:53 (16 years ago)
- Location:
- tests
- Files:
-
- 11 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/arx_elem_test.cpp
r201 r211 40 40 41 41 mlstudent* Ap = Ar.predictor_student(RV("{y }"),RV("{1 }")); 42 vec Ap_x=Ap->eval cond_m(X,vec_1(1.0));42 vec Ap_x=Ap->evallogcond_m(X,vec_1(1.0)); 43 43 vec ll_x = Ar.logpred_m(X2); 44 44 -
tests/arx_test.cpp
r198 r211 41 41 cout << "y: " << Yt(t) << endl; 42 42 mlstudent* Pr = Ar.predictor_student(RV("{y }"),RV("{y1 y2 y3 y4 }")); 43 cout << Ar._ll() <<" , " << log(Pr->eval cond(vec_1(Yt(t)),rgr)) <<endl;43 cout << Ar._ll() <<" , " << log(Pr->evallogcond(vec_1(Yt(t)),rgr)) <<endl; 44 44 delete Pr; 45 45 } -
tests/blas_test.cpp
r141 r211 6 6 using std::cout; 7 7 using std::endl; 8 9 //#define NDEBUG 8 10 9 11 mat matmul ( mat &A, mat &B ) { -
tests/egiw_test.cpp
r188 r211 44 44 t_val ( 1 ) = Si ( j ); 45 45 46 pdf ( i,j ) =E.eval pdflog ( t_val );46 pdf ( i,j ) =E.evallog ( t_val ); 47 47 } 48 48 } … … 97 97 t_val ( 2 ) = ( j+1 ) * ( 1.0/n ) *2.0; 98 98 99 Tmp ( i,j ) = E.eval pdflog ( t_val );99 Tmp ( i,j ) = E.evallog ( t_val ); 100 100 } 101 101 } -
tests/emix_test.cpp
r203 r211 19 19 for ( double y=yb ( 0 );y<=yb ( 1 );y+=ystep,j++ ) { 20 20 rgr ( 1 ) =y; 21 PPdf ( i,j ) =exp ( ep->eval pdflog ( rgr ) );21 PPdf ( i,j ) =exp ( ep->evallog ( rgr ) ); 22 22 } 23 23 } … … 58 58 cout << *((mlnorm<ldmat>*)Ac) <<endl; 59 59 60 cout << "Mix marg at 0: " << Mm->eval pdflog(vec_1(0.0)) <<endl;61 cout << "ARX marg at 0: " << Am->eval pdflog(vec_1(0.0)) <<endl;62 cout << "Mix cond at 0,0: " << Mc->eval cond(vec_1(0.0),vec_1(0.0)) <<endl;63 cout << "ARX cond at 0,0: " << Ac->eval cond(vec_1(0.0),vec_1(0.0)) <<endl;60 cout << "Mix marg at 0: " << Mm->evallog(vec_1(0.0)) <<endl; 61 cout << "ARX marg at 0: " << Am->evallog(vec_1(0.0)) <<endl; 62 cout << "Mix cond at 0,0: " << Mc->evallogcond(vec_1(0.0),vec_1(0.0)) <<endl; 63 cout << "ARX cond at 0,0: " << Ac->evallogcond(vec_1(0.0),vec_1(0.0)) <<endl; 64 64 65 65 cout << "======== Mixture with two components ==="<<endl; … … 78 78 vec ll2 ( N ); 79 79 mat Smp=M2.sample_m ( N ); 80 ll = M2.eval pdflog_m(Smp);80 ll = M2.evallog_m(Smp); 81 81 82 82 vec Emu = sum ( Smp,2 ) /N; … … 102 102 103 103 for (int j=0; j<N; j++){ 104 ll2(j)=mEp.eval cond (Smp.get_col(j), vec ( 0 ));104 ll2(j)=mEp.evallogcond (Smp.get_col(j), vec ( 0 )); 105 105 } 106 106 it << Name("ll") << ll; -
tests/enorm_test.cpp
r203 r211 19 19 for ( double y=yb ( 0 );y<=yb ( 1 );y+=ystep,j++ ) { 20 20 rgr ( 1 ) =y; 21 PPdf ( i,j ) =exp ( ep->eval pdflog ( rgr ) );21 PPdf ( i,j ) =exp ( ep->evallog ( rgr ) ); 22 22 } 23 23 } … … 73 73 74 74 cout << endl << " test of pdflog at zero "<<endl; 75 cout << "original: " << exp(E.eval pdflog(vec("0 0"))) <<endl;76 cout << "composite: " << mEp.eval cond(vec("0 0"),vec(0)) << endl;75 cout << "original: " << exp(E.evallog(vec("0 0"))) <<endl; 76 cout << "composite: " << mEp.evallogcond(vec("0 0"),vec(0)) << endl; 77 77 } -
tests/merger_2d_test.cpp
r205 r211 52 52 emix* MP = MM.predictor(xy); 53 53 54 vec Res1 = M.eval pdflog_m(Grid);55 mat Res2 = (MP)->eval pdflog_M(Grid);54 vec Res1 = M.evallog_m(Grid); 55 mat Res2 = (MP)->evallog_M(Grid); 56 56 57 57 it_file it("merger_2d_test.it"); … … 60 60 it << Name("Res1") << Res1; 61 61 it << Name("Res2") << Res2; 62 it << Name("S1") << f1.eval pdflog_m(Grid);63 it << Name("S2") << f2.eval pdflog_m(Grid);62 it << Name("S1") << f1.evallog_m(Grid); 63 it << Name("S2") << f2.evallog_m(Grid); 64 64 cout << ((enorm<ldmat>*)(MP->_Coms(0)))->_R().to_mat() << endl; 65 65 } -
tests/merger_iter_test.cpp
r203 r211 54 54 epdf* MP = MM.predictor(xy); 55 55 56 vec Res1 = M.eval pdflog_m(Grid);57 mat Res2 = ((emix*)MP)->eval pdflog_M(Grid);56 vec Res1 = M.evallog_m(Grid); 57 mat Res2 = ((emix*)MP)->evallog_M(Grid); 58 58 59 59 it_file it("merger_iter_test.it"); -
tests/merger_test.cpp
r203 r211 33 33 x_grid.set_row ( 0,linspace ( -10.0, 10.0 ) ); 34 34 35 vec l_f1=f1.eval pdflog_m ( x_grid );35 vec l_f1=f1.evallog_m ( x_grid ); 36 36 37 vec l_f2=f2.eval pdflog_m ( x_grid );37 vec l_f2=f2.evallog_m ( x_grid ); 38 38 mat lW(2,Npoints); 39 39 lW.set_row(0, l_f1); … … 48 48 49 49 vec m2 = M.lognorm_merge(lW); 50 vec mm2 = M.eval pdflog_m(x_grid);50 vec mm2 = M.evallog_m(x_grid); 51 51 52 52 it_file it("merger_test.it"); -
tests/test0.cpp
r170 r211 21 21 "3 4 5 6"); 22 22 vec v = "1 -1 3 -1"; 23 23 24 24 cout << "Test to_mat"<<endl; 25 25 // cout << ld << endl; -
tests/testSmp.cpp
r203 r211 43 43 mlnorm<ldmat> ML(x,x); 44 44 ML.set_parameters(I,zeros(2),R); 45 Smp = ML.samplecond (mu0,lik,N);45 Smp = ML.samplecond_m(mu0,lik,N); 46 46 47 47 disp(mu0,R.to_mat(),Smp); … … 53 53 eG.set_parameters(a,b); 54 54 55 cout << eG.eval pdflog(a)<<endl;55 cout << eG.evallog(a)<<endl; 56 56 Smp = eG.sample_m(N); 57 57 … … 65 65 mG.set_parameters(k); 66 66 67 Smp=mG.samplecond (mu0,lik,N);67 Smp=mG.samplecond_m(mu0,lik,N); 68 68 disp(mu0,pow(mu0,2.0)/k,Smp); 69 69 … … 82 82 mepdf meMix(&eMix); 83 83 84 Smp = meMix.samplecond (mu0,lik,N);84 Smp = meMix.samplecond_m(mu0,lik,N); 85 85 disp(eMix.mean(),zeros(2),Smp); 86 86 … … 94 94 mMix.set_parameters(vec_2(0.5,0.5),mComs); 95 95 96 Smp = mMix.samplecond (mu0,lik,N);96 Smp = mMix.samplecond_m(mu0,lik,N); 97 97 disp(mMix._epdf().mean(),zeros(2),Smp); 98 98