naginterfaces.library.stat.prob_binomial¶
- naginterfaces.library.stat.prob_binomial(n, p, k)[source]¶
prob_binomial
returns the lower tail, upper tail and point probabilities associated with a binomial distribution.For full information please refer to the NAG Library document for g01bj
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g01/g01bjf.html
- Parameters
- nint
The parameter of the binomial distribution.
- pfloat
The parameter of the binomial distribution.
- kint
The integer which defines the required probabilities.
- Returns
- plekfloat
The lower tail probability, .
- pgtkfloat
The upper tail probability, .
- peqkfloat
The point probability, .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, is too large to be represented exactly as a double precision number.
- (errno )
On entry, the variance exceeds .
- Notes
Let denote a random variable having a binomial distribution with parameters and ( and ). Then
The mean of the distribution is and the variance is .
prob_binomial
computes for given , and the probabilities:The method is similar to the method for the Poisson distribution described in Knüsel (1986).
- References
Knüsel, L, 1986, Computation of the chi-square and Poisson distribution, SIAM J. Sci. Statist. Comput. (7), 1022–1036