# NOT RUN {
scale <- crossprod(matrix(rnorm(15),5,3)) # the prior scale
m <- matrix(0,3,3)
## get 1000 samples and calculate the sample mean
for(i in 1:1000){
m <- m+rInvWishart(df=5,scale=scale)/1000
}
## m should roughly equal scale/(df-p-1), p is the dimension.
m
scale/(5-3-1)
# }
Run the code above in your browser using DataLab