
STSPAC : Charlie Reeve Subroutines

Introduction

Charlie Reeve wrote the subroutines available here while he
was a staff member in the Statistical Engineering Division
(SED). Although these routines were intended for his personal
use rather than as a publically distributable library, we are
providing them because they contain some routines not readily
available elsewhere. In particular, it contains routines
for computing the cumulative distribution function and
generating random numbers for the doubly noncentral F and
doubly noncentral t distributions (these routines
are used by the Dataplot
program).
This software is not formally supported and is not being
further developed. It is provided on an "as is" basis.
There is no formal documentation for the subroutines.
However, most of the subroutines contain usage instructions
in the comments in the source code.

Publications

Although there is no formal documentation for these
subroutines, Charlie Reeve wrote a number of SED Notes that
document some of the algorithms coded in this library. The
NIST library has graciously scanned these documents and
converted them to PDF documents. These documents were scanned
from personal copies, so some of them contain external
markings. We apologize for this.
 Charlie Reeve, (October
1986), "Accurate Computation of the Log of the Gamma
Function", SED Note 861. (PDF format)
 Charlie Reeve, (October
1986), "An Algorithm for Computing the Gamma
C.D.F to a Specified Accuracy", SED Note 862.
(PDF format)
 Charlie Reeve, (October
1986), "An Algorithm for Computing the Beta
C.D.F to a Specified Accuracy", SED Note 863.
(PDF format)
 Charlie Reeve, (October
1986), "An Algorithm for Computing the Doubly
NonCentral F C.D.F. to a Specified Accuracy",
SED Note 864. (PDF format)
 Charlie Reeve, (October
1986), "An Algorithm for Computing the Doubly
NonCentral t C.D.F to a Specified Accuracy",
SED Note 865.

Contents

The following subroutines and functions are available:
 FUNCTION ANORMI  Infinity norm of NxN matrix
 SUBROUTINE BARTLT  Bartlett's test for homogeneity of
variances
 SUBROUTINE CDFBET  Compute the beta cumulative distribution
function
 SUBROUTINE CDFDNF  Compute the doubly noncentral F
cumulative distribution function
 SUBROUTINE CDFDNT  Compute the doubly noncentral t
cumulative distribution function
 SUBROUTINE CDFF  Compute the F cumulative distribution
function
 SUBROUTINE CDFGAM  Compute the gamma cumulative
distribution function
 SUBROUTINE CDFNOR  Compute the normal cumulative
distribution function
 SUBROUTINE CDFT  Compute the t cumulative distribution
function
 SUBROUTINE CENSCL  Compute estimates of location and scale
 SUBROUTINE CIELIP  Compute inverse prediction for a linear
fit (Eisenhart method)
 FUNCTION DGAMLN  Compute the log gamma function
 FUNCTION DNCMLN  Compute natural logarithm of
"N choose M", N!/[M!(NM)!]
 FUNCTION DPR1LN  Compute natural logarithm of:
N1!/[M1!(N1M1)!] N2!/[M2!(N2M2)!]

(N1+N2)!/[(M1+M2)!(N1+N2M1M2)!]
 SUBROUTINE DWESD  Compute the expected value and variance
of the DurbinWatson statistic
 SUBROUTINE ELLPTS  Compute N regularly spaced points on the
perimeter of an ellipse
 SUBROUTINE FACTOR  Find the prime factors of the absolute
value of N (N an integer of 10 digits or less)
 SUBROUTINE FIBMIN  Compute the minimum of a univariate
FUNCTION within an interval using Fibonacci search
algorithm
 FUNCTION IGCD  Compute the greatest common divisor of
two integers
 FUNCTION IGCDM  Compute the greatest common divisor of
the integers in a matrix
 FUNCTION IGCDV  Compute the greatest common divisor of
the integers in a vector
 SUBROUTINE LINSYS  Solve an NxN system of linear equations
(LU decomposition)
 SUBROUTINE LISYPD  Solve an NxN system of linear equations
where the matrix is symmetric and positive definite
(Cholesky factorization)
 SUBROUTINE LSQSVD  Solve linear least squares equations
using singular value factorization
 SUBROUTINE LSTSQR  Solve linear unweighted least squares
problem
 SUBROUTINE MAD  Compute median absolute deviation
 SUBROUTINE MATCNO  Compute the condition number of an NxN
matrix
 SUBROUTINE MATHDI  Compute the diagonal of the hat matrix
 SUBROUTINE MATINV  Compute the inverse of a matrix
 SUBROUTINE MATIPD  Compute the inverse of a symmetric
