rwishart {dlm}R Documentation

Random Whishart matrix

Description

Generate a draw from a Wishart distribution.

Usage

rwishart(df, p = nrow(SqrtSigma), SqrtSigma = diag(p))

Arguments

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).

Value

The function returns one draw from the Wishart distribution with df degrees of freedom and matrix parameter crossprod(SqrtSigma)

Warning

The function only works for an integer number of degrees of freedom.

Note

From a suggestion of B.Venables, posted on S-news

Author(s)

Giovanni Petris GPetris@uark.edu

References

Mardia, Kent and Bibby (1979). Multivariate analysis.

Examples

rwishart(25, p = 2)

[Package dlm version 0.8-1 Index]