openGPMP
Open Source Mathematics Package
cdfs_ex.cpp
Go to the documentation of this file.
1 #include <iostream>
3 
4 int main() {
5  double p = 0.7;
6  double result_bernoulli = gpmp::stats::CDF::bernoulli(0, p);
7  double result_beta = gpmp::stats::CDF::beta(0.5, 2.0, 2.0);
8  double result_binomial = gpmp::stats::CDF::binomial(2, 5, p);
9  double result_cauchy = gpmp::stats::CDF::cauchy(1.0, 0.0, 1.0);
10  double result_chi_squared = gpmp::stats::CDF::chi_squared(3.0, 2.0);
11  double result_exponential = gpmp::stats::CDF::exponential(2.0, 0.5);
12  double result_f = gpmp::stats::CDF::f(2.0, 2.0, 3.0);
13  double result_gamma = gpmp::stats::CDF::gamma(2.0, 2.0, 1.0);
14  double result_inverse_gamma =
15  gpmp::stats::CDF::inverse_gamma(0.5, 2.0, 1.0);
16  double result_inverse_gaussian =
18  double result_laplace = gpmp::stats::CDF::laplace(1.0, 0.0, 1.0);
19  double result_logistic = gpmp::stats::CDF::logistic(1.0, 0.0, 1.0);
20  double result_log_normal = gpmp::stats::CDF::log_normal(1.0, 0.0, 1.0);
21  double result_normal = gpmp::stats::CDF::gaussian(1.0, 0.0, 1.0);
22  double result_poisson = gpmp::stats::CDF::poisson(3, 2.0);
23  double result_rademacher = gpmp::stats::CDF::rademacher(0.5);
24  double result_student_t = gpmp::stats::CDF::student_t(1.0, 2.0);
25  double result_uniform = gpmp::stats::CDF::uniform(0.5, 0.0, 1.0);
26  double result_weibull = gpmp::stats::CDF::weibull(1.0, 2.0, 1.0);
27 
28  return 0;
29 }
int main()
Definition: cdfs_ex.cpp:4
static double gaussian(double x, double mu, double sigma)
Compute the cumulative distribution function (CDF) of the normal (Gaussian) distribution.
Definition: cdfs.cpp:147
static double bernoulli(double x, double p)
Compute the cumulative distribution function (CDF) of the Bernoulli distribution.
Definition: cdfs.cpp:43
static double inverse_gamma(double x, double shape, double scale)
Compute the cumulative distribution function (CDF) of the inverse-gamma distribution.
Definition: cdfs.cpp:110
static double laplace(double x, double mu, double b)
Compute the cumulative distribution function (CDF) of the Laplace distribution.
Definition: cdfs.cpp:126
static double inverse_gaussian(double x, double mu, double lambda)
Compute the cumulative distribution function (CDF) of the inverse-Gaussian distribution.
Definition: cdfs.cpp:118
static double beta(double x, double alpha, double beta)
Compute the cumulative distribution function (CDF) of the beta distribution.
Definition: cdfs.cpp:53
static double exponential(double x, double lambda)
Compute the cumulative distribution function (CDF) of the exponential distribution.
Definition: cdfs.cpp:86
static double gamma(double x, double shape, double scale)
Compute the cumulative distribution function (CDF) of the gamma distribution.
Definition: cdfs.cpp:102
static double poisson(int k, double lambda)
Compute the cumulative distribution function (CDF) of the Poisson distribution.
Definition: cdfs.cpp:152
static double f(double x, double df1, double df2)
Compute the cumulative distribution function (CDF) of the F distribution.
Definition: cdfs.cpp:94
static double chi_squared(double x, double k)
Compute the cumulative distribution function (CDF) of the chi-squared distribution.
Definition: cdfs.cpp:78
static double rademacher(double x)
Compute the cumulative distribution function (CDF) of the Rademacher distribution.
Definition: cdfs.cpp:160
static double weibull(double x, double shape, double scale)
Compute the cumulative distribution function (CDF) of the Weibull distribution.
Definition: cdfs.cpp:188
static double binomial(int k, int n, double p)
Compute the cumulative distribution function (CDF) of the binomial distribution.
Definition: cdfs.cpp:63
static double student_t(double x, double df)
Compute the cumulative distribution function (CDF) of Student's t distribution.
Definition: cdfs.cpp:170
static double logistic(double x, double mu, double s)
Compute the cumulative distribution function (CDF) of the logistic distribution.
Definition: cdfs.cpp:134
static double log_normal(double x, double mu, double sigma)
Compute the cumulative distribution function (CDF) of the log-normal distribution.
Definition: cdfs.cpp:139
static double cauchy(double x, double x0, double gamma)
Compute the cumulative distribution function (CDF) of the Cauchy distribution.
Definition: cdfs.cpp:73
static double uniform(double x, double a, double b)
Compute the cumulative distribution function (CDF) of the uniform distribution.
Definition: cdfs.cpp:178