powered by
Build a correlation matrix with a given structure
make_corr( d, type = c("exchangeable", "ar1", "toeplitz", "random", "identity"), rho = 0.5, names = NULL )
A d x d correlation matrix.
d x d
Dimension.
Structure: "exchangeable" (all off-diagonal entries rho), "ar1" (rho^|i-j|), "toeplitz" (first row given by rho, a vector of length d - 1), "random" (a random positive-definite correlation matrix) or "identity".
"exchangeable"
rho
"ar1"
rho^|i-j|
"toeplitz"
d - 1
"random"
"identity"
Correlation parameter (see type).
type
Optional variable names.
make_corr(4, "ar1", rho = 0.7) make_corr(3, "toeplitz", rho = c(0.5, 0.2))
Run the code above in your browser using DataLab