public class Wishart
extends java.lang.Object
Constructor and Description |
---|
Wishart() |
Modifier and Type | Method and Description |
---|---|
static double[][] |
random(double n,
double[][] L,
RandomEngine rand)
Sample Wishart distribution with n degree of freedom and LL' scale parameter.
|
public static final double[][] random(double n, double[][] L, RandomEngine rand)
Sample Wishart distribution with n degree of freedom and LL' scale parameter. Wishart distribution is multivariate generalization of Gamma distribution. Remember that Gamma distribution is a generalization of both Chi-square and exponential distribution.
I use L instead of the usual V to denote the scale parameter. Note that V = LL'. Compute L using Cholesky decomposition. L is a lower triangular matrix.
The algorithm described here is due to:
Smith, W. B. and Hocking, R. R.; Algorithm AS 53: Wishart Variate Generator, Applied Statistician, v.21(341--345), 1972
http://www.jstor.org/stable/2346290
See also: Gentle, J. E., Random Number Generation and Monte Carlo Methods, 2nd ed., Springer-Verlag, 2003, pp. 199
Note: If you want to generate an inverse-wishart distribution, simply generate a matrix from Wishart distribution and invert it.
n
- degree of freedomL
- square matrix of d x d, lower triangular Cholesky factor of sigma matrixrand
- Randomizer