Evaluates the standard normal (Gaussian) distribution function.
#include <imsl.h>
float imsl_f_normal_cdf (float x)
The type double function is imsl_d_normal_cdf.
float x
(Input)
Point at which the normal distribution function is to be
evaluated.
The probability that a normal random variable takes a value less than or equal to x.
The function imsl_f_normal_cdf evaluates the distribution function, Φ, of a standard normal (Gaussian) random variable; that is,

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 standard normal distribution (for which imsl_f_normal_cdf is the distribution function) has mean of 0 and variance of 1. The probability that a normal random variable with mean μ and variance σ2 is less than y is given by imsl_f_normal_cdf evaluated at (y − μ)/σ.
Φ(x) is evaluated by use of the complementary error function, imsl_f_erfc. The relationship is:


Figure 9- 13 Plot of Φ(x)
Suppose X is a normal random variable with mean 100 and variance 225. This example finds the probability that X is less than 90 and the probability that X is between 105 and 110.
#include <imsl.h>
main()
{
float p, x1, x2;
x1 = (90.0-100.0)/15.0;
p =
imsl_f_normal_cdf(x1);
printf("The probability that X is
less than 90 is %6.4f\n\n", p);
x1 =
(105.0-100.0)/15.0;
x2 =
(110.0-100.0)/15.0;
p = imsl_f_normal_cdf(x2) -
imsl_f_normal_cdf(x1);
printf("The probability that
X is between 105 and 110 is %6.4f\n", p);
}
The probability that X is less than 90 is
0.2525
The probability that X is between 105 and 110 is
0.1169
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |