powered by
Generate a covariance matrix using a correlation matrix and vector of standard deviations
cor2cov(C, S)
A covariance matrix
A correlation matrix.
A vector of standard deviations.
C <- matrix(c(1,-0.3,0.7,-0.3,1,-0.2,0.7,-0.2,1), 3, 3) S <- c(0.5, 2, 1.25) cor2cov(C,S)
Run the code above in your browser using DataLab