BayesOpt
gauss_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 __GAUSS_DISTRIBUTION_HPP__
27 #define __GAUSS_DISTRIBUTION_HPP__
28 
29 #include <boost/math/distributions/normal.hpp>
30 #include "prob_distribution.hpp"
31 
32 namespace bayesopt
33 {
34 
36  {
37  public:
38  GaussianDistribution(randEngine& eng);
39  virtual ~GaussianDistribution();
40 
44  void setMeanAndStd(double mean, double std)
45  { mean_ = mean; std_ = std; };
46 
52  double pdf(double x)
53  {
54  x = (x - mean_) / std_;
55  return boost::math::pdf(d_,x);
56  };
57 
65  double negativeExpectedImprovement(double min, size_t g);
66 
73  double lowerConfidenceBound(double beta);
74 
82  double negativeProbabilityOfImprovement(double min,
83  double epsilon);
84 
89  double sample_query();
90 
91  double getMean() { return mean_; };
92  double getStd() { return std_; };
93 
94 
95  private:
96  boost::math::normal d_;
97  double mean_;
98  double std_;
99  };
100 
101 } //namespace bayesopt
102 
103 #endif
double negativeExpectedImprovement(double min, size_t g)
Expected Improvement algorithm for minimization.
void setMeanAndStd(double mean, double std)
Sets the mean and std of the distribution.
Namespace of the library interface.
Definition: using.dox:1
STL namespace.
Interface for probability models.
double negativeProbabilityOfImprovement(double min, double epsilon)
Probability of improvement algorithm for minimization.
double sample_query()
Sample outcome acording to the marginal distribution at the query point.
double pdf(double x)
Probability density function.
double lowerConfidenceBound(double beta)
Lower confindence bound.