choose.pc: Choose the number of principal components via reconstruction...

View source: R/choose.pc.R

Choose the number of principal components via reconstruction errorR Documentation

Choose the number of principal components via reconstruction error

Description

Choose the number of principal components via reconstruction error.

Usage

choose.pc(x, graph = TRUE)

Arguments

x

A numerical matrix with more rows than columns.

graph

Should the plot of the PRESS values appear? Default value is TRUE.

Details

The functions allows for selecting the number of eigenvectors via the reconstruction error which is computed for all eigenvectors based on SVD.

Value

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 \sqrt{\sum_{ij}{(x_{ij}-\hat{x}_{ij})^2}} for each number of eigenvectors.

runtime

The runtime of the algorithm.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Jolliffe I.T. (2002). Principal Component Analysis.

See Also

pcr, alfa.pcr, alfapcr.tune

Examples

library(MASS)
x <- as.matrix(fgl[, 2:9])
a <- choose.pc(x, graph = FALSE)

Compositional documentation built on Oct. 23, 2023, 5:09 p.m.