Changeset 200
- Timestamp:
- 11/10/08 15:40:24 (16 years ago)
- Location:
- bdm
- Files:
-
- 16 added
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/arx.h
r198 r200 79 79 //! Brute force structure estimation.\return indeces of accepted regressors. 80 80 ivec structure_est ( egiw Eg0 ); 81 const egiw* _e() const {return &est ;}; 81 82 }; 82 83 -
bdm/estim/libKF.h
r170 r200 122 122 //!access function 123 123 const epdf& _epdf() const {return est;} 124 const enorm<sq_T>* _e() const {return &est;} 124 125 //!access function 125 126 mat& __K() {return _K;} … … 187 188 //!dummy! 188 189 const epdf& _epdf()const{return E;}; 190 const enorm<fsqmat>* _e()const{return &E;}; 189 191 }; 190 192 -
bdm/estim/libPF.h
r170 r200 122 122 void bayes ( const vec &dt ); 123 123 const epdf& _epdf() const {return jest;} 124 const epdf* _e() const {return &jest;} //Fixme: is it useful? 124 125 //! Set postrior of \c rvc to samples from epdf0. Statistics of Bms are not re-computed! Use only for initialization! 125 126 void set_est ( const epdf& epdf0 ) { -
bdm/estim/mixef.h
r198 r200 105 105 double logpred ( const vec &dt ) const; 106 106 const epdf& _epdf() const {return *est;} 107 const eprod* _e() const {return est;} 107 108 emix* predictor(const RV &rv) const; 108 109 //! Flatten the density as if it was not estimated from the data -
bdm/stat/libBM.h
r198 r200 416 416 //! Batch Bayes rule (columns of Dt are observations) 417 417 virtual void bayesB ( const mat &Dt ); 418 //! Returns a reference to the epdf representing posterior density on parameters. 419 virtual const epdf& _epdf() const =0; 420 418 421 //! Returns a pointer to the epdf representing posterior density on parameters. Use with care! 419 virtual const epdf & _epdf() const =0;422 virtual const epdf* _e() const =0; 420 423 421 424 //! Evaluates predictive log-likelihood of the given data record -
bdm/stat/libEF.h
r198 r200 167 167 int nPsi; 168 168 public: 169 //!Default constructor, assuming170 egiw ( RV rv, mat V0, double nu0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) {169 //!Default constructor, if nu0<0 a minimal nu0 will be computed 170 egiw ( RV rv, mat V0, double nu0=-1.0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) { 171 171 xdim = rv.count() /V.rows(); 172 172 it_assert_debug ( rv.count() ==xdim*V.rows(),"Incompatible V0." ); 173 173 nPsi = V.rows()-xdim; 174 //set mu to have proper normalization and 175 if (nu0<0){ 176 nu = 0.1 +nPsi +2*xdim +2; // +2 assures finite expected value of R 177 // terms before that are sufficient for finite normalization 178 } 174 179 } 175 180 //!Full constructor for V in ldmat form 176 egiw ( RV rv, ldmat V0, double nu0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) {181 egiw ( RV rv, ldmat V0, double nu0=-1.0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) { 177 182 xdim = rv.count() /V.rows(); 178 183 it_assert_debug ( rv.count() ==xdim*V.rows(),"Incompatible V0." ); 179 184 nPsi = V.rows()-xdim; 185 if (nu0<0){ 186 nu = 0.1 +nPsi +2*xdim +2; // +2 assures finite expected value of R 187 // terms before that are sufficient for finite normalization 188 } 180 189 } 181 190 … … 275 284 } 276 285 const epdf& _epdf() const {return est;}; 286 const eDirich* _e() const {return &est;}; 277 287 void set_parameters ( const vec &beta0 ) { 278 288 est.set_parameters ( beta0 );