Changeset 522 for library/tests/emix_test.cpp
- Timestamp:
- 08/13/09 12:21:38 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/emix_test.cpp
r520 r522 14 14 static void check_covariance ( emix &distrib_obj, int nsamples, const mat &R, double tolerance); 15 15 16 TEST ( test_emix_ old) {17 RV x ( "{ x }" );18 RV y ( "{ y }" );16 TEST ( test_emix_1 ) { 17 RV x ( "{emixx }" ); 18 RV y ( "{emixy }" ); 19 19 RV xy = concat ( x, y ); 20 20 vec mu0 ( "1.00054 1.0455" ); … … 89 89 } 90 90 91 TEST ( test_emix_2 ) { 92 int N = 10000; //number of samples 93 vec mu0 ( "1.5 1.7" ); 94 mat V0 ( "1.2 0.3; 0.3 5" ); 95 ldmat R = ldmat ( V0 ); 96 97 shared_ptr<enorm<ldmat> > eN = new enorm<ldmat>(); 98 eN->set_parameters ( mu0, R ); 99 100 vec a = "100000,10000"; 101 vec b = a / 10.0; 102 shared_ptr<egamma> eG = new egamma(); 103 eG->set_parameters ( a, b ); 104 105 emix eMix; 106 Array<shared_ptr<epdf> > Coms ( 2 ); 107 Coms ( 0 ) = eG; 108 Coms ( 1 ) = eN; 109 110 eMix.set_parameters ( vec_2 ( 0.5, 0.5 ), Coms ); 111 check_mean ( eMix, N, eMix.mean(), 0.1 ); 112 } 113 91 114 static void check_mean ( emix &distrib_obj, int nsamples, const vec &mean, double tolerance ) { 92 115 int tc = 0;