openGPMP
Open Source Mathematics Package
cdfs.hpp
Go to the documentation of this file.
1 /*************************************************************************
2  *
3  * Project
4  * _____ _____ __ __ _____
5  * / ____| __ \| \/ | __ \
6  * ___ _ __ ___ _ __ | | __| |__) | \ / | |__) |
7  * / _ \| '_ \ / _ \ '_ \| | |_ | ___/| |\/| | ___/
8  *| (_) | |_) | __/ | | | |__| | | | | | | |
9  * \___/| .__/ \___|_| |_|\_____|_| |_| |_|_|
10  * | |
11  * |_|
12  *
13  * Copyright (C) Akiel Aries, <akiel@akiel.org>, et al.
14  *
15  * This software is licensed as described in the file LICENSE, which
16  * you should have received as part of this distribution. The terms
17  * among other details are referenced in the official documentation
18  * seen here : https://akielaries.github.io/openGPMP/ along with
19  * important files seen in this project.
20  *
21  * You may opt to use, copy, modify, merge, publish, distribute
22  * and/or sell copies of the Software, and permit persons to whom
23  * the Software is furnished to do so, under the terms of the
24  * LICENSE file.
25  *
26  *
27  *
28  * This software is distributed on an AS IS basis, WITHOUT
29  * WARRANTY OF ANY KIND, either express or implied.
30  *
31  ************************************************************************/
32 #ifndef CDFS_HPP
33 #define CDFS_HPP
34 
35 namespace gpmp {
36 namespace stats {
37 
43 class CDF {
44  public:
52  static double bernoulli(double x, double p);
53 
62  static double beta(double x, double alpha, double beta);
63 
72  static double binomial(int k, int n, double p);
73 
82  static double cauchy(double x, double x0, double gamma);
83 
91  static double chi_squared(double x, double k);
92 
100  static double exponential(double x, double lambda);
101 
112  static double f(double x, double df1, double df2);
113 
122  static double gamma(double x, double shape, double scale);
123 
132  static double inverse_gamma(double x, double shape, double scale);
133 
142  static double inverse_gaussian(double x, double mu, double lambda);
143 
152  static double laplace(double x, double mu, double b);
153 
162  static double logistic(double x, double mu, double s);
163 
173  static double log_normal(double x, double mu, double sigma);
174 
183  static double gaussian(double x, double mu, double sigma);
184 
192  static double poisson(int k, double lambda);
193 
200  static double rademacher(double x);
201 
209  static double student_t(double x, double df);
210 
219  static double uniform(double x, double a, double b);
220 
229  static double weibull(double x, double shape, double scale);
230 
237  static double normal_cdf(double x);
238 
246  static double incomplete_beta(double a, double b, double x);
247 
254  static double incomplete_gamma(double a, double x);
255 };
256 
257 } // namespace stats
258 } // namespace gpmp
259 
260 #endif
Class providing methods for computing cumulative distribution functions (CDFs)
Definition: cdfs.hpp:43
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 normal_cdf(double x)
Compute the cumulative distribution function (CDF) of the standard normal distribution.
Definition: cdfs.cpp:196
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 incomplete_gamma(double a, double x)
Compute the incomplete gamma function.
Definition: cdfs.cpp:218
static double incomplete_beta(double a, double b, double x)
Compute the incomplete beta function.
Definition: cdfs.cpp:201
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
The source C++ openGPMP namespace.