[R] Simulating from a Multivariate Normal Distribution Using a Correlation Matrix

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jun 25 10:13:00 CEST 2004

Short answer: to know a MVN distribution you need to know the mean vector 
and the covariance matrix.  If you don't know a distribution you cannot 
simulate from it.

So you need to know the marginal variances (the diagonal of the covariance 
matrix).  If you have those, you can form the covariance matrix and use 
rmvnorm or mvrnorm.  If you are willing to assume they are one, you have 
the covariance (= correlation matrix).  If you don't know the marginal 
variances the problem is incompletely specified.

On Fri, 25 Jun 2004, Matthew David Sylvester wrote:

> Hello,
> I would like to simulate randomly from a multivariate normal distribution using a correlation 
> matrix, rho.  I do not have sigma.  I have searched the help archive and the R documentation as 
> well as doing a standard google search.  What I have seen is that one can either use rmvnorm in 
> the package: mvtnorm or mvrnorm in the package: MASS.  I believe I read somewhere that the latter 
> was more robust.  I have seen conflicting (or at least seemingly conflicting to me, a relative 
> statistics novice), views on whether one can use the correlation matrix with these commands 
> instead of the covariance matrix.  I thought that if the commands standardized the covariance 
> matrix, then it would not matter, but I end up with larger values when I test the covariance 
> matrix versus when I test rho.  So, my question is, if one does not know sigma, can they use rho? 
>  And, if so, which command (or is there another) is better to use?  I gather that both use eigen 
> decomposition?  Thank you so much  in advance for your help.
> Best,
> Matt
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list