BayesOpt
student_t_distribution.cpp
2 
3 
4 namespace bayesopt
5 {
6 
7  StudentTDistribution::StudentTDistribution(randEngine& eng):
8  ProbabilityDistribution(eng), d_(2)
9  {
10  mean_ = 0.0; std_ = 1.0; dof_ = 2;
11  }
12 
13  StudentTDistribution::~StudentTDistribution(){}
14 
15 
17  size_t g)
18  {
19  const double diff = min - mean_;
20  const double z = diff / std_;
21 
22  assert((g == 1) && "Students t EI with exponent not yet supported.");
23  return -(diff * boost::math::cdf(d_,z)
24  + (dof_*std_+z*diff)/(dof_-1) * boost::math::pdf(d_,z) );
25  } // negativeExpectedImprovement
26 
27 
29  {
30  return mean_ - beta*std_/sqrt(static_cast<double>(dof_));
31  } // lowerConfidenceBound
32 
34  double epsilon)
35  {
36  return -cdf(d_,(min - mean_ + epsilon)/std_);
37  } // negativeProbabilityOfImprovement
38 
39 
41  {
42  double n = static_cast<double>(dof_);
43  randNFloat normal(mtRandom,normalDist(mean_,std_));
44  randGFloat gamma(mtRandom,gammaDist(n/2.0));
45  return normal() / sqrt(2*gamma()/n);
46  } // sample_query
47 
48 } //namespace bayesopt
Namespace of the library interface.
Definition: using.dox:1
double lowerConfidenceBound(double beta)
Lower confindence bound.
double negativeProbabilityOfImprovement(double min, double epsilon)
Probability of improvement algorithm for minimization.
double negativeExpectedImprovement(double min, size_t g)
Expected Improvement algorithm for minimization.
double sample_query()
Sample outcome acording to the marginal distribution at the query point.
Student&#39;s t probability distribution.