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 * Code adapted from the GPML Toolbox: 00010 * http://www.gaussianprocess.org/gpml/code/matlab/doc/ 00011 * 00012 */ 00013 00014 #ifndef CSTUDENTSTLIKELIHOOD_H_ 00015 #define CSTUDENTSTLIKELIHOOD_H_ 00016 #include <shogun/lib/config.h> 00017 #ifdef HAVE_EIGEN3 00018 #include <shogun/regression/gp/LikelihoodModel.h> 00019 00020 namespace shogun 00021 { 00022 00029 class CStudentsTLikelihood: public CLikelihoodModel 00030 { 00031 00032 public: 00033 00034 /*Constructor*/ 00035 CStudentsTLikelihood(); 00036 00037 /*Destructor*/ 00038 virtual ~CStudentsTLikelihood(); 00039 00045 virtual const char* get_name() const { return "StudentsTLikelihood"; } 00046 00051 float64_t get_sigma() {return m_sigma;} 00052 00057 void set_sigma(float64_t s) {m_sigma = s;} 00058 00064 virtual SGVector<float64_t> evaluate_means(SGVector<float64_t>& means); 00065 00071 virtual SGVector<float64_t> evaluate_variances(SGVector<float64_t>& vars); 00072 00077 virtual ELikelihoodModelType get_model_type() {return LT_STUDENTST;} 00078 00079 00088 virtual float64_t get_log_probability_f(CRegressionLabels* labels, 00089 SGVector<float64_t> f); 00090 00091 00103 virtual SGVector<float64_t> get_log_probability_derivative_f( 00104 CRegressionLabels* labels, SGVector<float64_t> f, index_t i); 00105 00117 virtual SGVector<float64_t> get_first_derivative(CRegressionLabels* labels, 00118 TParameter* param, CSGObject* obj, SGVector<float64_t> function); 00119 00136 virtual SGVector<float64_t> get_second_derivative(CRegressionLabels* labels, 00137 TParameter* param, CSGObject* obj, SGVector<float64_t> function); 00138 00139 private: 00141 float64_t m_sigma; 00142 00143 00145 void init(); 00146 00147 }; 00148 00149 } 00150 #endif /* HAVE_EIGEN3 */ 00151 #endif /* CStudentsTLIKELIHOOD_H_ */