estim_ncpFAMD: Estimate the number of dimensions for the Factorial Analysis...

estim_ncpFAMDR Documentation

Estimate the number of dimensions for the Factorial Analysis of Mixed Data by cross-validation

Description

Estimate the number of dimensions for the Factorial Analysis of Mixed Data by cross-validation

Usage

estim_ncpFAMD(don, ncp.min=0, ncp.max=5,  method = c("Regularized","EM"), 
     method.cv = c("Kfold","loo"), nbsim=100, pNA=0.05, ind.sup=NULL,
	 sup.var=NULL, threshold=1e-4, verbose = TRUE, maxiter = 1000)

Arguments

don

a data.frame with categorical variables; with missing entries or not

ncp.min

integer corresponding to the minimum number of components to test

ncp.max

integer corresponding to the maximum number of components to test

method

"Regularized" by default or "EM"

method.cv

"Kfold" for cross-validation or "loo" for leave-one-out

nbsim

number of simulations, useful only if method.cv="Kfold"

pNA

percentage of missing values added in the data set, useful only if method.cv="Kfold"

ind.sup

a vector indicating the indexes of the supplementary individuals

sup.var

a vector indicating the indexes of the supplementary variables (quantitative and categorical)

threshold

the threshold for assessing convergence

verbose

boolean. TRUE means that a progressbar is writtent

maxiter

integer, maximum number of iteration for the algorithm

Details

For leave-one-out cross-validation (method.cv="loo"), each cell of the data matrix is alternatively removed and predicted with a FAMD model using ncp.min to ncp.max dimensions. The number of components which leads to the smallest mean square error of prediction (MSEP) is retained. For the Kfold cross-validation (method.cv="Kfold"), pNA percentage of missing values is inserted at random in the data matrix and predicted with a FAMD model using ncp.min to ncp.max dimensions. This process is repeated nbsim times. The number of components which leads to the smallest MSEP is retained. More precisely, for both cross-validation methods, the missing entries are predicted using the imputeFAMD function, it means using it means using the regularized iterative FAMD algorithm (method="Regularized") or the iterative FAMD algorithm (method="EM"). The regularized version is more appropriate to avoid overfitting issues.

Value

ncp

the number of components retained for the FAMD

criterion

the criterion (the MSEP) calculated for each number of components

Author(s)

Vincent Audigier vincent.audigier@cnam.fr, Francois Husson francois.husson@institut-agro.fr and Julie Josse julie.josse@polytechnique.edu

References

Audigier, V., Husson, F. & Josse, J. (2014). A principal components method to impute mixed data. Advances in Data Analysis and Classification

See Also

imputeFAMD

Examples

## Not run: 
data(ozone)
result <- estim_ncpFAMD(ozone)

## End(Not run)

missMDA documentation built on Nov. 17, 2023, 5:07 p.m.