BayesOpt
student_t_distribution.hpp
Go to the documentation of this file.
1 
3 /*
4 -------------------------------------------------------------------------
5  This file is part of BayesOpt, an efficient C++ library for
6  Bayesian optimization.
7 
8  Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
9 
10  BayesOpt is free software: you can redistribute it and/or modify it
11  under the terms of the GNU Affero General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  BayesOpt is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Affero General Public License for more details.
19 
20  You should have received a copy of the GNU Affero General Public License
21  along with BayesOpt. If not, see <http://www.gnu.org/licenses/>.
22 ------------------------------------------------------------------------
23 */
24 
25 
26 #ifndef __STUDENT_T_DISTRIBUTION_HPP__
27 #define __STUDENT_T_DISTRIBUTION_HPP__
28 
29 // for student t distribution
30 #include <boost/math/distributions/students_t.hpp>
31 #include "prob_distribution.hpp"
32 
33 namespace bayesopt
34 {
35 
37  {
38  public:
39  StudentTDistribution(randEngine& eng);
40  virtual ~StudentTDistribution();
41 
45  void setMeanAndStd(double mean, double std)
46  { mean_ = mean; std_ = std; };
47 
51  void setDof(size_t dof)
52  {
53  dof_ = dof;
54  boost::math::students_t new_d(dof);
55  d_ = new_d;
56  };
57 
63  double pdf(double x)
64  {
65  x = (x - mean_) / std_;
66  return boost::math::pdf(d_,x);
67  };
68 
76  double negativeExpectedImprovement(double min, size_t g);
77 
84  double lowerConfidenceBound(double beta);
85 
93  double negativeProbabilityOfImprovement(double min,
94  double epsilon);
95 
100  double sample_query();
101 
102  double getMean() { return mean_; };
103  double getStd() { return std_; };
104 
105  private:
106  boost::math::students_t d_;
107  double mean_;
108  double std_;
109  size_t dof_;
110  };
111 
112 } //namespace bayesopt
113 
114 #endif
Namespace of the library interface.
Definition: using.dox:1
STL namespace.
Interface for probability models.
double lowerConfidenceBound(double beta)
Lower confindence bound.
void setMeanAndStd(double mean, double std)
Sets the mean and std of the distribution.
double negativeProbabilityOfImprovement(double min, double epsilon)
Probability of improvement algorithm for minimization.
void setDof(size_t dof)
Sets the degrees of freedom (dof) the distribution.
double negativeExpectedImprovement(double min, size_t g)
Expected Improvement algorithm for minimization.
double pdf(double x)
Probability density function.
double sample_query()
Sample outcome acording to the marginal distribution at the query point.