00001
00029 #ifndef MOG_DIAG_EM_H
00030 #define MOG_DIAG_EM_H
00031
00032 #include <itpp/stat/mog_diag.h>
00033
00034
00035 namespace itpp
00036 {
00037
00042 class MOG_diag_EM_sup : public MOG_diag
00043 {
00044
00045 public:
00046
00048 MOG_diag_EM_sup() { verbose = false; }
00049
00051 ~MOG_diag_EM_sup() { }
00052
00054 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);
00056 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);
00057
00058 protected:
00059
00061 bool verbose;
00062
00064 int N;
00065
00067 int max_iter;
00068
00070 double ** c_X;
00071
00073 double var_floor;
00075 double weight_floor;
00076
00078 void inline update_internals();
00080 void inline sanitise_params();
00082 double ml_update_params();
00084 void ml_iterate();
00085
00086 private:
00087
00088 vec tmpvecK;
00089 vec tmpvecD;
00090 vec acc_loglhood_K;
00091
00092 Array<vec> acc_means;
00093 Array<vec> acc_covs;
00094
00095 double * c_tmpvecK;
00096 double * c_tmpvecD;
00097 double * c_acc_loglhood_K;
00098
00099 double ** c_acc_means;
00100 double ** c_acc_covs;
00101
00102
00103 };
00104
00105
00106
00107
00135 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);
00136
00155 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);
00156
00157 }
00158
00159 #endif // #ifndef MOG_DIAG_EM_H
00160