Changeset 679 for library/bdm/estim/particles.h
- Timestamp:
- 10/23/09 00:05:25 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/particles.h
r676 r679 93 93 return eff < ( res_threshold*n ); 94 94 } 95 void bayes ( const vec & dt);95 void bayes ( const vec &yt, const vec &cond ); 96 96 //!access function 97 97 vec& __w() { return _w; } … … 131 131 u.add(obs_u); // join both u, and check if they do not overlap 132 132 133 set_ drv(concat(obs->_rv(),u) );133 set_yrv(concat(obs->_rv(),u) ); 134 134 } 135 135 //! auxiliary function reading parameter 'resmethod' from configuration file … … 296 296 mpfepdf jest; 297 297 298 //! Log means of BMs 299 bool opt_L_mea; 300 298 //! datalink from global yt and cond (Up) to BMs yt and cond (Down) 299 datalink_m2m this2bm; 300 //! datalink from global yt and cond (Up) to PFs yt and cond (Down) 301 datalink_m2m this2pf; 302 301 303 public: 302 304 //! Default constructor. … … 320 322 }; 321 323 322 void bayes ( const vec & dt);324 void bayes ( const vec &yt, const vec &cond ); 323 325 const epdf& posterior() const { 324 326 return jest; … … 328 330 void set_options ( const string &opt ) { 329 331 BM::set_options(opt); 330 opt_L_mea = ( opt.find ( "logmeans" ) != string::npos );331 332 } 332 333 … … 352 353 353 354 pf = new PF; 354 // rpior must be set before BM355 // prior must be set before BM 355 356 pf->prior_from_set(set); 356 357 pf->resmethod_from_set(set); 357 358 pf->set_model(par,obs); 358 359 359 360 shared_ptr<BM> BM0 =UI::build<BM>(set,"BM",UI::compulsory); 360 361 set_BM(*BM0); … … 367 368 //find potential input - what remains in rvc when we subtract rv 368 369 RV u = par->_rvc().remove_time().subt( par->_rv() ); 369 set_ drv(concat(BM0->_drv(),u) );370 set_yrv(concat(BM0->_yrv(),u) ); 370 371 validate(); 371 372 } … … 377 378 } 378 379 jest.read_parameters(); 379 for ( int i = 0; i < pf->__w().length(); i++ ) { 380 BMs ( i )->condition ( pf->posterior()._sample ( i ) ); 381 } 380 this2bm.set_connection(BMs(0)->_yrv(), BMs(0)->_rvc(), yrv, rvc); 381 this2bm.set_connection(pf->_yrv(), pf->_rvc(), yrv, rvc); 382 382 } 383 383