##### R-code for generating data used in Exercise 9.9 #### Generate 10 5-D random vectors from t_5(mu,Sigma) library(mvtnorm) # The R library in which the commands for generating # multivariate t or normal random vectors is contained. set.seed(10) mu1 = c(0,0,0,0,0) # IC mean vector mu2 = c(1,1,1,1,1) # OC mean vector Sigma = matrix(c(1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,1),5,5) # IC covariance matrix x = rbind(rmvt(n=6,sigma=Sigma,df=5),rmvt(n=4,sigma=Sigma,df=5)) x = x+rbind(matrix(rep(mu1,6),6,5,byrow=T),matrix(rep(mu2,4),4,5,byrow=T)) write.table(round(x,digits=3),"ex99.dat",row.names=F,col.names=F)