# Estimate values from a multivariatie normal distribution [duplicate]

I have a multivariate normal distribution with parameters mean = 0 and a variance-covariance matrix K which is n-by-n. I'd like to generate a vector of values (length n) that represent the expected values of this MVN. Any advice on how to do this?

• You write that the mean = 0. Therefore, the length n vector of zeros is the expected value of the MVN. Am I missing something? Is it perhaps the case that rather than generating the "expected values", you wish to generate random samples from the MVN distribution? Dec 8, 2015 at 19:28
• Yes, I do mean random samples generated from the MVN distribution. In particular, I want n individuals, corresponding to each row/column in the K matrix. So if I have a matrix (1,.99,0,0; .99,1,0,0; 0,0,1,0; 0,0,0,1) I would want 4 individuals where individuals 1 and 2 are very closely tied to each other and independent from 3 and 4. Dec 8, 2015 at 19:45
• R, MATLAB Statistics toolbox, and many statistics packages have built-in functions to generate random vectors from an MVN given its mean and covariance matrix. Alternatively, you can implement an approach specified in the "Drawing values from the distribution" section of en.wikipedia.org/wiki/Multivariate_normal_distribution . There are also many threads on this subject at the Cross Validated site. Dec 8, 2015 at 19:57
• Thank you very much, that clears up a lot of confusion I was having! My final question would be how to get residuals from a model that includes a MVN random effect; it seems improper to just use the expectation and I've found it rather difficult to find good advice about this. Dec 8, 2015 at 20:51
• I'm not sure what your final question is. Perhaps you should start a new thread and provide a more detailed account of your question. Dec 8, 2015 at 20:57