PHIC 3CW "30 July 2007" "mathcw-1.00"

Table of contents


NAME

phicf, phic, phicl, phicw, phicq, phicll, phicdf, phicd, phicdl, phicdll - complementary cumulative distribution function of the standard normal distribution

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float phicf (float x);

extern double phic (double x);

extern long double phicl (long double x);

extern __float80 phicw (__float80 x);

extern __float128 phicq (__float128 x);

extern long_long_double phicll (long_long_double x);

extern decimal_float phicdf (decimal_float x);

extern decimal_double phicd (decimal_double x);

extern decimal_long_double phicdl (decimal_long_double x);

extern decimal_long_long_double phicdll (decimal_long_long_double x);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

For the standard normal distribution, compute the complementary cumulative distribution function defined by

phic(x) = (1/sqrt(2pi)) integral(t = x:infinity) exp((-t**2)/2) dt
        = 1 - phi(x).
This is the area under the curve of the standard normal distribution to the right of x, sometimes called the upper-tail area. In mathematical text, phi(x) is written with an uppercase Greek phi: \(*F(x). phic(x) is written in a similar notation with subscript c.

If a random variable x has a normal distribution with mean \(*m (mu) and standard deviation \(*s (sigma), then the translated and scaled variable r = (x - \(*m)/\(*s has a standard normal distribution. The probability that x lies in the interval [a, b] is then given by

P(a <= x <= b) = \(*F((b - \(*m)/\(*s) - \(*F((a - \(*m)/\(*s).
Similarly, for the standard normal distribution, the probability that r lies in the interval [c, d] is
P(c <= r <= d) = \(*F(d) - \(*F(c).
From this, it follows that the probability that a normally-distributed random value x exceeds the mean by at least n standard deviations is therefore given by
P((\(*m + n\(*s) <= x <= \(if) = \(*F(\(if) - \(*F(((\(*m + n\(*s) - \(*m)/\(*s)
                 = 1 - \(*F(((\(*m + n\(*s) - \(*m)/\(*s)
                 = \(*F_c(((\(*m + n\(*s) - \(*m)/\(*s)
                 = \(*F_c(n).
That probability is independent of the mean and standard deviation, and drops off rapidly, as this table illustrates:

     n   0    1      2       3        4         5         6
\(*F_c(n)  0.5  0.159  0.0228  0.00135  3.17e-05  2.87e-07  9.87e-10

These data lead to the handy rules of thumb that only about one in a thousand normally-distributed random values lies more than three standard deviations from the mean, and fewer than one in a million lie more than five standard deviations away.

Statisticians use the notation z_\(*a (subscript \(*a (alpha)) for the function phic(\(*a). It is the 100*(1 - \(*a)-th percentile of the standard normal distribution. For example, z_{0.05} = iphic(0.05) ~= 1.645 is the value of x at the 95-th percentile: 95% of the area under the curve of the standard normal distribution lies to the left of x ~= 1.645.

Caution: While the two functions share the simple relation phi(x) + phic(x) = 1, it is only accurate to compute the larger from the smaller.


RETURN VALUES

If x is finite or Infinity, return the value of the complementary cumulative distribution function of the standard normal distribution. The value lies in [0,1] for x in [-Infinity, +Infinity].

ERRORS

For NaN arguments, the returned value is a quiet NaN, and errno is set to EDOM.

SEE ALSO

erf(3CW), erfc(3CW), ierf(3CW), ierfc(3CW), iphi(3CW), iphic(3CW), phi(3CW).