Show
Ignore:
Timestamp:
10/23/09 00:05:25 (15 years ago)
Author:
smidl
Message:

Major changes in BM -- OK is only test suite and tests/tutorial -- the rest is broken!!!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/estim/particles.h

    r676 r679  
    9393                return eff < ( res_threshold*n ); 
    9494        } 
    95         void bayes ( const vec &dt ); 
     95        void bayes ( const vec &yt, const vec &cond ); 
    9696        //!access function 
    9797        vec& __w() { return _w; } 
     
    131131                u.add(obs_u); // join both u, and check if they do not overlap 
    132132 
    133                 set_drv(concat(obs->_rv(),u) ); 
     133                set_yrv(concat(obs->_rv(),u) ); 
    134134        } 
    135135        //! auxiliary function reading parameter 'resmethod' from configuration file 
     
    296296        mpfepdf jest; 
    297297 
    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         
    301303public: 
    302304        //! Default constructor. 
     
    320322        }; 
    321323 
    322         void bayes ( const vec &dt ); 
     324        void bayes ( const vec &yt, const vec &cond ); 
    323325        const epdf& posterior() const { 
    324326                return jest; 
     
    328330        void set_options ( const string &opt ) { 
    329331                BM::set_options(opt); 
    330                 opt_L_mea = ( opt.find ( "logmeans" ) != string::npos ); 
    331332        } 
    332333 
     
    352353 
    353354                pf = new PF; 
    354                 // rpior must be set before BM 
     355                // prior must be set before BM 
    355356                pf->prior_from_set(set); 
    356357                pf->resmethod_from_set(set); 
    357358                pf->set_model(par,obs); 
    358                  
     359                                 
    359360                shared_ptr<BM> BM0 =UI::build<BM>(set,"BM",UI::compulsory); 
    360361                set_BM(*BM0); 
     
    367368                //find potential input - what remains in rvc when we subtract rv 
    368369                RV u = par->_rvc().remove_time().subt( par->_rv() );             
    369                 set_drv(concat(BM0->_drv(),u) ); 
     370                set_yrv(concat(BM0->_yrv(),u) ); 
    370371                validate(); 
    371372        } 
     
    377378                } 
    378379                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); 
    382382        } 
    383383