# findcpc: Find common principal components In tpepler/cpc: Common principal component (CPC) analysis and applications

## Description

Provides descriptive measures to decide whether there are common eigenvectors in several covariance matrices.

## Usage

 `1` ```findcpc(covmats, B = NULL, cutoff = 0.95, plotting = TRUE, main = "Vector correlations for the permutations") ```

## Arguments

 `covmats ` Array of covariance matrices of the k groups. `B ` Modal matrix p x p matrix diagonalising the k covariance matrices simultaneously, estimated under the assumption of common eigenvectors in the groups. Can be estimated using simultaneous diagonalisation algorithms such as the Flury-Gautschi (implemented in `FG` or the stepwise CPC (implemented in `stepwisecpc`) algorithms. `cutoff ` Cut-off value to use in the vector correlation scree plot. `plotting ` Logical, indicating whether a scree plot of the vector correlations should be constructed (default = TRUE). `main ` Title of the scree plot, if `plotting = TRUE`.

## Details

Identifies possibly common eigenvectors in k data groups by investigating the vectors correlations of all combinations of eigenvectors from the groups. These sets may be tested further for commonness.

## Value

Produces a scree plot of the vector correlations (if `plotting = TRUE`) and returns a list with the values:

 `all.correlations ` Summary of all eigenvector combinations from the k groups, and the geometric means of the vector correlations. `commonvec.order ` Order of the (possibly) common eigenvectors in the modal matrix (if an estimate was supplied).

Theo Pepler

## References

Pepler, P.T. (2014). The identification and application of common principal components. PhD dissertation in the Department of Statistics and Actuarial Science, Stellenbosch University.

`ensemble.test`, `flury.test`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```# 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) findcpc(covmats = S) # Estimate the modal matrix with the FG algorithm nvec <- c(nrow(versicolor), nrow(virginica)) B <- cpc::FG(covmats = S, nvec = nvec)\$B findcpc(covmats = S, B = B) ```