impute: BLUP Imputation of Missing Values

View source: R/impute.R

imputeR 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 q.

U

matrix of eigenvectors (principal components) of dimension p * q.

x

vector of observations of length p with missing entries.

center

centering vector for x. Default is zero.

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)

onlinePCA documentation built on Nov. 15, 2023, 9:07 a.m.