|
IDL Analyst Reference Guide: Probability Distribution Functions and Inverses |
|
The IMSL_BINOMIALCDF function evaluates the binomial distribution function.
| Note This routine requires an IDL Analyst license. For more information, contact your ITT Visual Information Solutions sales or technical support representative. |
Result = IMSL_BINOMIALCDF(k, n, p [, /DOUBLE])
The probability that k or fewer successes occur in n independent Bernoulli trials, each of which has a probability p of success.
Argument for which the binomial distribution function is to be evaluated.
Number of Bernoulli trials.
Probability of success on each trial.
If present and nonzero, double precision is used.
The IMSL_BINOMIALCDF function evaluates the distribution function of a binomial random variable with parameters n and p by summing probabilities of the random variable taking on the specific values in its range. These probabilities are computed by the following recursive relationship:

To avoid the possibility of underflow, the probabilities are computed forward from 0 if k is not greater than n times p; otherwise, they are computed backward from n. The smallest positive machine number, e, is used as the starting value for summing the probabilities, which are rescaled by (1 – p)ne if forward computation is performed and by pne if backward computation is done.
For the special case of p = 0, IMSL_BINOMIALCDF is set to 1; for the case p = 1, IMSL_BINOMIALCDF is set to 1 if k = n and is set to zero otherwise.
Suppose X is a binomial random variable with n = 5 and p = 0.95. This example finds the probability that X is less than or equal to 3.
p = IMSL_BINOMIALCDF(3, 5, .95) PM, 'Pr(x < 3) = ', p, FORMAT = '(a12, f7.4)' Pr(x < 3) = 0.0226
STAT_LESS_THAN_ZERO—Input parameter, k, is less than zero.
STAT_GREATER_THAN_N—Input parameter, k, is greater than the number of Bernoulli trials, n.
IDL Online Help (March 06, 2007)