powered by
Choose the number of principal components via reconstruction error.
choose.pc(x, graph = TRUE)
A numerical matrix with more rows than columns.
Should the plot of the PRESS values appear? Default value is TRUE.
A list including:
The eigenvalues of the covariance matrix.
The cumulative proportion of the eigenvalues of the covariance matrix.
The differences in the cumulative proportion of the eigenvalues of the covariance matrix.
The reconstruction error \(\sqrt{\sum_{ij}{(x_{ij}-\hat{x}_{ij})^2}}\) for each number of eigenvectors.
The runtime of the algorithm.
The functions allows for selecting the number of eigenvectors via the reconstruction error which is computed for all eigenvectors based on SVD.
Jolliffe I.T. (2002). Principal Component Analysis.
pcr, alfa.pcr, alfapcr.tune
# NOT RUN { library(MASS) x <- as.matrix(fgl[, 2:9]) a <- choose.pc(x, graph = FALSE) # }
Run the code above in your browser using DataLab