SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
StudentsTLikelihood.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Roman Votyakov
8  * Copyright (C) 2012 Jacob Walker
9  * Copyright (C) 2013 Roman Votyakov
10  *
11  * Code adapted from the GPML Toolbox:
12  * http://www.gaussianprocess.org/gpml/code/matlab/doc/
13  */
14 
15 #ifndef CSTUDENTSTLIKELIHOOD_H_
16 #define CSTUDENTSTLIKELIHOOD_H_
17 
18 #include <shogun/lib/config.h>
19 
20 #ifdef HAVE_EIGEN3
21 
23 
24 namespace shogun
25 {
26 
39 {
40 public:
43 
50 
51  virtual ~CStudentsTLikelihood();
52 
57  virtual const char* get_name() const { return "StudentsTLikelihood"; }
58 
63  float64_t get_sigma() { return m_sigma; }
64 
69  void set_sigma(float64_t sigma)
70  {
71  REQUIRE(sigma>0.0, "Scale parameter must be greater than zero\n")
72  m_sigma=sigma;
73  }
74 
79  float64_t get_degrees_freedom() { return m_df; }
80 
86  {
87  REQUIRE(df>1.0, "Number of degrees of freedom must be greater than one\n")
88  m_df=df;
89  }
90 
97 
113  SGVector<float64_t> s2, const CLabels* lab=NULL) const;
114 
130  SGVector<float64_t> s2, const CLabels* lab=NULL) const;
131 
137 
150  SGVector<float64_t> func) const;
151 
163  const CLabels* lab, SGVector<float64_t> func, index_t i) const;
164 
175  SGVector<float64_t> func, const TParameter* param) const;
176 
188  SGVector<float64_t> func, const TParameter* param) const;
189 
201  SGVector<float64_t> func, const TParameter* param) const;
202 
220  SGVector<float64_t> s2, const CLabels* lab) const;
221 
237  SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
238 
254  SGVector<float64_t> s2, const CLabels* lab, index_t i) const;
255 
260  virtual bool supports_regression() const { return true; }
261 
262 private:
264  void init();
265 
267  float64_t m_sigma;
268 
270  float64_t m_df;
271 };
272 }
273 #endif /* HAVE_EIGEN3 */
274 #endif /* CSTUDENTSTLIKELIHOOD_H_ */
virtual SGVector< float64_t > get_predictive_variances(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const
ELikelihoodModelType
virtual float64_t get_second_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const
int32_t index_t
Definition: common.h:62
virtual const char * get_name() const
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
virtual SGVector< float64_t > get_second_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
virtual SGVector< float64_t > get_first_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
parameter struct
#define REQUIRE(x,...)
Definition: SGIO.h:206
virtual SGVector< float64_t > get_predictive_means(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const
virtual SGVector< float64_t > get_log_probability_f(const CLabels *lab, SGVector< float64_t > func) const
virtual float64_t get_first_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const
virtual SGVector< float64_t > get_log_probability_derivative_f(const CLabels *lab, SGVector< float64_t > func, index_t i) const
virtual bool supports_regression() const
double float64_t
Definition: common.h:50
void set_sigma(float64_t sigma)
virtual ELikelihoodModelType get_model_type() const
Class that models a Student's-t likelihood.
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
void set_degrees_freedom(float64_t df)
static CStudentsTLikelihood * obtain_from_generic(CLikelihoodModel *likelihood)
virtual SGVector< float64_t > get_third_derivative(const CLabels *lab, SGVector< float64_t > func, const TParameter *param) const
The Likelihood model base class.
virtual SGVector< float64_t > get_log_zeroth_moments(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab) const

SHOGUN Machine Learning Toolbox - Documentation