Changeset 299 for mpdm/TR2244
- Timestamp:
- 03/19/09 15:38:55 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
mpdm/TR2244/merger_iter_cond.cpp
r297 r299 33 33 34 34 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 ) ); 37 41 42 enorm<ldmat>* teste=g0.marginal(concat(u1,u2)); 43 mlnorm<ldmat>* testm=(mlnorm<ldmat>*)teste->condition(u2); 44 38 45 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); 39 51 40 int Ntrials=100; 52 M.set_grid(YUU); 53 54 int Ntrials=1; 41 55 vec A1s ( Ntrials ); 42 56 vec A2s ( Ntrials ); … … 51 65 MixEF &MM = M._Mix(); 52 66 epdf* MP = MM._Coms ( 0 )->epredictor ( ); 67 MP->set_rv(all); 53 68 54 69 RV yu1 = y; yu1.add ( u1 ); … … 66 81 C2s(it) = P2c->_mu_const()(0); 67 82 83 cout << "mean: " << MM._Coms(0)->_e()->mean() <<endl; 68 84 } 85 86 87 88 cout << "A1s:" <<A1s<<endl; 89 cout << "C2s:" <<C2s<<endl; 69 90 double A1mean = sum(A1s)/Ntrials; 70 91 double A2mean = sum(A2s)/Ntrials; … … 73 94 double R1mean = sum(R1s)/Ntrials; 74 95 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; 81 102 }