stepwisecpc | R Documentation |
Estimates stepwise common principal components to simultaneously diagonalise several covariance matrices.
stepwisecpc(covmats, nvec)
covmats |
Array containing the covariance matrices for the groups, created with a command such as covmats <- array(NA, dim = c(p, p, k)), where p refers to the number of rows/columns of each covariance matrix, and k is the number of groups (or covariance matrices). |
nvec |
Vector containing the sample sizes of the k groups. |
Returns a list with the values:
B |
Orthogonal matrix containing the estimated common eigenvectors in the columns. |
eigenvals |
Matrix of which the columns contain the estimated eigenvalues of the k covariance matrices under the CPC model. |
Sarel Steel, Theo Pepler
Trendafilov, N. T. (2010). Stepwise estimation of common principal components. Computational Statistics and Data Analysis, 54(12): 3446-3457.
FG
# Estimate the modal matrix for the versicolor and virginica groups # under the common eigenvector assumption. data(iris) versicolor <- iris[51:100, 1:4] virginica <- iris[101:150, 1:4] # Create array containing the covariance matrices S <- array(NA, dim = c(4, 4, 2)) S[, , 1] <- cov(versicolor) S[, , 2] <- cov(virginica) stepwisecpc(covmats = S, nvec = c(nrow(versicolor), nrow(virginica)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.