Changeset 176 for bdm/stat/libBM.h
- Timestamp:
- 10/09/08 11:32:12 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/stat/libBM.h
r175 r176 80 80 bool add ( const RV &rv2 ); 81 81 //! Subtract another variable from the current one 82 RV subt ( const RV rv2 ) const;82 RV subt ( const RV &rv2 ) const; 83 83 //! Select only variables at indeces ind 84 RV subselect ( ivecind ) const;84 RV subselect ( const ivec &ind ) const; 85 85 //! Select only variables at indeces ind 86 RV operator() ( ivecind ) const;86 RV operator() ( const ivec &ind ) const; 87 87 //! Shift \c time shifted by delta. 88 88 void t ( int delta ); … … 90 90 str tostr() const; 91 91 //! generate indeces into \param crv data vector that form data vector of self. 92 ivec dataind( RVcrv) const;92 ivec dataind(const RV &crv) const; 93 93 94 94 //!access function … … 103 103 //!access function 104 104 std::string name ( int at ) {return names ( at );}; 105 106 //!access function 107 void set_id ( int at, int id0 ) {ids ( at )=id0;}; 108 //!access function 109 void set_size ( int at, int size0 ) {sizes ( at )=size0; tsize=sum(sizes);}; 110 //!access function 111 void set_time ( int at, int time0 ) {times ( at )=time0;}; 112 105 113 //!Assign unused ids to this rv 106 114 void newids(); … … 160 168 161 169 //! Compute log-probability of multiple values argument \c val 162 virtual vec evalpdflog ( const mat &Val ) const {170 virtual vec evalpdflog_m ( const mat &Val ) const { 163 171 vec x ( Val.cols() ); 164 172 for ( int i=0;i<Val.cols();i++ ) {x ( i ) =evalpdflog( Val.get_col(i) ) ;} … … 318 326 //! I.e. marginal likelihood of the data with the posterior integrated out. 319 327 virtual double logpred(const vec &dt)const{it_error("Not implemented");return 0.0;} 328 //! Matrix version of logpred 329 vec logpred_m(const mat &dt)const{vec tmp(dt.cols());for(int i=0;i<dt.cols();i++){tmp(i)=logpred(dt.get_col(i));}return tmp;} 320 330 321 331 //! Destructor for future use;