Show
Ignore:
Timestamp:
03/29/10 23:02:03 (14 years ago)
Author:
smidl
Message:

new base for particle filtering

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/stat/exp_family.h

    r878 r887  
    9797        virtual void flatten ( const BMEF * B ) NOT_IMPLEMENTED_VOID; 
    9898 
    99         double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0); 
    100          
    101         virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL); 
    102  
    103         virtual pdf* predictor() const NOT_IMPLEMENTED(NULL); 
    10499 
    105100        void to_setting ( Setting &set ) const 
     
    267262UIREGISTER2 ( enorm, fsqmat ); 
    268263SHAREDPTR2 ( enorm, fsqmat ); 
     264 
     265typedef enorm<ldmat> egauss; 
     266UIREGISTER(egauss); 
     267 
    269268 
    270269//forward declaration 
     
    15961595//! Switch between various resampling methods. 
    15971596enum RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 }; 
     1597 
     1598//! Shortcut for multinomial.sample(int n). Various simplifications are allowed see RESAMPLING_METHOD  
     1599void resample(const vec &w, ivec &ind, RESAMPLING_METHOD=SYSTEMATIC); 
     1600 
    15981601/*! 
    15991602\brief Weighted empirical density 
     
    16641667        }; 
    16651668        //! Function performs resampling, i.e. removal of low-weight samples and duplication of high-weight samples such that the new samples represent the same density. 
    1666         //! The vector with indeces of new samples is returned in variable \c index. 
    1667         void resample ( ivec &index, RESAMPLING_METHOD method = SYSTEMATIC ); 
    1668  
    1669         //! Resampling without returning index of new particles. 
    1670         void resample ( RESAMPLING_METHOD method = SYSTEMATIC ) { 
    1671                 ivec ind; 
    1672                 resample ( ind, method ); 
    1673         }; 
     1669        void resample ( RESAMPLING_METHOD method = SYSTEMATIC ); 
    16741670 
    16751671        //! inherited operation : NOT implemented 
     
    18741870} 
    18751871 
     1872/*! Dirac delta function distribution */ 
     1873class dirac: public epdf{ 
     1874        protected:  
     1875                vec point; 
     1876        public: 
     1877                double evallog (const vec &dt) const {return -inf;} 
     1878                vec mean () const {return point;} 
     1879                vec variance () const {return pow(point,2);} 
     1880                void qbounds ( vec &lb, vec &ub, double percentage = 0.95 ) const { lb = point; ub = point;} 
     1881                //! access 
     1882                const vec& _point() {return point;} 
     1883                void set_point(const vec& p){point =p; dim=p.length();} 
     1884                vec sample() const {return point;} 
     1885        }; 
     1886 
    18761887//// 
    18771888///////