Revision 386, 0.7 kB
(checked in by mido, 15 years ago)
|
possibly broken? 4th part
|
-
Property svn:eol-style set to
native
|
Rev | Line | |
---|
[262] | 1 | |
---|
[386] | 2 | #include "stat/exp_family.h" |
---|
[32] | 3 | |
---|
[254] | 4 | using namespace bdm; |
---|
[32] | 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 | |
---|
[162] | 16 | RV rv ( "{x }","2" ); |
---|
[32] | 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; |
---|
[270] | 22 | enorm<fsqmat> eN;eN.set_rv ( rv ); |
---|
[32] | 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 ); |
---|
[214] | 33 | suma+= exp(eN.evallog ( pom )); |
---|
[32] | 34 | } |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | cout << suma <<endl; |
---|
| 38 | |
---|
| 39 | //Exit program: |
---|
| 40 | return 0; |
---|
| 41 | |
---|
| 42 | } |
---|