25 #include <queso/BasicPdfsCXX11.h>
27 #ifdef QUESO_HAVE_CXX11
56 if (x == 0.0 || x == 1.0) {
57 if (alpha > 1.0 && beta > 1.0) {
61 ln_gamma_apb = std::lgamma(alpha + beta);
62 ln_gamma_a = std::lgamma(alpha);
63 ln_gamma_b = std::lgamma(beta);
65 return std::exp(ln_gamma_apb - ln_gamma_a - ln_gamma_b) *
66 std::pow(x, alpha - 1) * std::pow(1 - x, beta - 1);
70 ln_gamma_apb = std::lgamma(alpha + beta);
71 ln_gamma_a = std::lgamma(alpha);
72 ln_gamma_b = std::lgamma(beta);
74 return std::exp(ln_gamma_apb - ln_gamma_a - ln_gamma_b +
75 (alpha - 1) * std::log(x) + (beta - 1) * std::log1p(-x));
92 double ln_gamma_a = std::lgamma(a);
93 return std::exp(-ln_gamma_a - a * std::log(b)) * std::pow(x, a - 1) *
98 double ln_gamma_a = std::lgamma(a);
99 return std::exp(-ln_gamma_a - a * std::log(b) + (a - 1) * std::log(x) -
107 #endif // QUESO_HAVE_CXX11
BasicPdfsCXX11()
Default constructor.
double gammaPdfActualValue(double x, double a, double b) const
Actual value of the Gamma PDF.
~BasicPdfsCXX11()
Destructor.
TODO: Base class for basic PDFs (via either GSL or Boost).
double betaPdfActualValue(double x, double alpha, double beta) const
Actual value of the Beta PDF.