Changeset 176 for tests/merger_test.cpp
- Timestamp:
- 10/09/08 11:32:12 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/merger_test.cpp
r168 r176 1 1 #include <itpp/itbase.h> 2 2 #include <stat/libEF.h> 3 #include < stat/merger.h>3 #include <estim/merger.h> 4 4 5 5 using namespace itpp; … … 11 11 int main() { 12 12 13 RV x("{x }","1"); 14 RV y("{y }","1"); 15 RV z("{z }","1"); 13 RV x ( "{x }","1" ); 16 14 17 mlnorm<fsqmat> fx(x,y);18 mlnorm<fsqmat> fy(x,z);15 enorm<fsqmat> f1 ( x ); 16 enorm<fsqmat> f2 ( x ); 19 17 20 fx.set_parameters("1.5",mat("1")); 21 fy.set_parameters("1.3",mat("1")); 22 23 Array<mpdf* > A(2); 24 A(0)=&fx; 25 A(1)=&fy; 18 f1.set_parameters ( "-5",mat ( "2" ) ); 19 f2.set_parameters ( "5",mat ( "10" ) ); 26 20 27 merger M(A); 21 Array<mpdf* > A ( 2 ); 22 A ( 0 ) =&mepdf(f1); 23 A ( 1 ) =&mepdf(f2); 24 25 int Npoints=100; 26 mat x_grid ( 1,Npoints ); 27 x_grid.set_row ( 0,linspace ( -10.0, 10.0 ) ); 28 29 vec l_f1=f1.evalpdflog_m ( x_grid ); 30 31 vec l_f2=f2.evalpdflog_m ( x_grid ); 32 mat lW(2,Npoints); 33 lW.set_row(0, l_f1); 34 lW.set_row(1, l_f2 ); 35 36 merger M ( A ); 37 cout << M.lognorm_merge(lW)<<endl; 28 38 // eEmp res=M.merge(100); 29 30 // cout << res.mean() << endl; 31 //Exit program: 32 return 0; 39 33 40 34 41 }