I have the following code in `R`

```
library(mvtnorm)

m = matrix(rnorm(2000000),nrow=200)
A = matrix(rnorm(40000),ncol=200)
A = A%*%t(A)
C = array(A,c(200,200,10000))

B = 10000
S = 100

postpred = array(NA,c(200,S,B))
for(i in 1:B){
    postpred[,,i] = t(rmvnorm(S,m[,i],C[,,i],method="svd"))
}

```

but this code is extremely slow because I have to loop 10,000 times while also simulating from the multivariate normal 100 times and `m` and `C` can be very large as well. So what I would like to do is be able to calculate `postpred` outside of a loop. I have tried using the apply function but to no avail. Any help or suggestions greatly appreciated.