rwishart: Random deviates from a Wishart distribution

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Draws random deviates from a Wishart pdf.

Usage

1
rwishart(N, df, Sigma)

Arguments

N

Number of random deviates to draw.

df

Degrees of freedom for Wishart distribution

Sigma

Mean of the Wishart from which to draw the deviates

Details

Draws N matrices of draws from a Wishart with mean Sigma. This is used to draw error covariances for the VAR and BVAR models which are distributed inverse Wisharts deviates.

Value

Returns an N dimensional array of dim(Sigma) square matrices for the Wishart random deviates. If N=1, it returns a single matrix.

Author(s)

Patrick T. Brandt

See Also

See also as rmultnorm for multivariate normal deviates, rgamma for the univariate analog to drawing Wishart deviates, and ldwishart for computing the log density for a Wishart variate.

Examples

1
2
3
x <- matrix(rnorm(100), 50, 2)
XX <- crossprod(x)
tmp <- rwishart(1, 50, XX)

MSBVAR documentation built on May 30, 2017, 1:23 a.m.

Related to rwishart in MSBVAR...