| conv_Sigma | R Documentation |
Uses Cholesky factorization to generate a covariance matrix (or any symmetric positive definite matrix).
conv_Sigma(sigma, lower_diag)
sigma |
Numeric vector of marginal standard deviations (all greater than zeros) |
lower_diag |
Numeric vector to populate the lower triangle of the correlation matrix. All real numbers.
Length |
Numeric
set.seed(23)
n <- 5
sigma <- runif(n, 0, 2)
lower_diag <- runif(sum(1:(n-1)), -10, 10)
Sigma <- conv_Sigma(sigma, lower_diag)
Sigma/t(Sigma) # Is symmetric matrix? All ones
cov2cor(Sigma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.