r.search | R Documentation |
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(...), ... )
x |
an m by n matrix with |
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. |
A list containing the following components
|
the matrix after completion with the estimated rank. |
|
the rank estimation. |
|
the relative mean square error of matrix completion, i.e., training error. |
|
the number of iterations. |
################# 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"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.