Changeset 1009 for library/bdm/base/bdmbase.h
- Timestamp:
- 05/27/10 23:07:16 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r989 r1009 1293 1293 @param dt vector of input data 1294 1294 */ 1295 virtual void bayes ( const vec &yt, const vec &cond = empty_vec ) = 1295 virtual void bayes ( const vec &yt, const vec &cond = empty_vec ) =0; 1296 1296 //! Batch Bayes rule (columns of Dt are observations) 1297 virtual voidbayes_batch ( const mat &Dt, const vec &cond = empty_vec );1297 virtual double bayes_batch ( const mat &Dt, const vec &cond = empty_vec ); 1298 1298 //! Batch Bayes rule (columns of Dt are observations, columns of Cond are conditions) 1299 virtual voidbayes_batch ( const mat &Dt, const mat &Cond );1299 virtual double bayes_batch ( const mat &Dt, const mat &Cond ); 1300 1300 //! Evaluates predictive log-likelihood of the given data record 1301 1301 //! I.e. marginal likelihood of the data with the posterior integrated out. 1302 1302 //! This function evaluates only \f$ y_t \f$, condition is assumed to be the last used in bayes(). 1303 1303 //! See bdm::BM::predictor for conditional version. 1304 virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0.0);1304 virtual double logpred ( const vec &yt, const vec &cond ) const NOT_IMPLEMENTED(0.0); 1305 1305 1306 1306 //! Matrix version of logpred 1307 vec logpred_mat ( const mat &Yt ) const {1307 vec logpred_mat ( const mat &Yt, const mat &Cond ) const { 1308 1308 vec tmp ( Yt.cols() ); 1309 1309 for ( int i = 0; i < Yt.cols(); i++ ) { 1310 tmp ( i ) = logpred ( Yt.get_col ( i ) );1310 tmp ( i ) = logpred ( Yt.get_col ( i ), Cond.get_col(i) ); 1311 1311 } 1312 1312 return tmp;