r.search {eimpute} | R Documentation |
Search rank magnitude of the best approximating matrix
Description
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.
Usage
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(...),
...
)
Arguments
x |
an |
r.min |
the start rank for searching. Default |
r.max |
the max rank for searching. |
svd.method |
a character string indicating the truncated SVD method.
If |
rule.type |
a character string indicating the information criterion rule.
If |
noise.var |
the variance of noise. |
init |
if init = FALSE(the default), the missing entries will initialize with mean. |
init.mat |
the initialization matrix. |
maxit.rank |
maximal number of iterations in searching rank. Default |
nfolds |
number of folds in cross validation. Default |
thresh |
convergence threshold, measured as the relative change in the Frobenius norm between two successive estimates. |
maxit |
maximal number of iterations. |
override |
logical value indicating whether the observed elements in |
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 with the estimated rank. |
r.est |
the rank estimation. |
rmse |
the relative mean square error of matrix completion, i.e., training error. |
iter.count |
the number of iterations. |
Examples
################# 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"]]