IT++ Logo

mog_diag_em.h

Go to the documentation of this file.
00001 
00030 #ifndef MOG_DIAG_EM_H
00031 #define MOG_DIAG_EM_H
00032 
00033 #include <itpp/stat/mog_diag.h>
00034 
00035 
00036 namespace itpp
00037 {
00038 
00043 class MOG_diag_EM_sup : public MOG_diag
00044 {
00045 
00046 public:
00047 
00049   MOG_diag_EM_sup() { verbose = false; }
00050 
00052   ~MOG_diag_EM_sup() { }
00053 
00055   void ml(MOG_diag &model_in, Array<vec> &X_in, int max_iter_in = 10, double var_floor_in = 0.0, double weight_floor_in = 0.0, bool verbose_in = false);
00057   void map(MOG_diag &model_in, MOG_diag &prior_model, Array<vec> &X_in, int max_iter_in = 10, double alpha_in = 0.5, double var_floor_in = 0.0, double weight_floor_in = 0.0, bool verbose_in = false);
00058 
00059 protected:
00060 
00062   bool verbose;
00063 
00065   int N;
00066 
00068   int max_iter;
00069 
00071   double ** c_X;
00072 
00074   double var_floor;
00076   double weight_floor;
00077 
00079   void inline update_internals();
00081   void inline sanitise_params();
00083   double ml_update_params();
00085   void ml_iterate();
00086 
00087 private:
00088 
00089   vec tmpvecK;
00090   vec tmpvecD;
00091   vec acc_loglhood_K;
00092 
00093   Array<vec> acc_means;
00094   Array<vec> acc_covs;
00095 
00096   double * c_tmpvecK;
00097   double * c_tmpvecD;
00098   double * c_acc_loglhood_K;
00099 
00100   double ** c_acc_means;
00101   double ** c_acc_covs;
00102 
00103 
00104 };
00105 
00106 //
00107 // convenience functions
00108 
00136 void MOG_diag_ML(MOG_diag &model_in, Array<vec> &X_in, int max_iter_in = 10, double var_floor_in = 0.0, double weight_floor_in = 0.0, bool verbose_in = false);
00137 
00156 void MOG_diag_MAP(MOG_diag &model_in, MOG_diag &prior_model_in, Array<vec> &X_in, int max_iter_in = 10, double alpha_in = 0.5, double var_floor_in = 0.0, double weight_floor_in = 0.0, bool verbose_in = false);
00157 
00158 }
00159 
00160 #endif // #ifndef MOG_DIAG_EM_H
00161 
SourceForge Logo

Generated on Thu Apr 23 20:07:48 2009 for IT++ by Doxygen 1.5.8