Evaluates the beta probability distribution function.
#include <imsls.h>
float imsls_f_beta_cdf (float x, float pin, float qin)
The type double function is imsls_d_beta_cdf.
float x
(Input)
Argument for which the beta probability distribution function is to
be evaluated.
float pin
(Input)
First beta distribution parameter. Argument pin must be
positive.
float qin
(Input)
Second beta distribution parameter. Argument qin must be
positive.
The probability that a beta random variable takes on a
value less than or equal
to x.
Function imsls_f_beta_cdf evaluates the distribution function of a beta random variable with parameters pin and qin. This function is sometimes called the incomplete beta ratio and, with p = pin and q = qin, is denoted by Ix (p, q). It is given by
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 β(p, q).
Function imsls_f_beta_cdf uses the method of Bosten and Battiste (1974).
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.)
#include
<imsls.h>
main()
{
float p, pin, qin,
x;
pin =
12.0;
qin =
12.0;
x =
0.6;
p = imsls_f_beta_cdf(x, pin,
qin);
printf("The probability that
X is less than 0.6 is
%6.4f\n",
p);
x =
0.5;
p -= imsls_f_beta_cdf(x, pin,
qin);
printf("The probability that
X is between 0.5 and");
printf("
0.6 is %6.4f\n", p);
}
The probability that X is less than 0.6 is 0.8364
The
probability that X is between 0.5 and 0.6 is 0.3364
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |