InvWishart: The Inverse Wishart Distribution

InvWishartR Documentation

The Inverse Wishart Distribution

Description

Random generation for the inverse Wishart distribution. The parameterization is consistent with Gelman et al. (2013) (see References)

Usage

rinvwish(n, df, v)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

df

degrees of freedom (non-negative, but can be non-integer).

v

An N \times N covariance matrix.

Value

The dimensionality of the result is determined by n for rinvwish. The result will be an array of size (nrow(v), nrow(v), n).

References

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis, 3rd edition. CRC press.

See Also

rWishart

Examples

Sigma = crossprod(matrix(rnorm(16), nrow = 4))
y = rinvwish(3, 4, Sigma)

jfrench/bayesutils documentation built on April 10, 2023, 6:28 p.m.