get_covmat | R Documentation |
Given the variances and desired correlations, generate a covariance matrix
get_covmat(cormat, var)
cormat |
A symmetric matrix with desired correlations. |
var |
A numeric vector with variances. It must have length equal to the
number of elements in the diagonal of |
A (co)variance matrix
Tiago Olivoto tiagoolivoto@gmail.com
cormat <- matrix(c(1, 0.9, -0.4, 0.9, 1, 0.6, -0.4, 0.6, 1), nrow = 3, ncol = 3) get_covmat(cormat, var = c(16, 25, 9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.