Learn R Programming

MCMCglmm (version 1.06)

rIW: Random Generation from the Conditional Inverse Wishart Distribution

Description

Samples from the inverse Wishart distribution, with the possibility of conditioning on a diagonal submatrix

Usage

rIW(nu,V,split=NULL, n=1)

Arguments

nu
degrees of freedom
V
inverse scale matrix
split
optional integer indexing the partition to be conditioned on
n
integer: number of samples to be drawn

Value

  • if n = 1 a matrix equal in dimension to V, if n>1 a matrix of dimension n x length(V)

Details

split indexes the diagonal element of V which partitions V into 4 submatrices. split indexes the upper left corner of the lower diagonal matrix and it is this matrix that is conditioned on. For example partioning V such that $${\bf V} = \left[ \begin{array}{cc} {\bf V}_{11}&{\bf V}_{12}\ {\bf V}_{21}&{\bf V}_{12}\ \end{array} \right]$$ $$$$ the split indexes the upper left corner of ${\bf V}_{22}$. If dim(V)=4 and split=2 then ${\bf V}_{11}$ is a 1X1 matrix and V22 is a 3X3 matrix.

References

Korsgaard IR et. al. 1999 Genetics Selection Evolution 31 (2) 177:181

See Also

rwishart

Examples

Run this code
n<-10
V<-diag(4)
rIW(n, solve(n*V), split=2)

Run the code above in your browser using DataLab