CorrStructure {mixedCCA} | R Documentation |
Construct a correlation matrix
Description
Functions to create autocorrelation matrix (p by p) with parameter rho and block correlation matrix (p by p) using group index (of length p) and (possibly) different parameter rho for each group.
Usage
autocor(p, rho)
blockcor(blockind, rho)
Arguments
p |
Specified matrix dimension. |
rho |
Correlation value(s), must be between -0.99 and 0.99. Should be a scalar for |
blockind |
Block index 1,..., K for a positive integer K specifying which variable belongs to which block, the matrix dimension is equal to |
Examples
# For p = 8,
# auto correlation matrix
autocor(8, 0.8)
# block correlation matrix: two blocks with the same correlation within each block
blockcor(c(rep(1,3), rep(2,5)), 0.8)
# block correlation matrix: two blocks with different correlation within each block
blockcor(c(rep(1,3), rep(2,5)), c(0.8, 0.3))
[Package mixedCCA version 1.6.2 Index]