SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
GaussianLikelihood.h
Go to the documentation of this file.
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  * Written (W) 2013 Roman Votyakov
00008  * Copyright (C) 2012 Jacob Walker
00009  * Copyright (C) 2013 Roman Votyakov
00010  */
00011 
00012 #ifndef CGAUSSIANLIKELIHOOD_H_
00013 #define CGAUSSIANLIKELIHOOD_H_
00014 
00015 #include <shogun/lib/config.h>
00016 
00017 #ifdef HAVE_EIGEN3
00018 
00019 #include <shogun/machine/gp/LikelihoodModel.h>
00020 
00021 namespace shogun
00022 {
00023 
00034 class CGaussianLikelihood: public CLikelihoodModel
00035 {
00036 public:
00038     CGaussianLikelihood();
00039 
00044     CGaussianLikelihood(float64_t sigma);
00045 
00046     virtual ~CGaussianLikelihood();
00047 
00052     virtual const char* get_name() const { return "GaussianLikelihood"; }
00053 
00058     float64_t get_sigma() { return m_sigma; }
00059 
00064     void set_sigma(float64_t sigma)
00065     {
00066         REQUIRE(sigma>0.0, "Standard deviation must be greater than zero\n")
00067         m_sigma=sigma;
00068     }
00069 
00075     static CGaussianLikelihood* obtain_from_generic(CLikelihoodModel* lik);
00076 
00092     virtual SGVector<float64_t> get_predictive_means(SGVector<float64_t> mu,
00093             SGVector<float64_t> s2, const CLabels* lab=NULL) const;
00094 
00109     virtual SGVector<float64_t> get_predictive_variances(SGVector<float64_t> mu,
00110             SGVector<float64_t> s2, const CLabels* lab=NULL) const;
00111 
00116     virtual ELikelihoodModelType get_model_type() const { return LT_GAUSSIAN; }
00117 
00129     virtual SGVector<float64_t> get_log_probability_f(const CLabels* lab,
00130             SGVector<float64_t> func) const;
00131 
00142     virtual SGVector<float64_t> get_log_probability_derivative_f(
00143             const CLabels* lab, SGVector<float64_t> func, index_t i) const;
00144 
00154     virtual SGVector<float64_t> get_first_derivative(const CLabels* lab,
00155             SGVector<float64_t> func, const TParameter* param) const;
00156 
00167     virtual SGVector<float64_t> get_second_derivative(const CLabels* lab,
00168             SGVector<float64_t> func, const TParameter* param) const;
00169 
00180     virtual SGVector<float64_t> get_third_derivative(const CLabels* lab,
00181             SGVector<float64_t> func, const TParameter* param) const;
00182 
00199     virtual SGVector<float64_t> get_log_zeroth_moments(SGVector<float64_t> mu,
00200             SGVector<float64_t> s2, const CLabels* lab) const;
00201 
00216     virtual float64_t get_first_moment(SGVector<float64_t> mu,
00217             SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
00218 
00233     virtual float64_t get_second_moment(SGVector<float64_t> mu,
00234             SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
00235 
00240     virtual bool supports_regression() const { return true; }
00241 
00242 private:
00244     void init();
00245 
00247     float64_t m_sigma;
00248 };
00249 }
00250 #endif /* HAVE_EIGEN3 */
00251 #endif /* CGAUSSIANLIKELIHOOD_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation