SHAZAM Algorithms

Sources of Algorithms used in SHAZAM



Random Number Generation

Random number generation uses the method by Brent [1974]. The reference is:

  • Brent, R.P., "Algorithm 488: A Gaussian Pseudo-Random Number Generator", Communications of the ACM, Vol. 17, 1974, pp. 704-706.

Statistical Distributions (the DISTRIB command)

The calculation of probabilities and critical values for distributions typically requires the use of numerical methods and algorithms. A brief summary of sources used in SHAZAM follows.

The logarithm of the gamma function is calculated with algorithm AS245 by Macleod [1989]. This is used for calculating the pdf of the t-distribution, the F-distribution, the chi-square distribution and others.

The CDF for the t-distribution, the F-distribution, the binomial distribution and the negative binomial distribution is evaluated using the incomplete beta function (algorithm AS63 by Majunder and Bhattacharjee [1973]). The CDF for the chi-square distribution is evaluated using the incomplete gamma function (algorithm AS239 by Shea [1988]).

The reference for computing non-central F probabilities is the algorithm by Norton [1983]. The algorithm makes use of the CDF of the central F distribution. The method is exact to an accuracy set in SHAZAM at 0.0001.

The inverse of the standard normal distribution is calculated with the method by Gebhardt [1964] and Abramowitz and Stegun [1964, p. 933, equation 26.2.23]. An approximation to the inverse of the t-distribution is calculated with the method by Abramowitz and Stegun [1964, p. 949]. This is not accurate with 1 degree of freedom and, in this case, a polynomial approximation is used.

An approximation to the inverse of the F-distribution is calculated with the method by Abramowitz and Stegun [1964, p. 947]. Critical values for the chi-square distribution are calculated using the method of Best and Roberts [1975].

References
  • Abramowitz, M. and Stegun, I.A., Handbook of Mathematical Functions, Applied Mathematics Series, Vol. 55, 1964.
  • Best, D.J. and Roberts, D.E., "The Percentage Points of the chi-square Distribution, Algorithm AS 91", Applied Statistics, Vol. 24, 1975, p. 35. (also available in Griffiths, P. and Hill, I.D., ed., Applied Statistics Algorithms, Ellis Horwood, 1985.)
  • Gebhardt, F., Mathematics of Computation, 1964, pp. 302-306.
  • Macleod, A.J., "A robust and reliable algorithm for the logarithm of the gamma function", Applied Statistics, Vol. 38, 1989, pp. 397-402.
  • Majunder, K.L. and Bhattacharjee, "The incomplete beta integral", AS63, Applied Statistics, Vol. 22, 1973, pp. 409-411.
  • Norton, V., "A Simple Algorithm for Computing the non-central F Distribution", Applied Statistics, Vol. 32, 1983, pp. 84-85.
  • Shea, B.L., "Chi-squared and Incomplete Gamma Integral", AS239, Applied Statistics, Vol. 37, 1988, pp. 466-473.

Eigenvalues and eigenvectors (the MATRIX command)

For a symmetric matrix, the matrix is reduced to tridiagonal form. The eigenvalues and eigenvectors are found by the QL algorithm. The references are:

  • Bowdler, Martin, Reinsch and Wilkinson (1968), Num. Math. 11, pp. 293-306.
  • Wilkinson, J.H. and Reinsch, C. (1971), Linear Algebra, Vol. II of Handbook for Automatic Computation, Springer-Verlag, New York, pp. 227-240.

For a general matrix, the matrix is reduced to Hessenberg form. The eigenvalues and eigenvectors are found by the QR algorithm. The references are:

  • Martin, Peters and Wilkinson (1970), Num. Math. 14, 219-231.
  • Peters and Wilkinson (1970), Num. Math. 16, 181-204.
  • Wilkinson, J.H. and Reinsch, C. (1971), Linear Algebra, Vol. II of Handbook for Automatic Computation, Springer-Verlag, New York, pp. 359-395.

Home [SHAZAM Guide home]