Estimate a preferable matrix rank magnitude for fitting a low-rank matrix approximation to a matrix with missing values. The algorithm use GIC/CV to search the rank in a given range, and then fill the missing values with the estimated rank.
r.search(
x,
r.min = 1,
r.max = "auto",
svd.method = c("tsvd", "rsvd"),
rule.type = c("gic", "cv"),
noise.var = 0,
init = FALSE,
init.mat = 0,
maxit.rank = 1,
nfolds = 5,
thresh = 1e-05,
maxit = 100,
override = FALSE,
control = list(...),
...
)A list containing the following components
x.impthe matrix after completion with the estimated rank.
r.estthe rank estimation.
rmsethe relative mean square error of matrix completion, i.e., training error.
iter.countthe number of iterations.
an \(m\) by \(n\) matrix with NAs.
the start rank for searching. Default r.min = 1.
the max rank for searching.
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".
a character string indicating the information criterion rule.
If rule.type = "gic", generalized information criterion rule is used,
else if rule.type = "cv", cross validation is used.
Any unambiguous substring can be given. Default rule.type = "gic".
the variance of noise.
if init = FALSE(the default), the missing entries will initialize with mean.
the initialization matrix.
maximal number of iterations in searching rank. Default maxit.rank = 1.
number of folds in cross validation. Default nfolds = 5.
convergence threshold, measured as the relative change in the Frobenius norm between two successive estimates.
maximal number of iterations.
logical value indicating whether the observed elements in x should be overwritten by its low-rank approximation.
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.
################# Quick Start #################
m <- 100
n <- 100
r <- 10
x_na <- incomplete.generator(m, n, r)
head(x_na[, 1:6])
x_impute <- r.search(x_na, 1, 15, "rsvd", "gic")
x_impute[["r.est"]]
Run the code above in your browser using DataLab