root/tests/testEpdf.cpp @ 254

Revision 254, 0.7 kB (checked in by smidl, 15 years ago)

create namespace bdm

Line 
1#include <itpp/itbase.h>
2#include <stat/libEF.h>
3
4using namespace bdm;
5
6//These lines are needed for use of cout and endl
7using std::cout;
8using std::endl;
9
10
11int main() {
12
13        vec x = "-10:0.1:10";
14        vec y = "-10:0.1:10";
15
16        RV rv ( "{x }","2" );
17        vec mu0 = "0.0 0.0";
18        mat V0 ( "5 -0.05; -0.05 5.20" );
19        fsqmat R = fsqmat ( V0 );
20
21        cout << "====== ENorm ====== " <<endl;
22        enorm<fsqmat> eN ( rv );
23        eN.set_parameters ( mu0,R );
24        vec pdf = zeros ( x.length() );
25
26        vec pom ( 2 );
27        double suma=0.0;
28
29        for ( int i=0;i<x.length();i++ ) {
30                for ( int j=0;j<y.length();j++ ) {
31                        pom ( 0 ) = x ( i );
32                        pom ( 1 ) = y ( j );
33                        suma+= exp(eN.evallog ( pom ));
34                }
35        }
36
37        cout << suma <<endl;
38
39        //Exit program:
40        return 0;
41
42}
Note: See TracBrowser for help on using the browser.