- Timestamp:
- 08/03/09 10:56:48 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/epdf_harness.cpp
r465 r466 85 85 if (R.rows() > 0) { 86 86 mat smp = hepdf->sample_m(nsamples); 87 int n = smp.cols(); 88 vec emu = smp * ones(n) / n; 89 mat er = (smp * smp.T()) / n - outer_product(emu, emu); 87 vec emu = smp * ones(nsamples) / nsamples; 88 mat er = (smp * smp.T()) / nsamples - outer_product(emu, emu); 90 89 91 90 vec delta = sqrt(variance) / sqrt(nsamples); … … 106 105 mprod mEp(aa); 107 106 108 int n = nsamples; 109 mat smp = mEp.samplecond(vec(0), n); 110 vec emu = sum(smp, 2) / n; 111 CHECK_CLOSE_EX(mean, emu, tolerance); 107 mat smp = mEp.samplecond(vec(0), nsamples); 108 vec emu = sum(smp, 2) / nsamples; 109 110 vec delta = sqrt(variance) / sqrt(nsamples); 111 CHECK_CLOSE_EX(mean, emu, delta); 112 112 113 113 if (R.rows() > 0) { 114 mat er = (smp * smp.T()) / n - outer_product(emu, emu);114 mat er = (smp * smp.T()) / nsamples - outer_product(emu, emu); 115 115 CHECK_CLOSE_EX(R, er, tolerance); 116 116 }