46 | | vec rgr ( 3 ); |
47 | | |
48 | | mat Tmp ( 2 * n, n ); |
49 | | |
50 | | double summ = 0.0; |
51 | | for ( int k = 0; k < n; k++ ) { // ALL b |
52 | | rgr ( 1 ) = 1 + k * ( 1.0 / n ) * 4.0; |
53 | | for ( int i = 0; i < 2*n; i++ ) { //ALL mu |
54 | | rgr ( 0 ) = -2 + i * ( 1.0 / n ) * 3.0; |
55 | | for ( int j = 0; j < n; j++ ) { // All sigma |
56 | | rgr ( 2 ) = ( j + 1 ) * ( 1.0 / n ) * 2.0; |
57 | | |
58 | | Tmp ( i, j ) = E.evallog ( rgr ); |
59 | | } |
60 | | } |
61 | | summ += sumsum ( exp ( Tmp ) ) / n / n / n * 3.0 * 2.0 * 4.0; |
| 47 | rectangular_support Sup; |
| 48 | Sup.set_parameters("{[-2.,4.], [1.,5.], [0.,2.]} ", n*ones_i(E.dimension())); |
| 49 | |
| 50 | double summ = exp(E.evallog(Sup.first_vec())); |
| 51 | // sum all likelihood at all points of support |
| 52 | for ( int k = 1; k < Sup.points(); k++ ) { // ALL b |
| 53 | summ += exp (E.evallog(Sup.next_vec())); |