Changeset 299 for mpdm/TR2244

Show
Ignore:
Timestamp:
03/19/09 15:38:55 (16 years ago)
Author:
smidl
Message:

merger - cull de sac :-(

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mpdm/TR2244/merger_iter_cond.cpp

    r297 r299  
    3333 
    3434        merger M ( A ); 
    35         enorm<fsqmat> g0; g0.set_rv ( all ); 
    36         g0.set_parameters ( vec ( "1 -1 1" ),3*eye ( 3 ));// +1*ones ( 3,3 ) ); 
     35        M.debug_file("iter_cond_debug.it"); 
     36        enorm<ldmat> g0; g0.set_rv ( all ); 
     37        mat Cov=0.3*eye ( 3 ); 
     38        Cov(1,2)=0.29; 
     39        Cov(2,1)=0.29; 
     40        g0.set_parameters ( vec ( "1 1 1" ),Cov);// +1*ones ( 3,3 ) ); 
    3741 
     42        enorm<ldmat>* teste=g0.marginal(concat(u1,u2)); 
     43        mlnorm<ldmat>* testm=(mlnorm<ldmat>*)teste->condition(u2); 
     44         
    3845        M.set_parameters ( 1.2,1000,1 ); 
     46         
     47        Array<vec> YUU(3);  
     48        YUU(0)=linspace(-2.9,3.1,20); 
     49        YUU(1)=linspace(-5,5,20); 
     50        YUU(2)=linspace(-3,3,20); 
    3951 
    40         int Ntrials=100; 
     52        M.set_grid(YUU); 
     53         
     54        int Ntrials=1; 
    4155        vec A1s ( Ntrials ); 
    4256        vec A2s ( Ntrials ); 
     
    5165                MixEF &MM = M._Mix(); 
    5266                epdf* MP = MM._Coms ( 0 )->epredictor ( ); 
     67                MP->set_rv(all); 
    5368 
    5469                RV yu1 = y; yu1.add ( u1 ); 
     
    6681                C2s(it) = P2c->_mu_const()(0); 
    6782 
     83                cout << "mean: " << MM._Coms(0)->_e()->mean() <<endl; 
    6884        } 
     85         
     86         
     87         
     88        cout << "A1s:" <<A1s<<endl; 
     89        cout << "C2s:" <<C2s<<endl; 
    6990        double A1mean = sum(A1s)/Ntrials; 
    7091        double A2mean = sum(A2s)/Ntrials; 
     
    7394        double R1mean = sum(R1s)/Ntrials; 
    7495        double R2mean = sum(R2s)/Ntrials; 
    75         cout << "A1: " << A1mean << " +- " << 2*(sum_sqr(A1s)/Ntrials-A1mean*A1mean) <<endl; 
    76         cout << "A2: " << A2mean << " +- " << 2*(sum_sqr(A2s)/Ntrials-A2mean*A2mean) <<endl; 
    77         cout << "C1: " << C1mean << " +- " << 2*(sum_sqr(C1s)/Ntrials-C1mean*C1mean) <<endl; 
    78         cout << "C2: " << C2mean << " +- " << 2*(sum_sqr(C2s)/Ntrials-C2mean*C2mean) <<endl; 
    79         cout << "R1: " << R1mean << " +- " << 2*(sum_sqr(R1s)/Ntrials-R1mean*R1mean) <<endl; 
    80         cout << "R2: " << R2mean << " +- " << 2*(sum_sqr(R2s)/Ntrials-R2mean*R2mean) <<endl; 
     96        cout << "A1: " << A1mean << " +- " << 2*sqrt(sum_sqr(A1s)/Ntrials-A1mean*A1mean) <<endl; 
     97        cout << "A2: " << A2mean << " +- " << 2*sqrt(sum_sqr(A2s)/Ntrials-A2mean*A2mean) <<endl; 
     98        cout << "C1: " << C1mean << " +- " << 2*sqrt(sum_sqr(C1s)/Ntrials-C1mean*C1mean) <<endl; 
     99        cout << "C2: " << C2mean << " +- " << 2*sqrt(sum_sqr(C2s)/Ntrials-C2mean*C2mean) <<endl; 
     100        cout << "R1: " << R1mean << " +- " << 2*sqrt(sum_sqr(R1s)/Ntrials-R1mean*R1mean) <<endl; 
     101        cout << "R2: " << R2mean << " +- " << 2*sqrt(sum_sqr(R2s)/Ntrials-R2mean*R2mean) <<endl; 
    81102}