2 #include <boost/math/special_functions/factorials.hpp> 8 GaussianDistribution::GaussianDistribution(randEngine& eng):
9 ProbabilityDistribution(eng)
11 mean_ = 0.0; std_ = 1.0;
15 GaussianDistribution::~GaussianDistribution(){}
21 using boost::math::factorial;
23 const double diff = min - mean_;
24 const double z = diff / std_;
25 const double pdf_z = boost::math::pdf(d_,z);
26 const double cdf_z = boost::math::cdf(d_,z);
29 return -1.0 * ( diff * cdf_z + std_ * pdf_z );
32 const double fg = factorial<double>(g);
36 double sumEI = pow(z,static_cast<double>(g))*Tm2 - g*pow(z,static_cast<double>(g-1))*Tm1;
38 for (
size_t ii = 2; ii < g; ++ii)
40 double Tact = (ii-1)*Tm2 - pdf_z*pow(z,static_cast<double>(ii-1));
41 sumEI += pow(-1.0,static_cast<double>(ii))*
42 (fg / ( factorial<double>(ii)*factorial<double>(g-ii) ) )*
43 pow(z,static_cast<double>(g-ii))*Tact;
46 Tm2 = Tm1; Tm1 = Tact;
48 return -1.0 * pow(std_,static_cast<double>(g)) * sumEI;
55 return mean_ - beta*std_;
62 return -cdf(d_,(min - mean_ + epsilon)/std_);
68 randNFloat sample(mtRandom,normalDist(mean_,std_));
double negativeExpectedImprovement(double min, size_t g)
Expected Improvement algorithm for minimization.
Namespace of the library interface.
double negativeProbabilityOfImprovement(double min, double epsilon)
Probability of improvement algorithm for minimization.
Gaussian probability distribution.
double sample_query()
Sample outcome acording to the marginal distribution at the query point.
double lowerConfidenceBound(double beta)
Lower confindence bound.