rwishart {dlm} | R Documentation |
Generate a draw from a Wishart distribution.
rwishart(df, p = nrow(SqrtSigma), SqrtSigma = diag(p))
df |
degrees of freedom. It has to be integer. |
p |
dimension of the matrix to simulate. |
SqrtSigma |
a square root of the matrix parameter Sigma of the
Wishart distribution. Sigma must be equal to crossprod(SqrtSigma) . |
The function returns one draw from the Wishart distribution with
df
degrees of freedom and matrix parameter
crossprod(SqrtSigma)
The function only works for an integer number of degrees of freedom.
From a suggestion of B.Venables, posted on S-news
Giovanni Petris GPetris@uark.edu
Mardia, Kent and Bibby (1979). Multivariate analysis.
rwishart(25, p = 2)