Skip to contents

Determines whether a square matrix exhibits compound symmetry (CS), i.e., whether all diagonal entries are equal and all off-diagonal entries are equal.

Usage

is.CS(U)

Arguments

U

A numeric square matrix.

Value

Logical. TRUE if U has compound symmetry structure, and FALSE otherwise.

See also

Other Utilities: ARI(), preserve.cl(), setup.model()

Examples

# Compound symmetry matrix
U1 <- matrix(0.3, nrow = 4, ncol = 4)
diag(U1) <- 1
is.CS(U1)
#> [1] TRUE

# Toeplitz matrix, not CS
U2 <- toeplitz(c(1, 0.5, 0.2, 0.1))
is.CS(U2)
#> [1] FALSE