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