Changeset 211 for bdm/stat/libBM.h

Show
Ignore:
Timestamp:
11/13/08 20:00:53 (16 years ago)
Author:
smidl
Message:

prejmenovani evalpdflog a evalcond

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libBM.h

    r203 r211  
    126126RV concat ( const RV &rv1, const RV &rv2 ); 
    127127 
     128//!Default empty RV that can be used as default argument 
     129extern RV RV0; 
    128130 
    129131//! Class representing function \f$f(x)\f$ of variable \f$x\f$ represented by \c rv 
     
    172174         
    173175        //! Compute log-probability of argument \c val 
    174         virtual double evalpdflog ( const vec &val ) const =0; 
     176        virtual double evallog ( const vec &val ) const =0; 
    175177 
    176178        //! Compute log-probability of multiple values argument \c val 
    177         virtual vec evalpdflog_m ( const mat &Val ) const { 
     179        virtual vec evallog_m ( const mat &Val ) const { 
    178180                vec x ( Val.cols() ); 
    179                 for ( int i=0;i<Val.cols();i++ ) {x ( i ) =evalpdflog ( Val.get_col ( i ) ) ;} 
     181                for ( int i=0;i<Val.cols();i++ ) {x ( i ) =evallog ( Val.get_col ( i ) ) ;} 
    180182                return x; 
    181183        } 
     
    217219                this->condition ( cond ); 
    218220                vec temp= ep->sample(); 
    219                 ll=ep->evalpdflog ( temp );return temp; 
     221                ll=ep->evallog ( temp );return temp; 
    220222        }; 
    221223        //! Returns \param N samples from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv \param ll is a return value of log-likelihood of the sample. 
    222         virtual mat samplecond ( const vec &cond, vec &ll, int N ) { 
     224        virtual mat samplecond_m ( const vec &cond, vec &ll, int N ) { 
    223225                this->condition ( cond ); 
    224226                mat temp ( rv.count(),N ); vec smp ( rv.count() ); 
    225                 for ( int i=0;i<N;i++ ) {smp=ep->sample() ;temp.set_col ( i, smp );ll ( i ) =ep->evalpdflog ( smp );} 
     227                for ( int i=0;i<N;i++ ) {smp=ep->sample() ;temp.set_col ( i, smp );ll ( i ) =ep->evallog ( smp );} 
    226228                return temp; 
    227229        }; 
     
    230232 
    231233        //! Shortcut for conditioning and evaluation of the internal epdf. In some cases,  this operation can be implemented efficiently. 
    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 ));}; 
     234        virtual double evallogcond ( const vec &dt, const vec &cond ) {this->condition ( cond );return ep->evallog ( dt );}; 
     235 
     236        //! Matrix version of evallogcond 
     237        virtual vec evallogcond_m ( const mat &Dt, const vec &cond ) {this->condition ( cond );return ep->evallog_m ( Dt );}; 
    235238 
    236239        //! Destructor for future use;