eimpute: Efficiently impute missing values for a large scale matrix

View source: R/eimpute.R

eimputeR Documentation

Efficiently impute missing values for a large scale matrix

Description

Fit a low-rank matrix approximation to a matrix with missing values. The algorithm iterates like EM: filling the missing values with the current guess, and then approximating the complete matrix via truncated SVD.

Usage

eimpute(
  x,
  r,
  svd.method = c("tsvd", "rsvd"),
  noise.var = 0,
  thresh = 1e-05,
  maxit = 100,
  init = FALSE,
  init.mat = 0,
  override = FALSE,
  control = list(...),
  ...
)

Arguments

x

an m by n matrix with NAs.

r

the rank of low-rank matrix for approximating x

svd.method

a character string indicating the truncated SVD method. If svd.method = "rsvd", a randomized SVD is used, else if svd.method = "tsvd", standard truncated SVD is used. Any unambiguous substring can be given. Default svd.method = "tsvd".

noise.var

the variance of noise.

thresh

convergence threshold, measured as the relative change in the Frobenius norm between two successive estimates.

maxit

maximal number of iterations.

init

if init = FALSE(the default), the missing entries will initialize with mean.

init.mat

the initialization matrix.

override

logical value indicating whether the observed elements in x should be overwritten by its low-rank approximation.

control

a list of parameters that control details of standard procedure, See biscale.control.

...

arguments to be used to form the default control argument if it is not supplied directly.

Value

A list containing the following components

x.imp

the matrix after completion.

rmse

the relative mean square error of matrix completion, i.e., training error.

iter.count

the number of iterations.

References

Rahul Mazumder, Trevor Hastie and Rob Tibshirani (2010) Spectral Regularization Algorithms for Learning Large Incomplete Matrices, Journal of Machine Learning Research 11, 2287-2322

Nathan Halko, Per-Gunnar Martinsson, Joel A. Tropp (2011) Finding Structure with Randomness: Probabilistic Algorithms for Constructing Approximate Matrix Decompositions, Siam Review Vol. 53, num. 2, pp. 217-288

Examples

################# Quick Start #################
m <- 100
n <- 100
r <- 10
x_na <- incomplete.generator(m, n, r)
head(x_na[, 1:6])
x_impute <- eimpute(x_na, r)
head(x_impute[["x.imp"]][, 1:6])
x_impute[["rmse"]]

eimpute documentation built on Oct. 22, 2022, 9:05 a.m.