riWshart: Generate random numbers from an inverse Wishart distribution

Description Usage Arguments Value See Also Examples

View source: R/wishart.R

Description

This function generates random matrix from an inverse Wishart distribution.

Usage

1
riWshart(n, df, Sigma)

Arguments

n

Sample size.

df

Degrees of freedom.

Sigma

The scale matrix.

Value

The mean and variance.

See Also

rWishart for random matrix from a Wishart distribution.

Examples

1
2
3
4
5
6
7
n <- 1000
df <- 10
Sigma <- array(c(2,0.5,0.5,1), dim=c(2,2))
dset1 <- rWishart(n, df, Sigma)

apply(dset1, 1:2, mean)  ## mean
apply(dset1, 1:2, var)   ## variance

johnnyzhz/wishartprior documentation built on Jan. 9, 2021, 12:37 a.m.