|
IDL Analyst Reference Guide: Probability Distribution Functions and Inverses |
|
The IMSL_GAMMACDF function evaluates the gamma 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_GAMMACDF(x, a [, /DOUBLE] )
The probability that a gamma random variable takes a value less than or equal to x.
Shape parameter of the gamma distribution. This parameter must be positive.
Argument for which the gamma distribution function is to be evaluated.
If present and nonzero, double precision is used.
The IMSL_GAMMACDF function evaluates the distribution function, F, of a gamma random variable with shape parameter a; that is:

where G(¥) is the gamma function. (The gamma function is the integral from 0 to infinity of the same integrand as above.) The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.
The gamma distribution is often defined as a two-parameter distribution with a scale parameter b (which must be positive) or even as a three-parameter distribution in which the third parameter c is a location parameter. In the most general case, the probability density function over (c, infinity) is as follows:

If T is such a random variable with parameters a, b, and c, the probability that T £ t0 can be obtained from IMSL_GAMMACDF by setting x = (t0 – c ) / b.
If x is less than a or if x is less than or equal to 1.0, IMSL_GAMMACDF uses a series expansion; otherwise, a continued fraction expansion is used. (See Abramowitz and Stegun, 1964.)
Let X be a gamma random variable with a shape parameter of 4. (In this case, it has an Erlang distribution, since the shape parameter is an integer.) This example finds the probability that X is less than 0.5 and the probability that X is between 0.5 and 1.0.
a = 4 x = .5 p = IMSL_GAMMACDF(x, a) PM, p, Title = 'The probability that X is less ' + $ 'than .5 is:' The probability that X is less than .5 is: 0.00175162 x = 1 p = IMSL_GAMMACDF(x, a) - p PM, p, Title = 'The probability that X is between .5 and 1 is:' The probability that X is between .5 and 1 is: 0.0172365
STAT_LESS_THAN_ZERO—Input argument, x, is less than zero.
STAT_X_AND_A_TOO_LARGE—Function overflows because x and a are too large.
IDL Online Help (March 06, 2007)