CorrStructure: Construct a correlation matrix

Description Usage Arguments Examples

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

1
2
3
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 autocor, and either a scalar or a vector of the same length as the maximal blockind K for blockcor.

blockind

Block index 1,..., K for a positive integer K specifying which variable belongs to which block, the matrix dimension is equal to length(blockind).

Examples

1
2
3
4
5
6
7
# 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))

mixedCCA documentation built on March 21, 2021, 1:07 a.m.