IMSL_BETACDF

Syntax | Return Value | Arguments | Keywords | Discussion | Example | Version History

The IMSL_BETACDF function evaluates the beta probability distribution function.

Note
This routine requires an IDL Advanced Math and Stats license. For more information, contact your ITT Visual Information Solutions sales or technical support representative.

Syntax

Result = IMSL_BETACDF(x, pin, qin [, /DOUBLE] [, /INVERSE])

Return Value

The probability that a beta random variable takes on a value less than or equal to x.

Arguments

pin

First beta distribution parameter. Parameter pin must be positive.

qin

Second beta distribution parameter. Parameter qin must be positive.

x

Argument for which the beta probability distribution function is to be evaluated. If Inverse is specified, argument x represents the probability for which the inverse of the Beta distribution function is to be evaluated. In this case, x must be in the open interval (0.0, 1.0).

Keywords

DOUBLE

If present and nonzero, double precision is used.

INVERSE

If present and nonzero, evaluates the inverse of the Beta distribution function. If Inverse is specified, argument x represents the probability for which the inverse of the Beta distribution function is to be evaluated. In this case, x must be in the open interval (0.0, 1.0).

Discussion

The IMSL_BETACDF function evaluates the distribution function of a beta random variable with parameters pin and qin. This function is sometimes called the incomplete beta ratio and is denoted by Ix(p, q), where p = pin and q = qin. It is given by:

IMSL_BETACDF-21.jpg

where Γ(¥) is the gamma function. The value of the distribution function by Ix(p, q) is the probability that the random variable takes a value less than or equal to x.

The integral in the expression above is called the incomplete beta function and is denoted by βx(p, q). The constant in the expression is the reciprocal of the beta function (the incomplete function evaluated at 1) and is denoted by βx(p, q).

If the keyword Inverse is specified, the IMSL_BETACDF function evaluates the inverse distribution function of a beta random variable with parameters pin and qin. With P = x, p = pin and q = qin, it returns x such that:

IMSL_BETACDF-22.jpg

where Γ(¥) is the gamma function. The probability that the random variable takes a value less than or equal to x is P.

The BETCDF function uses the method of Bosten and Battiste (1974).

Example

Suppose X is a beta random variable with parameters 12 and 12 (X has a symmetric distribution). This example finds the probability that X is less than 0.6 and the probability that X is between 0.5 and 0.6. (Since X is a symmetric beta random variable, the probability that it is less than 0.5 is 0.5.)

p = IMSL_BETACDF(.6, 12, 12) 
; Call IMSL_BETACDF to compute first probability and output 
results. 
PM, p, Title = 'The probability that X is less than ' + $ 
   '0.6 is:', FORMAT= '(f8.4)'  
 
The probability that X is less than 0.6 is: 0.8364 
 
p = p - IMSL_BETACDF(.5, 12, 12) 
; Call IMSL_BETACDF and use the previously computed  
; probability to determine the next probability. 
PM, p, FORMAT = '(f8.4)', title = 'The    probability that X  ' +   $ 
   'is between 0.5 and 0.6 is:' 
 
The probability that X is between 0.5 and 0.6 is: 0.3364 

Version History

6.4

Introduced