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 F(k,n,p)=I1−p(n−k,1+k), 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.
Gets the defined range for the distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The defined range of the probability distributions [0, infinity). As using a value of infinity may cause issue, this routine returns huge(0.0d0) instead.
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 f(k,n,p)=n!k!(n−k!)pk(1−p)n−k.
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.
Recenters the distribution about the supplied value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(binomial_distribution), | intent(inout) | :: | this |
The binomial_distribution object. |
||
real(kind=real64), | intent(in) | :: | x |
The value about which to recenter. |
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.