- Timestamp:
- 04/11/10 22:05:11 (15 years ago)
- Location:
- library/bdm
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/particles.h
r887 r900 50 50 public: 51 51 MarginalizedParticle():est(*this){}; 52 MarginalizedParticle(const MarginalizedParticle &m2):est(*this){ 53 bm = m2.bm->_copy(); 54 est_emp = m2.est_emp; 55 par = m2.par; 56 validate(); 57 }; 52 58 BM* _copy() const{return new MarginalizedParticle(*this);}; 53 59 void bayes(const vec &dt, const vec &cond){ … … 93 99 } 94 100 void validate(){ 95 yrv = bm->_rv(); 96 dimy = bm->dimension(); 97 set_rv( par->_rv()); 98 set_dim( par->dimension()); 99 100 rvc = par->_rvc().subt(par->_rv().copy_t(-1)); 101 rvc.add(bm->_rvc()); // 101 est_emp.set_point(zeros(par->dimension())); 102 est.validate(); 103 104 yrv = bm->_yrv(); 105 dimy = bm->dimensiony(); 106 set_rv( concat(bm->_rv(), par->_rv())); 107 set_dim( par->dimension()+bm->dimension()); 108 109 rvc = par->_rvc(); 110 rvc.add(bm->_rvc()); 111 rvc=rvc.subt(par->_rv()); 112 rvc=rvc.subt(par->_rv().copy_t(-1)); 113 rvc=rvc.subt(bm->_rv().copy_t(-1)); // 102 114 103 115 cond2bm=new datalink_part; … … 107 119 cond2bm->set_connection(bm->_rvc(), rvc); 108 120 cond2par->set_connection(par->_rvc(), rvc); 109 emp2bm->set_connection(bm->_rvc(), _rv());110 emp2par->set_connection(par->_rvc(), _rv().copy_t(-1));121 emp2bm->set_connection(bm->_rvc(), par->_rv()); 122 emp2par->set_connection(par->_rvc(), par->_rv().copy_t(-1)); 111 123 112 124 dimc = rvc._dsize(); -
library/bdm/mex/mex_logger.h
r895 r900 62 62 istart = 0; 63 63 for ( int j = 0; j < entries ( i ).length(); j++ ) { // same for as in add!!! 64 vec_name = names ( i ) + "_"+ entries ( i ).name ( j );64 vec_name = names ( i ) + separator + entries ( i ).name ( j ); 65 65 iend = istart + entries ( i ).size ( j ) - 1; 66 66 M = vectors ( i ).get_cols ( istart, iend ); -
library/bdm/stat/emix.cpp
r886 r900 244 244 vec tmp ( dim ); //second moment 245 245 for ( int i = 0; i < no_factors(); i++ ) { 246 vec pom = factor ( i )-> mean();246 vec pom = factor ( i )->variance(); 247 247 dls ( i )->pushup ( tmp, pow ( pom, 2 ) ); 248 248 } 249 return tmp - pow ( mean(), 2 );249 return tmp; 250 250 } 251 251 vec eprod_base::sample() const { -
library/bdm/stat/exp_family.h
r896 r900 1879 1879 double evallog (const vec &dt) const {return -inf;} 1880 1880 vec mean () const {return point;} 1881 vec variance () const {return pow(point,2);}1881 vec variance () const {return zeros(point.length());} 1882 1882 void qbounds ( vec &lb, vec &ub, double percentage = 0.95 ) const { lb = point; ub = point;} 1883 1883 //! access