[R] generate random numbers from a multivariate distribution with specified correlation matrix
bbolker at gmail.com
Tue Aug 24 04:43:53 CEST 2010
rusers.sh <rusers.sh <at> gmail.com> writes:
> rmvnorm()can be used to generate the random numbers from a multivariate
> normal distribution with specified means and covariance matrix, but i want
> to specify the correlation matrix instead of covariance matrix for the
> normal distribution.
> Does anybody know how to generate the random numbers from a multivariate
> normal distribution with specified correlation matrix? What about
> other non-normal
What do you want the variances to be? If you don't mind that they're
all equal to 1, then using your correlation matrix as the Sigma argument
to the mvrnorm() [sic] function in MASS should work fine. They have to
be defined as *something* ....
If you want multivariate distributions with non-normal marginal
distributions, consider the 'copula' package, but be prepared to do
some reading -- this is a fairly big/deep topic.
More information about the R-help