Changeset 850 for library/bdm/estim
- Timestamp:
- 03/04/10 16:41:30 (14 years ago)
- Location:
- library/bdm/estim
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/arx.cpp
r802 r850 225 225 rvc = *rrv; 226 226 227 string opt;228 if ( UI::get ( opt, set, "options", UI::optional ) ) {229 BM::set_options ( opt );230 }231 227 int constant; 232 228 if ( !UI::get ( constant, set, "constant", UI::optional ) ) { … … 265 261 } else { 266 262 est.set_rv ( *rv_par ); 267 } 268 //validate(); 269 } 270 } 271 263 } 264 } 265 266 } 267 -
library/bdm/estim/arx.h
r810 r850 131 131 132 132 void validate() { 133 BMEF::validate(); 134 133 135 //if dimc not set set it from V 134 136 if ( dimc == 0 ) { -
library/bdm/estim/kalman.cpp
r744 r850 429 429 set_yrv ( A ( 0 )->_yrv() ); 430 430 //set_rv(A(0)->_rv()); 431 432 string options; 433 if ( set.lookupValue ( "options", options ) ) 434 set_options ( options ); 435 } 436 437 } 431 } 432 433 } -
library/bdm/estim/kalman.h
r766 r850 293 293 set_parameters ( IM, OM, diag ( dQ ), diag ( dR ) ); 294 294 295 string options;296 if ( UI::get ( options, set, "options" ) )297 set_options ( options );298 295 // pfxu = UI::build<diffbifn>(set, "IM", UI::compulsory); 299 296 // phxu = UI::build<diffbifn>(set, "OM", UI::compulsory); … … 318 315 // phxu->dfdu_cond(mu0, zeros(pfxu->_dimu()), C,true); 319 316 // 320 validate();321 } 317 } 318 322 319 void validate() { 320 KalmanFull::validate(); 321 323 322 // check stats and IM and OM 324 323 } -
library/bdm/estim/particles.cpp
r811 r850 233 233 pf->prior_from_set ( set ); 234 234 pf->resmethod_from_set ( set ); 235 236 string opt; 237 if ( UI::get ( opt, set, "options", UI::optional ) ) { 238 set_options ( opt ); 239 } 240 235 241 236 // read functions g and h 242 237 g=UI::build<fnc>(set,"g"); -
library/bdm/estim/particles.h
r811 r850 26 26 27 27 class PF : public BM { 28 //! Introduces two new options: 29 //! \li weights - meaning that all weightes will be logged 30 //! \li samples - all samples will be also logged 31 LOG_LEVEL(PF,weights,samples); 32 28 33 protected: 29 34 //!number of particles; … … 73 78 }; 74 79 void set_statistics ( const eEmp &epdf0 ) { 75 bdm_assert_debug ( epdf0._rv().equal ( par->_rv() ), "Incompatib elinput" );80 bdm_assert_debug ( epdf0._rv().equal ( par->_rv() ), "Incompatible input" ); 76 81 est = epdf0; 77 82 }; 78 83 //!@} 84 79 85 //! Set posterior density by sampling from epdf0 80 //! Extends original BM::set_options by two more options:81 //! \li logweights - meaning that all weightes will be logged82 //! \li logsamples - all samples will be also logged83 void set_options ( const string &opt ) {84 BM::set_options ( opt );85 }86 86 //! bayes I - generate samples and add their weights to lls 87 87 virtual void bayes_gensmp ( const vec &ut ); … … 187 187 188 188 void validate() { 189 BM::validate(); 189 190 bdm_assert ( par, "PF::parameter_pdf not specified." ); 190 191 n = _w.length(); … … 220 221 221 222 class MPF : public BM { 223 //! Introduces new option 224 //! \li means - meaning TODO 225 LOG_LEVEL(MPF,means); 222 226 protected: 223 227 //! particle filter on non-linear variable … … 291 295 return jest; 292 296 } 293 //! Extends options understood by BM::set_options by option294 //! \li logmeans - meaning295 void set_options ( const string &opt ) {296 BM::set_options ( opt );297 }298 297 299 298 //!Access function … … 323 322 */ 324 323 void from_setting ( const Setting &set ) { 324 BM::from_setting( set ); 325 325 326 shared_ptr<pdf> par = UI::build<pdf> ( set, "parameter_pdf", UI::compulsory ); 326 327 … … 334 335 set_BM ( *BM0 ); 335 336 336 string opt;337 if ( UI::get ( opt, set, "options", UI::optional ) ) {338 set_options ( opt );339 }340 337 //set drv 341 338 //??set_yrv(concat(BM0->_yrv(),u) ); … … 350 347 351 348 void validate() { 349 BM::validate(); 352 350 try { 353 351 pf->validate();