Choose the number of principal components via reconstruction error | R Documentation |
Choose the number of principal components via reconstruction error.
choose.pc(x, graph = TRUE)
x |
A numerical matrix with more rows than columns. |
graph |
Should the plot of the PRESS values appear? Default value is TRUE. |
The functions allows for selecting the number of eigenvectors via the reconstruction error which is computed for all eigenvectors based on SVD.
A list including:
values |
The eigenvalues of the covariance matrix. |
cumprop |
The cumulative proportion of the eigenvalues of the covariance matrix. |
per |
The differences in the cumulative proportion of the eigenvalues of the covariance matrix. |
press |
The reconstruction error |
runtime |
The runtime of the algorithm. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Jolliffe I.T. (2002). Principal Component Analysis.
pcr, alfa.pcr, alfapcr.tune
library(MASS)
x <- as.matrix(fgl[, 2:9])
a <- choose.pc(x, graph = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.