Wishart Variate Generator
is a C library which
returns samples from the Wishart distribution.
As far as I can tell, there are two mistakes in the printed text
of the algorithm; one involves incorrectly determining the number
of degrees of freedom for the ChiSquared distribution; the
other omits an absolute value sign when inverting the Wilson-Hilferty
formula, so that square roots of negative values are occasionally
requested. These mistakes have been corrected here.
Source code for many Applied Statistics Algorithms is available through
The computer code and data files made available on this
web page are distributed under
the GNU LGPL license.
ASA053 is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
a C library which
produces sample matrices from the Wishart or Bartlett distributions,
useful for sampling random covariance matrices.
Wishart Distributions and Inverse-Wishart Sampling,
30 April 2007, 12 pages.
William Smith, Ronald Hocking,
Algorithm AS 53, Wishart Variate Generator,
Volume 21, Number 3, pages 341-345, 1972.
asa053.h, the include file.
returns the maximum of two I4s.
returns the minimum of two I4's.
returns a unit pseudorandom R8.
prints an R8MAT.
prints some of an R8MAT.
prints an R8PP matrix.
prints some of an R8PP matrix.
prints an R8UTP matrix.
prints some of an R8UTP matrix.
returns two independent standard random normal deviates.
prints the current YMDHMS date as a time stamp.
returns a random Wishart variate.
Last revised on 28 October 2018.