Provides functions for binomial distribution calculations.
More...
#include <BinomialHelper.h>
|
static double | logFactorial (int n) |
| Calculates the natural logarithm of the factorial of an integer.
|
|
static double | logCombination (int n, int k) |
| Calculates the natural logarithm of the combination of n items taken k at a time.
|
|
static int | combination (int n, int k) |
| Calculates the combination of n items taken k at a time.
|
|
static double | binomialProbability (int n, int k, double p) |
| Calculates the binomial probability.
|
|
static double | binomialCDF (int n, int k, double p) |
| Calculates the cumulative distribution function (CDF) for a binomial distribution.
|
|
static int | inverseBinomialCDF (double targetP, int n, double p) |
| Calculates the inverse of the binomial CDF.
|
|
Provides functions for binomial distribution calculations.
◆ binomialCDF()
double BinomialHelper::binomialCDF |
( |
int |
n, |
|
|
int |
k, |
|
|
double |
p |
|
) |
| |
|
static |
Calculates the cumulative distribution function (CDF) for a binomial distribution.
- Parameters
-
n | The number of trials. |
k | The number of successes. |
p | The probability of success on a single trial. |
- Returns
- The cumulative probability of getting up to k successes in n trials.
◆ binomialProbability()
double BinomialHelper::binomialProbability |
( |
int |
n, |
|
|
int |
k, |
|
|
double |
p |
|
) |
| |
|
static |
Calculates the binomial probability.
- Parameters
-
n | The number of trials. |
k | The number of successes. |
p | The probability of success on a single trial. |
- Returns
- The binomial probability of getting k successes in n trials.
◆ combination()
int BinomialHelper::combination |
( |
int |
n, |
|
|
int |
k |
|
) |
| |
|
static |
Calculates the combination of n items taken k at a time.
- Parameters
-
n | The total number of items. |
k | The number of items to choose. |
- Returns
- The combination of n items taken k at a time.
◆ inverseBinomialCDF()
int BinomialHelper::inverseBinomialCDF |
( |
double |
targetP, |
|
|
int |
n, |
|
|
double |
p |
|
) |
| |
|
static |
Calculates the inverse of the binomial CDF.
- Parameters
-
targetP | The target cumulative probability. |
n | The number of trials. |
p | The probability of success on a single trial. |
- Returns
- The smallest number of successes such that the CDF is greater than or equal to targetP.
◆ logCombination()
double BinomialHelper::logCombination |
( |
int |
n, |
|
|
int |
k |
|
) |
| |
|
static |
Calculates the natural logarithm of the combination of n items taken k at a time.
- Parameters
-
n | The total number of items. |
k | The number of items to choose. |
- Returns
- The natural logarithm of the combination of n items taken k at a time.
◆ logFactorial()
double BinomialHelper::logFactorial |
( |
int |
n | ) |
|
|
static |
Calculates the natural logarithm of the factorial of an integer.
- Parameters
-
- Returns
- The natural logarithm of the factorial of n.
The documentation for this class was generated from the following files: