Changeset 690
- Timestamp:
- 11/02/09 13:41:14 (15 years ago)
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/tutorial/merging/merge_frag.m
r429 r690 1 1 % Random Variables 2 a= struct('class','RV','names',{{'a'}});3 b= struct('class','RV','names',{{'b'}});4 ab= struct('class','RV','names',{{'a','b'}});2 a=RV({'a'}); 3 b=RV({'b'}); 4 ab=RVjoin([a,b]); 5 5 6 6 % Sources -
library/bdm/base/bdmbase.cpp
r682 r690 386 386 } 387 387 388 void BM::bayes_batch ( const mat &Data ) {388 void BM::bayes_batch ( const mat &Data, const vec &cond ) { 389 389 for ( int t = 0; t < Data.cols(); t++ ) { 390 bayes ( Data.get_col ( t ) ); 391 } 392 } 393 } 390 bayes ( Data.get_col ( t ), cond ); 391 } 392 } 393 void BM::bayes_batch ( const mat &Data, const mat &Cond ) { 394 for ( int t = 0; t < Data.cols(); t++ ) { 395 bayes ( Data.get_col ( t ), Cond.get_col(t) ); 396 } 397 } 398 } -
library/bdm/base/bdmbase.h
r685 r690 1091 1091 virtual void bayes ( const vec &yt, const vec &cond=empty_vec ) = 0; 1092 1092 //! Batch Bayes rule (columns of Dt are observations) 1093 virtual void bayes_batch ( const mat &Dt ); 1093 virtual void bayes_batch ( const mat &Dt, const vec &cond=empty_vec ); 1094 //! Batch Bayes rule (columns of Dt are observations, columns of Cond are conditions) 1095 virtual void bayes_batch ( const mat &Dt, const mat &Cond ); 1094 1096 //! Evaluates predictive log-likelihood of the given data record 1095 1097 //! I.e. marginal likelihood of the data with the posterior integrated out.