Changeset 502 for library/bdm/base/bdmbase.h
- Timestamp:
- 08/11/09 15:27:34 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r489 r502 296 296 //! Returns a sample, \f$ x \f$ from density \f$ f_x()\f$ 297 297 virtual vec sample() const { 298 it_error ("not implem neted");298 it_error ("not implemented"); 299 299 return vec (0); 300 }; 300 } 301 301 302 //! Returns N samples, \f$ [x_1 , x_2 , \ldots \ \f$ from density \f$ f_x(rv)\f$ 302 303 virtual mat sample_m (int N) const; 304 303 305 //! Compute log-probability of argument \c val 304 306 //! In case the argument is out of suport return -Infinity 305 307 virtual double evallog (const vec &val) const { 306 it_error ("not implem neted");308 it_error ("not implemented"); 307 309 return 0.0; 308 }; 310 } 311 309 312 //! Compute log-probability of multiple values argument \c val 310 virtual vec evallog_m (const mat &Val) const { 311 vec x (Val.cols()); 312 for (int i = 0; i < Val.cols(); i++) { 313 x (i) = evallog (Val.get_col (i)) ; 314 } 315 return x; 316 } 313 virtual vec evallog_m (const mat &Val) const; 314 317 315 //! Compute log-probability of multiple values argument \c val 318 virtual vec evallog_m (const Array<vec> &Avec) const { 319 vec x (Avec.size()); 320 for (int i = 0; i < Avec.size(); i++) { 321 x (i) = evallog (Avec (i)) ; 322 } 323 return x; 324 } 316 virtual vec evallog_m (const Array<vec> &Avec) const; 317 325 318 //! Return conditional density on the given RV, the remaining rvs will be in conditioning 326 319 virtual mpdf* condition (const RV &rv) const {