Changeset 67

Show
Ignore:
Timestamp:
04/09/08 15:40:33 (16 years ago)
Author:
smidl
Message:

opavy

Location:
bdm
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • bdm/estim/libKF.cpp

    r62 r67  
    6262 
    6363 /////////////////////////////// EKFS 
    64 EKFfull::EKFfull ( RV rvx0, RV rvy0, RV rvu0 ) : BM ( rvx0 ) {}; 
     64EKFfull::EKFfull ( RV rvx0, RV rvy0, RV rvu0 ) : BM ( rvx0 ),E(rvx0) {}; 
    6565 
    6666void EKFfull::set_parameters ( diffbifn* pfxu0,  diffbifn* phxu0,const mat Q0,const mat R0 ) { 
     
    105105        mu += _K* ( y-yp ); 
    106106 
     107        E.set_mu(mu); 
     108 
    107109        if ( BM::evalll ) { 
    108110                //from enorm 
  • bdm/estim/libKF.h

    r62 r67  
    173173*/ 
    174174class EKFfull : public KalmanFull, public BM { 
     175 
    175176        //! Internal Model f(x,u) 
    176177        diffbifn* pfxu; 
    177178        //! Observation Model h(x,u) 
    178179        diffbifn* phxu; 
     180         
     181        enorm<fsqmat> E;  
    179182public: 
    180183        //! Default constructor 
     
    187190        void set_est (vec mu0, mat P0){mu=mu0;P=P0;}; 
    188191        //!dummy! 
    189         epdf& _epdf(){enorm<fsqmat> E(rv); return E;}; 
     192        epdf& _epdf(){return E;}; 
    190193}; 
    191194 
  • bdm/estim/libPF.h

    r60 r67  
    171171        } 
    172172 
    173         _w /=sum ( _w ); //? 
    174  
     173        if (sum(_w)>0.0){ 
     174                _w /=sum ( _w ); //? 
     175                } 
     176else 
     177{ 
     178cout<<"sum(w)==0"<<endl; 
     179} 
    175180 
    176181 
    177182        double eff = 1.0/ ( _w*_w ); 
    178         if ( eff < ( 0.1*n ) ) { 
     183        if ( eff < ( 0.3*n ) ) { 
    179184                ind = est.resample(); 
    180185                // Resample Bms! 
  • bdm/stat/libEF.h

    r60 r67  
    101101        //! returns a pointer to the internal mean value. Use with Care! 
    102102        vec* _mu() {return &mu;} 
     103         
     104        //! access function 
     105        void set_mu(const vec mu0) { mu=mu0;} 
    103106 
    104107        //! returns pointers to the internal variance and its inverse. Use with Care!