powered by
This function draws from a Wishart or Inverse-Wishart distribution.
rwishart(df, scale, inv = FALSE)
A matrix, the random draw.
matrix
An integer, the degrees of freedom. Must be greater or equal p.
integer
p
A matrix, the scale matrix of dimension p x p. Must be a covariance matrix.
A logical, if TRUE the density of the Inverse-Wishart distribution is returned. By default, inv = FALSE.
logical
TRUE
inv = FALSE
df <- 4 scale <- diag(2) rwishart(df = df, scale = scale) rwishart(df = df, scale = scale, inv = TRUE)
Run the code above in your browser using DataLab