B.partial: Eigenvector matrices under partial CPC model

View source: R/B.partial.R

B.partialR Documentation

Eigenvector matrices under partial CPC model

Description

Estimates the eigenvector matrices under the partial CPC model, to diagonalise several covariance matrices.

Usage

B.partial(covmats, nvec, B = cpc::FG(covmats = covmats, nvec = nvec)$B, commonvec.order, q)

Arguments

covmats

Array of sample covariance matrices for the k groups.

nvec

Vector of sample sizes of the k groups.

B

Matrix of common eigenvectors estimated under the assumption of full CPC. Defaults to the modal matrix obtained with the FG algorithm.

commonvec.order

Vector containing the order of the common eigenvectors in B (with the q truly common eigenvectors in the first q positions).

q

Number of eigenvectors common to all k groups.

Details

Estimates the matrices of common (and non-common) eigenvectors for each of the groups, according to the method described in Flury (1988).

Value

Returns an array containing the eigenvector matrices for the k groups, estimated under the CPC(q) model.

Author(s)

Theo Pepler

References

Flury, B. (1988). Common Principal Components and Related Multivariate Models. Wiley.

See Also

FG, stepwisecpc

Examples

# Versicolor and virginica groups of the Iris data
data(iris)
versicolor <- iris[51:100, 1:4]
virginica <- iris[101:150, 1:4]

# Create array containing the two covariance matrices
S <- array(NA, c(4, 4, 2))
S[, , 1] <- cov(versicolor)
S[, , 2] <- cov(virginica)
nvec <- c(nrow(versicolor), nrow(virginica))

# Estimate the eigenvector matrices under the CPC(1) model
B.partial(covmats = S, nvec = nvec, q = 1)

tpepler/cpc documentation built on July 7, 2022, 2:13 a.m.