59 return incomplete_beta(alpha, beta, x);
69 return incomplete_beta(1.0 - p, n - k, k + 1);
74 return 0.5 + atan((x - x0) / gamma) / M_PI;
82 return incomplete_gamma(k / 2.0, x / 2.0);
90 return 1.0 - exp(-lambda * x);
98 return incomplete_beta(df1 / 2.0, df2 / 2.0, df1 / (df1 + df2 * x));
106 return incomplete_gamma(shape, x / scale);
114 return 1.0 - incomplete_gamma(shape, scale / x);
122 return normal_cdf(sqrt(lambda / x) * (x / mu - 1.0));
128 return 0.5 * exp((x - mu) / b);
130 return 1.0 - 0.5 * exp(-(x - mu) / b);
135 return 1.0 / (1.0 + exp(-(x - mu) / s));
143 return 0.5 + 0.5 * erf((log(x) - mu) / (sqrt(2.0) * sigma));
148 return 0.5 * (1 + erf((x - mu) / (sigma * sqrt(2))));
156 return incomplete_gamma(k + 1, lambda);
173 return 0.5 + 0.5 * std::tgamma((df + 1) / 2) * std::hypot(1, x / sqrt(df)) /
174 (sqrt(df) * std::tgamma(df / 2));
182 return (x - a) / (b - a);
192 return 1.0 - exp(-pow(x / scale, shape));
197 return 0.5 * (1 + erf(x / sqrt(2.0)));
202 const int maxIterations = 1000;
203 const double epsilon = 1e-12;
206 for (
int k = 0; k < maxIterations; ++k) {
209 : (a + k - 1) * (b - k) / (a + b + k - 1) * x / (k + 1));
211 if (std::abs(term) < epsilon * std::abs(result))
214 return result * std::pow(x, a) * std::pow(1 - x, b) / (a * std::beta(a, b));
219 const int maxIterations = 1000;
220 const double epsilon = 1e-12;
223 for (
int k = 0; k < maxIterations; ++k) {
226 if (std::abs(term) < epsilon * std::abs(result))
229 return exp(-x) * std::pow(x, a) * result / std::tgamma(a);
static double gaussian(double x, double mu, double sigma)
Compute the cumulative distribution function (CDF) of the normal (Gaussian) distribution.
static double bernoulli(double x, double p)
Compute the cumulative distribution function (CDF) of the Bernoulli distribution.
static double normal_cdf(double x)
Compute the cumulative distribution function (CDF) of the standard normal distribution.
static double inverse_gamma(double x, double shape, double scale)
Compute the cumulative distribution function (CDF) of the inverse-gamma distribution.
static double laplace(double x, double mu, double b)
Compute the cumulative distribution function (CDF) of the Laplace distribution.
static double inverse_gaussian(double x, double mu, double lambda)
Compute the cumulative distribution function (CDF) of the inverse-Gaussian distribution.
static double beta(double x, double alpha, double beta)
Compute the cumulative distribution function (CDF) of the beta distribution.
static double exponential(double x, double lambda)
Compute the cumulative distribution function (CDF) of the exponential distribution.
static double gamma(double x, double shape, double scale)
Compute the cumulative distribution function (CDF) of the gamma distribution.
static double poisson(int k, double lambda)
Compute the cumulative distribution function (CDF) of the Poisson distribution.
static double f(double x, double df1, double df2)
Compute the cumulative distribution function (CDF) of the F distribution.
static double chi_squared(double x, double k)
Compute the cumulative distribution function (CDF) of the chi-squared distribution.
static double rademacher(double x)
Compute the cumulative distribution function (CDF) of the Rademacher distribution.
static double weibull(double x, double shape, double scale)
Compute the cumulative distribution function (CDF) of the Weibull distribution.
static double binomial(int k, int n, double p)
Compute the cumulative distribution function (CDF) of the binomial distribution.
static double student_t(double x, double df)
Compute the cumulative distribution function (CDF) of Student's t distribution.
static double incomplete_gamma(double a, double x)
Compute the incomplete gamma function.
static double incomplete_beta(double a, double b, double x)
Compute the incomplete beta function.
static double logistic(double x, double mu, double s)
Compute the cumulative distribution function (CDF) of the logistic distribution.
static double log_normal(double x, double mu, double sigma)
Compute the cumulative distribution function (CDF) of the log-normal distribution.
static double cauchy(double x, double x0, double gamma)
Compute the cumulative distribution function (CDF) of the Cauchy distribution.
static double uniform(double x, double a, double b)
Compute the cumulative distribution function (CDF) of the uniform distribution.