Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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).

Details

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

Value

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

Examples

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))

MCMCpack

Markov Chain Monte Carlo (MCMC) Package

v1.5-0
GPL-3
Authors
Andrew D. Martin [aut], Kevin M. Quinn [aut], Jong Hee Park [aut,cre], Ghislain Vieilledent [ctb], Michael Malecki[ctb], Matthew Blackwell [ctb], Keith Poole [ctb], Craig Reed [ctb], Ben Goodrich [ctb], Ross Ihaka [cph], The R Development Core Team [cph], The R Foundation [cph], Pierre L'Ecuyer [cph], Makoto Matsumoto [cph], Takuji Nishimura [cph]
Initial release
2021-01-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.