- Timestamp:
- 11/10/08 15:40:25 (16 years ago)
- Location:
- bdm
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/arx.cpp
r199 r201 33 33 lll = pred.lognc(); 34 34 } 35 else 35 else//should be save: last_lognc is changed only by bayes; 36 36 if ( evalll ) {lll=last_lognc;} 37 37 else{lll=pred.lognc();} … … 39 39 V.opupdt ( dt,1.0 ); 40 40 nu+=1.0; 41 42 return pred.lognc()-lll ;41 // log(sqrt(2*pi)) = 0.91893853320467 42 return pred.lognc()-lll - 0.91893853320467; 43 43 } 44 44 -
bdm/stat/libBM.cpp
r192 r201 111 111 } 112 112 113 mat epdf::sample N( int N ) const {113 mat epdf::sample_m ( int N ) const { 114 114 mat X = zeros ( rv.count(), N ); 115 115 for ( int i = 0;i < N;i++ ) X.set_col ( i, this->sample() ); -
bdm/stat/libBM.h
r200 r201 169 169 virtual vec sample () const =0; 170 170 //! Returns N samples from density \f$epdf(rv)\f$ 171 virtual mat sampleN ( int N ) const; 172 //! Compute probability of argument \c val 173 virtual double eval ( const vec &val ) const {return exp ( this->evalpdflog ( val ) );}; 174 171 virtual mat sample_m ( int N ) const; 172 175 173 //! Compute log-probability of argument \c val 176 174 virtual double evalpdflog ( const vec &val ) const =0; … … 232 230 233 231 //! Shortcut for conditioning and evaluation of the internal epdf. In some cases, this operation can be implemented efficiently. 234 virtual double evalcond ( const vec &dt, const vec &cond ) {this->condition ( cond );return ep->eval ( dt );}; 232 virtual double evalcond ( const vec &dt, const vec &cond ) {this->condition ( cond );return exp(ep->evalpdflog ( dt ));}; 233 234 virtual vec evalcond_m ( const mat &Dt, const vec &cond ) {this->condition ( cond );return exp(ep->evalpdflog_m ( Dt ));}; 235 235 236 236 //! Destructor for future use;