Changeset 33 for bdm/stat/libBM.h
- Timestamp:
- 03/05/08 16:01:56 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/stat/libBM.h
r32 r33 31 31 //! len = number of individual rvs 32 32 int len; 33 //! Vector of unique IDs 33 34 ivec ids; 35 //! Vector of sizes 34 36 ivec sizes; 37 //! Vector of shifts from current time 35 38 ivec times; 36 ivec obs;39 //! Array of names 37 40 Array<std::string> names; 38 41 39 42 private: 43 //! auxiliary function used in constructor 40 44 void init ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times); 41 45 public: … … 78 82 class fnc { 79 83 protected: 84 //! Length of the output vector 80 85 int dimy; 81 86 public: … … 83 88 virtual vec eval ( const vec &cond ) { 84 89 return vec ( 0 ); 85 }; //Fixme: virtual?90 }; 86 91 87 92 //! access function … … 97 102 class epdf { 98 103 protected: 104 //! Identified of the random variable 99 105 RV rv; 100 106 public: … … 140 146 //! Returns the required moment of the epdf 141 147 // virtual fnc moment ( const int order = 1 ); 142 //! Returns a sample from the density conditioned on \c cond, $x \sim epdf(rv|cond)$.\param ll is a return value of log-likelihood of the sample.148 //! Returns a sample 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. 143 149 virtual vec samplecond ( vec &cond, double &ll ) {this->condition(cond);vec temp= ep->sample();ll=ep->evalpdflog(temp);return temp;}; 144 150 //! Update \c ep so that it represents this mpdf conditioned on \c rvc = cond 145 151 virtual void condition ( const vec &cond ) {}; 146 152 153 //! Shortcut for conditioning and evaluation of the internal epdf. In some cases, this operation can be implemented efficiently. 147 154 virtual double evalcond (const vec &dt, const vec &cond ) {this->condition(cond);return ep->eval(dt);}; 148 155 … … 238 245 class BMcond { 239 246 protected: 247 //! Identificator of the conditioning variable 240 248 RV rvc; 241 249 public: 242 250 //! Substitute \c val for \c rvc. 243 251 virtual void condition ( const vec &val ) =0; 252 //! Default constructor 244 253 BMcond(RV &rv0):rvc(rv0){}; 254 //! Destructor for future use 245 255 virtual ~BMcond(){}; 256 //! access function 246 257 const RV& _rvc() const {return rvc;} 247 258 };