positive definite matrix
 SUBROUTINE MATMPI  Compute the MoorePenrose
psuedoinverse of an NxM matrix (N > M)
 SUBROUTINE MATXXI  Compute the inverse and determinant of
X'X where X is an NxM (N > M) matrix
 SUBROUTINE MEANSD  Compute the mean and standard deviation
 SUBROUTINE MEDIAN  Compute the median
 SUBROUTINE MINMAX  Compute the minimum and maximum
 SUBROUTINE NEXPER  Compute the next permutation of the
integers 1, 2, ..., N
 SUBROUTINE PERMAN  Compute the permanent of an NxN matrix
 SUBROUTINE PLOTCR  Generate a line printer plot of Y vs X
 SUBROUTINE PPFBET  Compute the inverse cumulative
distribution FUNCTION of the beta distribution
 SUBROUTINE QDASIM  Numerical integration using adaptive
Simpson's rule
 SUBROUTINE QDTANH  Numerical integration using the TANH
rule
 FUNCTION QDTRAP  Numerical integration using the
trapezoidal rule
 SUBROUTINE QSMNMX  Find the minimum and maximum values of a
quadratic surface
 FUNCTION RDBETA  Generate a beta random number
 FUNCTION RDCHI2  Generate a chisquare random number
 SUBROUTINE RDCONS  Generate uniformlyspace psuedorandom
points on the surface of a cone
 SUBROUTINE RDCONV  Generate uniformlyspace psuedorandom
points within a cone
 SUBROUTINE RDCYLS  Generate uniformlyspace psuedorandom
points on the surface of a cylinder
 SUBROUTINE RDCYLV  Generate uniformlyspace psuedorandom
points within a cylinder
 SUBROUTINE RDELLS  Generate uniformlyspaced psuedorandom
points on the surface of an ellipse
 SUBROUTINE RDELLV  Generate uniformlyspaced psuedorandom
points within an ellipse
 FUNCTION RDF  Generate a F random number
 FUNCTION RDGAMM  Generate a gamma random number
 SUBROUTINE RDHLX  Generate uniformlyspaced psuedorandom
points on a helix in threedimensional space
 SUBROUTINE RDMNOR  Generate multivariate random numbers
 FUNCTION RDNF  Generate doubly noncentral F random
numbers
 FUNCTION RDNOR  Generate a normal random number
 FUNCTION RDNOR3  Generate a normal random number (polar
method)
 SUBROUTINE RDRECS  Generate uniformlyspaced psuedorandom
points on the surface of a threedimensional rectange
 SUBROUTINE RDRECV  Generate uniformlyspaced psuedorandom
points within a threedimensional rectange
 SUBROUTINE RDSPSH  Generate uniformlyspaced psuedorandom
points in a region between the surfaces of two spheres
 FUNCTION RDT  Generate a t random number
 SUBROUTINE RDTORS  Generate uniformlyspaced psuedorandom
points on the surface of a torus
 SUBROUTINE RDTORV  Generate uniformlyspaced psuedorandom
points within a torus
 FUNCTION RDUNI  Generate a uniform random number (lagged
Fibonacci generator)
 FUNCTION RDUNLL  Generate a uniform random number
(congruential generator)
 FUNCTION RDUNWH  Generate a uniform random number
(WichmanHill generator)
 SUBROUTINE REJ1  Compute mean and standard deviaiton of
normal data that may be "contaminated"
 SUBROUTINE SKEKUR  Compute skewness and kurtosis
 SUBROUTINE SORT1  Sort a data vector
 SUBROUTINE SORT2  Sort a data vector and "carry along" a
second vector
 SUBROUTINE TRISYS  Solve a tridiagonal system of equations
 SUBROUTINE UPDATE  Compute mean and standard deviation
using an "update" algorithm
 SUBROUTINE ZEROBR  Find the zero of a univariate function
using Brent's method

Download the Fortran Source Code

You can download the Fortran source
code.
The source code is written in standard Fortran 77. It
should be portable to systems that support 32bit (or
higher) Fortran 77 compilers. These routines were originally
written for the 60bit CDC Fortran compiler, so you may need
to convert some routines to double precision to maintain
sufficient accuracy.
A few of these routines make calls to the LINPACK library.
The LINPACK routines are not included (LINPACK is freely
downloadble).

Privacy Policy/Security Notice
Disclaimer 
FOIA
NIST is an agency of the U.S.
Commerce Department.
Date created: 8/11/2004
Last updated: 10/30/2013
Please email comments on this WWW page to
sedwww@nist.gov.
