ASA053\
Wishart Variate Generator {#asa053-wishart-variate-generator align=”center”}
=========================
ASA053 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
STATLIB.
Licensing: {#licensing align=”center”}
The computer code and data files made available on this web page are
distributed under the GNU LGPL license.
Languages: {#languages align=”center”}
ASA053 is available in a C version
and a C++ version and a FORTRAN77
version and a FORTRAN90
version and a MATLAB
version.
WISHART, a C++ library which
produces sample matrices from the Wishart or Bartlett distributions,
useful for sampling random covariance matrices.
Reference: {#reference align=”center”}
- Stanley Sawyer,\
Wishart Distributions and Inverse-Wishart Sampling,\
Washington University,\
30 April 2007, 12 pages.
- William Smith, Ronald Hocking,\
Algorithm AS 53, Wishart Variate Generator,\
Applied Statistics,\
Volume 21, Number 3, pages 341-345, 1972.
Original Source Code: {#original-source-code align=”center”}
- asa053_original.f, the original text of the
source code. Note that the line “DF = N - I + 1” is believed (by me)
to be incorrect, and is replaced in the present version by “DF =
NP - I + 1”.
Source Code: {#source-code align=”center”}
Examples and Tests: {#examples-and-tests align=”center”}
List of Routines: {#list-of-routines align=”center”}
- R8_UNIFORM_01 returns a unit pseudorandom R8.
- R8PP_PRINT prints an R8PP matrix.
- R8PP_PRINT_SOME prints some of an R8PP matrix.
- R8UTP_PRINT prints an R8UTP matrix.
- R8UTP_PRINT_SOME prints some of an R8UTP matrix.
- RNORM returns two independent standard random normal deviates.
- TIMESTAMP prints the current YMDHMS date as a time stamp.
- WSHRT returns a random Wishart variate.
You can go up one level to the C++ source codes.
Last revised on 16 April 2014.