Changeset 466

Show
Ignore:
Timestamp:
08/03/09 10:56:48 (15 years ago)
Author:
vbarta
Message:

using computed tolerance also when sampling mprod

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/epdf_harness.cpp

    r465 r466  
    8585    if (R.rows() > 0) { 
    8686        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); 
    9089 
    9190        vec delta = sqrt(variance) / sqrt(nsamples); 
     
    106105        mprod mEp(aa); 
    107106 
    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); 
    112112 
    113113        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); 
    115115            CHECK_CLOSE_EX(R, er, tolerance); 
    116116        }