Revision 278, 0.7 kB
(checked in by smidl, 16 years ago)
|
props
|
-
Property svn:eol-style set to
native
|
Line | |
---|
1 | |
---|
2 | #include <stat/libEF.h> |
---|
3 | |
---|
4 | using namespace bdm; |
---|
5 | |
---|
6 | //These lines are needed for use of cout and endl |
---|
7 | using std::cout; |
---|
8 | using std::endl; |
---|
9 | |
---|
10 | |
---|
11 | int 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;eN.set_rv ( 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 | } |
---|