Learn R Programming

MatrixCorrelation (version 0.10.0)

PCAimpute: Principal Component Analysis based imputation

Description

Imputation of missing data, NA, using Principal Component Analysis with iterative refitting and mean value updates. The chosen number of components and convergence parameters (iterations and tolerance) influence the precision of the imputation.

Usage

PCAimpute(X, ncomp, center = TRUE, max_iter = 20, tol = 10^-5)

Arguments

X

matrix object to perform PCA on.

ncomp

integer number of components.

center

logical indicating if centering (default) should be performed.

max_iter

integer number of iterations of PCA if sum of squared change in imputed values is above tol.

tol

numeric tolerance for sum of squared cange in imputed values.

Value

Final singular value decomposition, imputed X matrix and convergence metrics (sequence of sum of squared change and number of iterations).

Examples

Run this code
# NOT RUN {
X <- matrix(rnorm(12),3,4)
X[c(2,6,10)] <- NA
PCAimpute(X, 3)
# }

Run the code above in your browser using DataLab