Changeset 189 for bdm/estim/mixef.h
- Timestamp:
- 10/22/08 10:46:36 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/mixef.h
r180 r189 20 20 21 21 using namespace itpp; 22 23 enum MixEF_METHOD { EM = 0, QB = 1}; 22 24 23 25 /*! … … 49 51 ////!Indeces of component rvc in common rvc 50 52 53 //! Flag for a method that is used in the inference 54 MixEF_METHOD method; 55 51 56 //! Auxiliary function for use in constructors 52 57 void build_est() { … … 65 70 MixEF ( const Array<BMEF*> &Coms0, const vec &alpha0 ) : 66 71 BM ( RV() ), n ( Coms0.length() ), Coms ( n ), 67 weights ( RV ( "{w }", vec_1 ( n ) ),alpha0 ) {72 weights ( RV ( "{w }", vec_1 ( n ) ),alpha0 ), method(QB) { 68 73 // it_assert_debug ( n>0,"MixEF::MixEF : Empty Component list" ); 69 74 … … 73 78 MixEF () : 74 79 BM ( RV() ), n ( 0 ), Coms ( 0 ), 75 weights ( RV ( "{w }", vec_1 ( 0 ) ),vec ( 0 ) ) {build_est();}80 weights ( RV ( "{w }", vec_1 ( 0 ) ),vec ( 0 ) ),method(QB) {build_est();} 76 81 //! Initializing the mixture by a random pick of centroids from data 77 82 //! \param Com0 Initial component - necessary to determine its type. … … 88 93 //! EM algorithm 89 94 void bayes ( const mat &dt ); 90 void bayesB ( const mat &dt );95 void bayesB ( const mat &dt, const vec &wData ); 91 96 double logpred ( const vec &dt ) const; 92 97 const epdf& _epdf() const {return *est;} … … 94 99 //! Flatten the density as if it was not estimated from the data 95 100 void flatten(double sumw=1.0); 101 102 //!Set which method is to be used 103 void set_method(MixEF_METHOD M){method=M;} 96 104 }; 97 105