Mathematica: Faster Multinormal Sampling with Different Covariance Matrices
Let's say we are given a set of different covariance matrices. We wish to draw a single sample of the multivariate normal distribution from each of these covariance matrices.
Assuming the mean vector is zero, we would code this for a single draw from a single covariance matrix sigma in Mathematica:
MultinormalDraw[sigma_] := RandomVariate[MultinormalDistribution[sigma]]
To demonstrate why this is slow, we will use a hundred randomly generated $200\times 200$ covariance matrices (that is, matrices that are both symmetric and positive definite):