Defines a binomial distribution. The binomial distribution describes the probability p of getting k successes in n independent trials.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int32), | public | :: | n |
The number of independent trials. |
|||
real(kind=real64), | public | :: | p |
The success probability for each trial. This parameter must exist on the set [0, 1]. |
Computes the cumulative distribution funtion.
The CDF for a binomial distribution is given as , which is simply the regularized incomplete beta function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
||
real(kind=real64), | intent(in) | :: | x |
The value at which to evaluate the function. This parameter is the number k successes in the n independent trials. As such, this parameter must exist on the set [0, n]. |
The value of the function.
Computes the mean of the distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The mean.
Computes the median of the distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The median.
Computes the mode of the distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The mode.
Computes the probability mass function.
The PMF for a binomial distribution is given as .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
||
real(kind=real64), | intent(in) | :: | x |
The value at which to evaluate the function. This parameter is the number k successes in the n independent trials. As such, this parameter must exist on the set [0, n]. |
The value of the function.
Computes the standardized variable for the distribution.
Computes the standardized variable for the distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(distribution), | intent(in) | :: | this |
The distribution object. |
||
real(kind=real64), | intent(in) | :: | x |
The value of interest. |
The result.
Computes the variance of the distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The variance.