Changeset 682
- Timestamp:
- 10/27/09 16:52:32 (15 years ago)
- Location:
- library
- Files:
-
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.cpp
r675 r682 386 386 } 387 387 388 void BM::bayes B( const mat &Data ) {388 void BM::bayes_batch ( const mat &Data ) { 389 389 for ( int t = 0; t < Data.cols(); t++ ) { 390 390 bayes ( Data.get_col ( t ) ); -
library/bdm/base/bdmbase.h
r679 r682 1080 1080 virtual void bayes ( const vec &yt, const vec &cond=empty_vec ) = 0; 1081 1081 //! Batch Bayes rule (columns of Dt are observations) 1082 virtual void bayes B( const mat &Dt );1082 virtual void bayes_batch ( const mat &Dt ); 1083 1083 //! Evaluates predictive log-likelihood of the given data record 1084 1084 //! I.e. marginal likelihood of the data with the posterior integrated out. -
library/bdm/estim/mixtures.cpp
r679 r682 17 17 Coms ( 0 ) = Com0->_copy_(); 18 18 // Coms(0)->set_evalll(false); 19 Coms ( 0 )->bayes B( Data );19 Coms ( 0 )->bayes_batch ( Data ); 20 20 // Flatten it to its original shape 21 21 Coms ( 0 )->flatten ( Com0 ); … … 41 41 } 42 42 43 void MixEF::bayes B( const mat &data , const mat &cond, const vec &wData ) {43 void MixEF::bayes_batch ( const mat &data , const mat &cond, const vec &wData ) { 44 44 int ndat = data.cols(); 45 45 int t, i, niter; … … 127 127 128 128 void MixEF::bayes ( const mat &data, const vec &cond=empty_vec ) { 129 this->bayes B( data, cond, ones ( data.cols() ) );129 this->bayes_batch ( data, cond, ones ( data.cols() ) ); 130 130 }; 131 131 -
library/bdm/estim/mixtures.h
r679 r682 112 112 void bayes ( const mat &yt, const vec &cond ); 113 113 //! batch weighted Bayes rule 114 void bayes B( const mat &yt, const mat &cond, const vec &wData );114 void bayes_batch ( const mat &yt, const mat &cond, const vec &wData ); 115 115 double logpred ( const vec &yt ) const; 116 116 //! return correctly typed posterior (covariant return) -
library/bdm/stat/merger.cpp
r679 r682 103 103 //Re-Initialize Mixture model 104 104 Mix.flatten ( &Mix_init ); 105 Mix.bayes B( Smp_ex,empty_vec, w*Npoints );105 Mix.bayes_batch ( Smp_ex,empty_vec, w*Npoints ); 106 106 delete Mpred; 107 107 Mpred = Mix.epredictor ( ); // Allocation => must be deleted at the end!! -
library/doc/local/Intro.dox
r271 r682 29 29 30 30 On-line estimation is implemented by method \code void bayes(vec dt)\endcode 31 Off-line estimation is implemented by method \code void bayes B(mat D)\endcode31 Off-line estimation is implemented by method \code void bayes_batch(mat D)\endcode 32 32 33 33 As an intermediate product, the bayes rule computes marginal likelihood of the data records \f$ f(D) \f$. -
library/tests/arx_elem_test.cpp
r679 r682 23 23 Smp.set_row ( 0, smp ); 24 24 // 25 Ar.bayes B( Smp );25 Ar.bayes_batch ( Smp ); 26 26 // Ar is now filled with estimates of N(0,1); 27 27 cout << "Empirical moments: mu=" << sum ( smp ) / ndat << ", R=" << sum_sqr ( smp ) / ndat - pow ( sum ( smp ) / ndat, 2 ) << endl; -
library/tests/tutorial/arx_simple.cpp
r679 r682 13 13 // forgetting is default: 1.0 14 14 mat Data = concat_vertical ( randn ( 1, 100 ), ones ( 1, 100 ) ); 15 Ar.bayes B( Data );15 Ar.bayes_batch ( Data ); 16 16 17 17 cout << "Expected value of Theta is: " << Ar.posterior().mean() << endl;