Distribution Functions

Several statistical distribution functions and their inverses are described in this chapter. The functions form a self contained module that may be added to YAMP if you need them. They are collected from several sources. Most of them are based on Numerical Recipes in C. I have brought them up to date by making them acceptable to C++. I also converted them to using doubles. Some are translations from Abramowitz and Stegun [#!AS:mh!#]. Some are taken from the Journal of Applied Statistics.

The distribution module contains the 4 most frequently used continuous distributions in applied statistics. The standard normal distribution is a normalized version of Euler's error function. It represents the limiting distribution of sample means from many random variables. The F-distributions are derived from the beta distributions, and are used in the analysis of variance. The t-distributions are also used in hypothesis testing. The chi-square familly is derived from the gamma distribution, and are also used in hypothesis testing.

In general, the probability functions are distribution functions. They return the probability that a random variable is less than a value, ie

P[Xx] = $\displaystyle \int_{{-\infty}}^{x}$f (t)dt (1)
where f (t) is a probability density function. The inverse functions return the value of x for a given probability. The inverse functions are calculated almost exclusively by bracketting and bisection.

The test function is a simple menu program called DISTTEST.CPP. These are not the best programs on the market but they are reasonably accurate for my applications. They tend to fall apart in the far tails or far extremes of the parameter spaces. The regions where they fail though is where the probabilities are extremely close to zero or one. The non-central distributions may also fail with very large or very small non-centrality parameters. You might like to see Louis Baker's new book for another presentation of similar functions[#!Bk:mf!#]. It has most of the functions from Abramowitz and Stegun too. (A minor miracle in my humble opinion). You also should not hesitate to turn to the IMSL or SAS routines for these probabilities since they represent industry standards.



Subsections