Samples from the inverse Wishart distribution, with the possibility of conditioning on a diagonal submatrix
rIW(V, nu, fix=NULL, n=1, CM=NULL)
if n
= 1 a matrix equal in dimension to V
, if n
>1 a
matrix of dimension n
x length(V)
Expected (co)varaince matrix as nu
tends to infinity
degrees of freedom
optional integer indexing the partition to be conditioned on
integer: number of samples to be drawn
matrix: optional matrix to condition on. If not given, and fix!=NULL
, V_22 is conditioned on
Jarrod Hadfield j.hadfield@ed.ac.uk
If fix
indexes the diagonal element of fix
indexes the upper left corner of the lower
diagonal matrix and it is this matrix that is conditioned on.
For example partioning
fix indexes the upper left corner of CM!=NULL
then CM
, otherwise dim(V)
=4 and fix=2
then
Korsgaard, I.R. et. al. 1999 Genetics Selection Evolution 31 (2) 177:181
rwishart
, rwish
nu<-10
V<-diag(4)
rIW(V, nu, fix=2)
Run the code above in your browser using DataLab