Learn R Programming

monomvn (version 1.2)

rwish: Draw from the Wishart Distribution

Description

Random generation from the Wishart distribution.

Usage

rwish(v, S)

Arguments

v
Degrees of freedom (scalar).
S
Inverse scale matrix $(p \times p)$.

Value

  • returns generates one random draw from the distribution which is a matrix with the same dimensions as S

Details

The mean of a Wishart random variable with v degrees of freedom and inverse scale matrix S is $vS$.

References

This was copied from MCMCpack.

Examples

Run this code
draw <- rwish(3, matrix(c(1,.3,.3,1),2,2))

Run the code above in your browser using DataLab