Class Wishart
- java.lang.Object
-
- jdistlib.Wishart
-
public class Wishart extends java.lang.ObjectWishart distribution By: Roby Joehanes
-
-
Constructor Summary
Constructors Constructor and Description Wishart()
-
Method Summary
All Methods Static Methods Concrete Methods 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.
-
-
-
Method Detail
-
random
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/2346290See 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.
- Parameters:
n- degree of freedomL- square matrix of d x d, lower triangular Cholesky factor of sigma matrixrand- Randomizer- Returns:
- square matrix of d x d
-
-
DMelt 3.0 © DataMelt by jWork.ORG