### sample from the multivariate normal distribution rmvnorm<-function(n,mu,Sigma) { p<-length(mu) res<-matrix(0,nrow=n,ncol=p) if( n>0 & p>0 ) { E<-matrix(rnorm(n*p),n,p) res<-t( t(E%*%chol(Sigma)) +c(mu)) } res } ### ### sample from the Wishart distribution rwish<-function(n,nu0,S0) { sS0 <- chol(S0) S<-array( dim=c( dim(S0),n ) ) for(i in 1:n) { Z <- matrix(rnorm(nu0 * dim(S0)[1]), nu0, dim(S0)[1]) %*% sS0 S[,,i]<- t(Z)%*%Z } S[,,1:n] } ### ### diabetes data Y.reading<-dget("Y.reading") Y.pima.miss<-dget("Y.pima.miss") Y.pima.full<-dget("Y.pima.full")