root/tests/merger_test.cpp @ 176

Revision 176, 0.7 kB (checked in by smidl, 16 years ago)

Corrections to mixtures & merger

Line 
1#include <itpp/itbase.h>
2#include <stat/libEF.h>
3#include <estim/merger.h>
4
5using namespace itpp;
6
7//These lines are needed for use of cout and endl
8using std::cout;
9using std::endl;
10
11int main() {
12
13        RV x ( "{x }","1" );
14
15        enorm<fsqmat> f1 ( x );
16        enorm<fsqmat> f2 ( x );
17
18        f1.set_parameters ( "-5",mat ( "2" ) );
19        f2.set_parameters ( "5",mat ( "10" ) );
20
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;
38//      eEmp res=M.merge(100);
39
40
41}
Note: See TracBrowser for help on using the browser.