Changeset 178 for bdm/stat/libBM.h
- Timestamp:
- 10/15/08 19:04:09 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/stat/libBM.h
r176 r178 140 140 }; 141 141 142 class mpdf; 142 143 143 144 //! Probability density function with numerical statistics, e.g. posterior density. … … 173 174 return x; 174 175 } 176 //! Return conditional density on the given RV, the remaining rvs will be in conditioning 177 mpdf* condition(const RV &rv){it_warning("Not implemented"); return NULL;} 178 //! Return marginal density on the given RV, the remainig rvs are intergrated out 179 epdf* marginal(const RV &rv){it_warning("Not implemented"); return NULL;} 175 180 176 181 //! return expected value … … 183 188 //! modifier function - useful when copying epdfs 184 189 void _renewrv(const RV &in_rv){rv=in_rv;} 190 //! 185 191 }; 186 192 … … 213 219 }; 214 220 //! Update \c ep so that it represents this mpdf conditioned on \c rvc = cond 215 virtual void condition ( const vec &cond ) { };221 virtual void condition ( const vec &cond ) {it_error("Not implemented");}; 216 222 217 223 //! Shortcut for conditioning and evaluation of the internal epdf. In some cases, this operation can be implemented efficiently. … … 252 258 //! Indeces of rvc in common rv 253 259 Array<ivec> rvcsinrv; 260 //! Indeces of common rv in rvc 261 Array<ivec> rvinrvcs; 254 262 public: 255 compositepdf(Array<mpdf*> A0): n(A0.length()), mpdfs(A0), rvsinrv(n), rvcsinrv(n) {};263 compositepdf(Array<mpdf*> A0): n(A0.length()), mpdfs(A0), rvsinrv(n), rvcsinrv(n),rvinrvcs(n){}; 256 264 RV getrv(bool checkoverlap=false); 257 265 void setrvc(const RV &rv, RV &rvc); … … 329 337 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;} 330 338 339 //!Constructs a predictive density (marginal density on data) 340 virtual epdf* predictor(const RV &rv){it_error("Not implemented");return NULL;}; 341 331 342 //! Destructor for future use; 332 343 virtual ~BM() {};