draw.wishart: Pseudo-Random Number Generation under Wishart Distribution

Description Usage Arguments Value See Also Examples

View source: R/draw.wishart.R

Description

This function implements pseudo-random number generation for a Wishart distribution with pdf

f(x|ν,Σ)=(2^{ν d/2}π^{d(d-1)/4}∏_{i=1}^{d}Γ((ν+1-i)/2))^{-1}|Σ|^{-ν/2}|x|^{(ν-d-1)/2}\exp(-\frac{1}{2}tr(Σ^{-1}x))

x is positive definite, ν ≥q d, and Σ is symmetric and positive definite, where ν and Σ are positive definite and the scale matrix, respectively.

Usage

1
draw.wishart(no.row,d,nu,sigma)

Arguments

no.row

Number of rows to generate.

d

Number of variables to generate.

nu

Degrees of freedom.

sigma

Scale matrix.

Value

A no.row \times d^2 matrix of Wishart deviates in the form of rows.To obtain the Wishart matrix, convert each row to a matrix where rows are filled first.

See Also

draw.d.variate.normal

Examples

1
2
mymat<-matrix(c(1,0.2,0.3,0.2,1,0.2,0.3,0.2,1), nrow=3, ncol=3)
draw.wishart(no.row=1e5,d=3,nu=5,sigma=mymat)

MultiRNG documentation built on March 6, 2021, 1:06 a.m.