Changeset 450 for library/tests

Show
Ignore:
Timestamp:
07/29/09 15:39:19 (15 years ago)
Author:
vbarta
Message:

removed enorm<sq_T>::sample(int) - now spelled sample_m, inherited

Location:
library/tests
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • library/tests/enorm.cfg

    r444 r450  
    1616  support = ( "matrix", 2, 2, [ -5.0, 5.0, -5.0, 5.0 ] ); 
    1717  integral = 1.0; 
     18  R = ( "matrix", 2, 2, [ 1.0, -0.5, -0.5, 2.0 ] ); 
    1819}, 
    1920{ 
  • library/tests/enorm_test.cpp

    r448 r450  
    5656    } 
    5757} 
    58  
    59 TEST(test_enorm_sample) { 
    60     RNG_randomize(); 
    61  
    62     // Setup model 
    63     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  
    3434        enorm<ldmat> eN; 
    3535        eN.set_parameters(mu0,R); 
    36         mat Smp = eN.sample(N); 
     36        mat Smp = eN.sample_m(N); 
    3737 
    3838        disp(mu0,R.to_mat(),Smp);