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 
00042   class MOG_diag_EM_sup : public MOG_diag {
00043 
00044     public:
00045 
00047     MOG_diag_EM_sup() { verbose=false; }
00048 
00050     ~MOG_diag_EM_sup() { }
00051 
00053     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);
00055     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);
00056 
00057     protected:
00058 
00060     bool verbose;
00061 
00063     int N;
00064 
00066     int max_iter;
00067 
00069     double ** c_X;
00070 
00072     double var_floor;
00074     double weight_floor;
00075 
00077     void inline update_internals();
00079     void inline sanitise_params();
00081     double ml_update_params();
00083     void ml_iterate();
00084 
00085     private:
00086 
00087     vec tmpvecK;
00088     vec tmpvecD;
00089     vec acc_loglhood_K;
00090 
00091     Array<vec> acc_means;
00092     Array<vec> acc_covs;
00093 
00094     double * c_tmpvecK;
00095     double * c_tmpvecD;
00096     double * c_acc_loglhood_K;
00097 
00098     double ** c_acc_means;
00099     double ** c_acc_covs;
00100 
00101 
00102   };
00103 
00104   //
00105   // convenience functions
00106 
00134   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);
00135 
00154   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);
00155 
00156 }
00157 
00158 #endif // #ifndef MOG_DIAG_EM_H
00159 
SourceForge Logo

Generated on Sat Apr 19 10:41:15 2008 for IT++ by Doxygen 1.5.5