impute {onlinePCA} | R Documentation |
BLUP Imputation of Missing Values
Description
Missing values of a vector are imputed by best linear unbiased prediction (BLUP) assuming a multivariate normal distribution.
Usage
impute(lambda, U, x, center, tol = 1e-07)
Arguments
lambda |
vector of eigenvalues of length |
U |
matrix of eigenvectors (principal components) of dimension |
x |
vector of observations of length |
center |
centering vector for |
tol |
tolerance in the calculation of the pseudoinverse. |
Details
The vector x
is assumed to arise from a multivariate normal distribution with mean vector center
and covariance matrix U diag(lambda) U^T
.
Value
The imputed vector x
.
References
Brand, M. (2002). Incremental singular value decomposition of uncertain data with missing values. European Conference on Computer Vision (ECCV).
Examples
set.seed(10)
lambda <- c(1,2,5)
U <- qr.Q(qr(matrix(rnorm(30),10,3)))
x <- U %*% diag(sqrt(lambda)) %*% rnorm(3) + rnorm(10, sd =.05)
x.na <- x
x.na[c(1,3,7)] <- NA
x.imputed <- impute(lambda,U,x.na)
cbind(x,x.imputed)
[Package onlinePCA version 1.3.2 Index]