[R] How to generate a matrix with a specific correlation (matrix)
spencer.graves at pdf.com
Sun Jul 13 04:39:41 CEST 2003
If var(X) = diag(n) = n x n identity matrix, then var(A%*%X) = A %*%
If you can generate vector(s) X of uncorrelated observations with
whatever distribution you want, then let A = t(chol(Correl)), where
Correl = the desired correlation matrix.
If you want multivariate normal or t distributions, the package
mvtnorm downloadable from CRAN will do this for you.
If this does not solve your problem, I suggest you provide a toy
example that explains very succinctly what you want, what you've tried,
and the deficiencies in what you've tried.
hope this helps. spencer graves
> Dear R community:
> How to generate a matrix with a specific correlation (matrix)?
> Thanks in advance.
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
More information about the R-help