SHOGUN
v2.0.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Copyright (C) 2012 Jacob Walker 00008 */ 00009 00010 #ifndef CLIKELIHOODMODEL_H_ 00011 #define CLIKELIHOODMODEL_H_ 00012 #include <shogun/lib/config.h> 00013 #ifdef HAVE_EIGEN3 00014 #include <shogun/base/SGObject.h> 00015 #include <shogun/labels/RegressionLabels.h> 00016 00017 00018 namespace shogun 00019 { 00020 00022 enum ELikelihoodModelType 00023 { 00024 LT_NONE = 0, 00025 LT_GAUSSIAN = 10, 00026 LT_STUDENTST = 20 00027 }; 00028 00029 00037 class CLikelihoodModel : public CSGObject 00038 { 00039 00040 public: 00041 00042 /*Constructor*/ 00043 CLikelihoodModel(); 00044 00045 /*Destructor*/ 00046 virtual ~CLikelihoodModel(); 00047 00053 virtual float64_t get_parameter_derivative(const char* param_name); 00054 00060 virtual SGVector<float64_t> evaluate_means(SGVector<float64_t>& means) = 0; 00061 00067 virtual SGVector<float64_t> evaluate_variances(SGVector<float64_t>& vars) = 0; 00068 00073 virtual ELikelihoodModelType get_model_type() {return LT_NONE;} 00074 00081 inline virtual float64_t get_degrees_freedom() {return m_df;} 00082 00091 virtual float64_t get_log_probability_f(CRegressionLabels* labels, 00092 SGVector<float64_t> f) = 0; 00093 00094 00106 virtual SGVector<float64_t> get_log_probability_derivative_f( 00107 CRegressionLabels* labels, SGVector<float64_t> f, index_t i) = 0; 00108 00120 virtual SGVector<float64_t> get_first_derivative(CRegressionLabels* labels, 00121 TParameter* param, CSGObject* obj, SGVector<float64_t> function) = 0; 00122 00139 virtual SGVector<float64_t> get_second_derivative(CRegressionLabels* labels, 00140 TParameter* param, CSGObject* obj, SGVector<float64_t> function) = 0; 00141 protected: 00142 00144 float64_t m_df; 00145 00146 }; 00147 00148 00149 } 00150 #endif /* HAVE_EIGEN3 */ 00151 #endif /* CLIKELIHOODMODEL_H_ */