Changeset 773
- Timestamp:
- 01/12/10 20:26:03 (15 years ago)
- Location:
- library/bdm/stat
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/stat/exp_family.h
r766 r773 144 144 */ 145 145 void from_setting ( const Setting &root ); 146 void to_setting ( Setting &root ) const ; 147 146 148 void validate() { 147 149 bdm_assert ( mu.length() == R.rows(), "mu and R parameters do not match" ); … … 1535 1537 1536 1538 template<class sq_T> 1539 void enorm<sq_T>::to_setting ( Setting &set ) const { 1540 epdf::to_setting ( set ); //reads rv 1541 UI::save ( mu, set, "mu"); 1542 UI::save ( R.to_mat(), set, "R"); 1543 } 1544 1545 template<class sq_T> 1537 1546 void enorm<sq_T>::dupdate ( mat &v, double nu ) { 1538 1547 // -
library/bdm/stat/merger.cpp
r741 r773 169 169 170 170 vec merger_base::variance() const { 171 const vec &w = eSmp._w(); 172 const Array<vec> &S = eSmp._samples(); 173 174 vec tmp = zeros ( dim ); 175 for ( int i = 0; i < Nsources; i++ ) { 176 tmp += w ( i ) * pow ( S ( i ), 2 ); 177 } 178 return tmp - pow ( mean(), 2 ); 171 return eSmp.variance(); 179 172 } 180 173 181 174 void merger_mix::merge ( ) { 175 if(Npoints<1){ 176 set_support(enorm<fsqmat>(zeros(dim), eye(dim)), 100); 177 } 178 179 bdm_assert(Npoints>0,"No points in support"); 180 bdm_assert(Nsources>0,"No Sources"); 181 182 182 Array<vec> &Smp = eSmp._samples(); //aux 183 183 vec &w = eSmp._w(); //aux … … 250 250 sprintf ( dbg_str, "Mpred_var%d", niter ); 251 251 *dbg_file << Name ( dbg_str ) << Mpred->variance(); 252 252 sprintf ( dbg_str, "Mpred_cov%d", niter ); 253 *dbg_file << Name ( dbg_str ) << covariance(); 254 253 255 254 256 sprintf ( dbg_str, "pdf%d", niter ); … … 350 352 // DEFAULTS FOR MERGER_MIX 351 353 const int merger_mix::DFLT_Ncoms = 10; 352 const double merger_mix::DFLT_effss_coef = 0. 5;353 354 } 354 const double merger_mix::DFLT_effss_coef = 0.9; 355 356 } -
library/bdm/stat/merger.h
r766 r773 271 271 merger_base::from_setting ( set ); 272 272 Ncoms=DFLT_Ncoms; 273 set.lookupValue ( "ncoms", Ncoms);273 UI::get( Ncoms, set, "ncoms", UI::optional ); 274 274 effss_coef=DFLT_effss_coef; 275 set.lookupValue ( "effss_coef", effss_coef);275 UI::get (effss_coef , set, "effss_coef", UI::optional); 276 276 stop_niter=10; 277 set.lookupValue ( "stop_niter", stop_niter ); 277 UI::get ( stop_niter, set,"stop_niter", UI::optional ); 278 279 validate(); 280 } 281 void validate() { 282 bdm_assert(Ncoms>0,"Ncoms too small"); 278 283 } 279 284