MCMCpack (version 1.4-9)

InvWishart: The Inverse Wishart Distribution

Description

Density function and random generation from the Inverse Wishart distribution.

Usage

riwish(v, S)

diwish(W, v, S)

Arguments

v

Degrees of freedom (scalar).

S

Scale matrix \((p \times p)\).

W

Positive definite matrix W \((p \times p)\).

Value

diwish evaluates the density at positive definite matrix W. riwish generates one random draw from the distribution.

Details

The mean of an inverse Wishart random variable with v degrees of freedom and scale matrix S is \((v-p-1)^{-1}S\).

Examples

Run this code
# NOT RUN {
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))

# }

Run the code above in your browser using DataCamp Workspace