Description Usage Arguments Value See Also Examples
View source: R/draw.inv.wishart.R
This function implements pseudo-random number generation for an inverted 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(Σ x^{-1}))
x is positive definite, ν ≥q d, and Σ^{-1} is symmetric and positive definite, where ν and Σ^{-1} are the degrees of freedom and the inverse scale matrix, respectively.
1 | draw.inv.wishart(no.row,d,nu,inv.sigma)
|
no.row |
Number of rows to generate. |
d |
Number of variables to generate. |
nu |
Degrees of freedom. |
inv.sigma |
Inverse scale matrix. |
A no.row \times d^2 matrix ofcontaining Wishart deviates in the form of rows. To obtain the Inverted-Wishart matrix, convert each row to a matrix where rows are filled first.
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.inv.wishart(no.row=1e5,d=3,nu=5,inv.sigma=mymat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.