Generate a draw from a Wishart distribution.
degrees of freedom. It has to be integer.
dimension of the matrix to simulate.
the matrix parameter Sigma of the Wishart distribution.
a square root of the matrix parameter Sigma of the
Wishart distribution. Sigma must be equal to
The Wishart is a distribution on the set of nonnegative definite symmetric matrices. Its density is
p(W) = c|W|^((n-p-1)/2) / |Sigma|^(n/2) exp(-tr(Sigma^(-1)W)/2)
where n is the degrees of freedom parameter
c is a normalizing constant.
The mean of the Wishart distribution is n Sigma and the
variance of an entry is
Var(W[i,j]) = n (Sigma[i,j]^2 + Sigma[i,i] Sigma[j,j])
The matrix parameter, which should be a positive definite symmetric matrix, can be specified via either the argument Sigma or SqrtSigma. If Sigma is specified, then SqrtSigma is ignored. No checks are made for symmetry and positive definiteness of Sigma.
The function returns one draw from the Wishart distribution with
df degrees of freedom and matrix parameter
The function only works for an integer number of degrees of freedom.
From a suggestion by B.Venables, posted on S-news
Giovanni Petris GPetris@uark.edu
Press (1982). Applied multivariate analysis.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.