Changeset 450 for library/tests
- Timestamp:
- 07/29/09 15:39:19 (16 years ago)
- Location:
- library/tests
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/enorm.cfg
r444 r450 16 16 support = ( "matrix", 2, 2, [ -5.0, 5.0, -5.0, 5.0 ] ); 17 17 integral = 1.0; 18 R = ( "matrix", 2, 2, [ 1.0, -0.5, -0.5, 2.0 ] ); 18 19 }, 19 20 { -
library/tests/enorm_test.cpp
r448 r450 56 56 } 57 57 } 58 59 TEST(test_enorm_sample) {60 RNG_randomize();61 62 // Setup model63 vec mu("1.1 -1");64 ldmat R(mat("1 -0.5; -0.5 2"));65 66 RV x("{x }");67 RV y("{y }");68 69 enorm<ldmat> E;70 E.set_rv(concat(x, y));71 E.set_parameters(mu, R);72 73 int n = 1000;74 vec ll(n);75 mat smp = E.sample(1000);76 vec emu = sum(smp, 2) / n;77 CHECK_CLOSE(mu, emu, 0.3);78 79 mat er = (smp * smp.T()) / n - outer_product(emu, emu);80 CHECK_CLOSE(R.to_mat(), er, 0.3);81 } -
library/tests/testSmp.cpp
r394 r450 34 34 enorm<ldmat> eN; 35 35 eN.set_parameters(mu0,R); 36 mat Smp = eN.sample (N);36 mat Smp = eN.sample_m(N); 37 37 38 38 disp(mu0,R.to_mat(),Smp);