Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

estim_ncp

Estimate the number of components in Principal Component Analysis


Description

Estimate the number of components in PCA .

Usage

estim_ncp(X, ncp.min=0, ncp.max=NULL, scale=TRUE, method="GCV")

Arguments

X

a data frame with continuous variables

ncp.min

minimum number of dimensions to interpret, by default 0

ncp.max

maximum number of dimensions to interpret, by default NULL which corresponds to the number of columns minus 2

scale

a boolean, if TRUE (value set by default) then data are scaled to unit variance

method

method used to estimate the number of components, "GCV" for the generalized cross-validation approximation or "Smooth" for the smoothing method (by default "GCV")

Value

Returns ncp the best number of dimensions to use (find the minimum or the first local minimum) and the mean error for each dimension tested

Author(s)

References

Josse, J. and Husson, F. (2012). Selecting the number of components in PCA using cross-validation approximations. Computational Statistics and Data Analysis, 56, 1869-1879.

See Also

Examples

data(decathlon)
nb.dim <- estim_ncp(decathlon[,1:10],scale=TRUE)

FactoMineR

Multivariate Exploratory Data Analysis and Data Mining

v2.4
GPL (>= 2)
Authors
Francois Husson, Julie Josse, Sebastien Le, Jeremy Mazet
Initial release
2020-12-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.