Changeset 887 for library/bdm/stat/exp_family.h
- Timestamp:
- 03/29/10 23:02:03 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/stat/exp_family.h
r878 r887 97 97 virtual void flatten ( const BMEF * B ) NOT_IMPLEMENTED_VOID; 98 98 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);104 99 105 100 void to_setting ( Setting &set ) const … … 267 262 UIREGISTER2 ( enorm, fsqmat ); 268 263 SHAREDPTR2 ( enorm, fsqmat ); 264 265 typedef enorm<ldmat> egauss; 266 UIREGISTER(egauss); 267 269 268 270 269 //forward declaration … … 1596 1595 //! Switch between various resampling methods. 1597 1596 enum RESAMPLING_METHOD { MULTINOMIAL = 0, STRATIFIED = 1, SYSTEMATIC = 3 }; 1597 1598 //! Shortcut for multinomial.sample(int n). Various simplifications are allowed see RESAMPLING_METHOD 1599 void resample(const vec &w, ivec &ind, RESAMPLING_METHOD=SYSTEMATIC); 1600 1598 1601 /*! 1599 1602 \brief Weighted empirical density … … 1664 1667 }; 1665 1668 //! 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 ); 1674 1670 1675 1671 //! inherited operation : NOT implemented … … 1874 1870 } 1875 1871 1872 /*! Dirac delta function distribution */ 1873 class 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 1876 1887 //// 1877 1888 ///////