B.partial | R Documentation |
Estimates the eigenvector matrices under the partial CPC model, to diagonalise several covariance matrices.
B.partial(covmats, nvec, B = cpc::FG(covmats = covmats, nvec = nvec)$B, commonvec.order, q)
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. |
Estimates the matrices of common (and non-common) eigenvectors for each of the groups, according to the method described in Flury (1988).
Returns an array containing the eigenvector matrices for the k groups, estimated under the CPC(q) model.
Theo Pepler
Flury, B. (1988). Common Principal Components and Related Multivariate Models. Wiley.
FG
, stepwisecpc
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.