Changeset 231
Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/ekf_templ.h
r229 r231 41 41 }; 42 42 43 //!Extended Kalman filter with unknown parameters in \c IM 44 class EKFCh_cond : public EKFCh , public BMcond { 45 public: 46 //! Default constructor 47 EKFCh_cond ( RV rx, RV ry,RV ru,RV rC ) :EKFCh ( rx,ry,ru ),BMcond ( rC ) {}; 48 void condition ( const vec &val ) { 49 pfxu->condition ( val ); 50 }; 51 }; 52 43 53 #endif //EKF_TEMP_H -
bdm/estim/libKF.cpp
r225 r231 70 70 dimx = rv.count(); 71 71 dimy = phxu0->_dimy(); 72 dimu = p hxu0->_dimu();72 dimu = pfxu0->_dimu(); 73 73 74 74 A.set_size(dimx,dimx); -
bdm/estim/libPF.h
r229 r231 142 142 //!Access function 143 143 BM* _BM(int i){return Bms[i];} 144 //SimStr:145 double SSAT;146 144 }; 147 145 … … 153 151 ivec ind; 154 152 double mlls=-std::numeric_limits<double>::infinity(); 155 156 // StrSim:06157 double sumLWL=0.0;158 double sumL2WL=0.0;159 double WL = 0.0;160 153 161 154 #pragma omp parallel for … … 167 160 lls ( i ) = Bms[i]->_ll(); // lls above is also in proposal her must be lls(i) =, not +=!! 168 161 if ( lls ( i ) >mlls ) mlls=lls ( i ); //find maximum likelihood (for numerical stability) 169 }170 171 if ( false) {172 #pragma omp parallel for reduction(+:sumLWL,sumL2WL) private(WL)173 for ( i=0;i<n;i++ ) {174 WL = _w ( i ) *exp ( llsP ( i ) ); //using old weights!175 sumLWL += exp ( lls ( i ) ) *WL;176 sumL2WL += exp ( 2*lls ( i ) ) *WL;177 }178 SSAT = sumL2WL/ ( sumLWL*sumLWL );179 162 } 180 163