# What is a memory-efficient algorithm for sampling from a high-dimensional multivariate normal?

Is there some sort of memory-efficient approximate solution? What if all of the off-diagonal elements of the covariance matrix are equal to $\alpha$ and all of the diagonal elements are equal to $\sigma^2$? An implementation in R would be terrific.

For additional context, the MVN has a dimension around 70000 and has a dense covariance matrix. I've tried using the standard multivariate normal packages in R but even on a machine with a lot of memory can't realistically sample from MVNs with more than a few thousand elements. I'm running simulations to test for coverage and power of parameter estimates in settings where there's high covariance between observations, and it would be helpful if I could exactly specify the covariance matrix I want to use.

• It's quite straightforward. Is this an exercise for some class? – Glen_b Oct 30 '17 at 8:14
• Note that this covariance structure is that of a random-intercept model, so you can simply simulate data from a random intercept model that has the corresponding covariances and variances. – Glen_b Oct 30 '17 at 9:30
• Thanks for the response Glen_b. I've tried to find a reference for simulating data from random intercept models but can't find a solution that doesn't run into the same problem. I'm adding more context to the original question. – user3072995 Nov 5 '17 at 19:38