InvWishart {MCMCpack} | R Documentation |
Density function and random generation from the Inverse Wishart distribution.
diwish(W, v, S) riwish(v, S)
W |
Positive definite matrix W (p x p). |
v |
Degrees of freedom (scalar). |
S |
Scale matrix (p x p). |
The mean of an inverse Wishart random variable with v
degrees
of freedom and scale matrix S
is 1/(v-p-1)
S.
diwish
evaluates the density at positive definite matrix W.
riwish
generates one random draw from the distribution.
density <- diwish(matrix(c(2,-.3,-.3,4),2,2), 3, matrix(c(1,.3,.3,1),2,2)) draw <- riwish(3, matrix(c(1,.3,.3,1),2,2))