Description Usage Arguments Value References See Also Examples
Singular Value Decomposition (SVD) is the best low-rank approximation of a given matrix.
fill.SVDimpute
exploits such idea. First, it starts with simple filling using
column mean values for filling. Second, it finds SVD of a current matrix. Then,
each row vector is regressed upon top-k right singular vectors. Missing entries are
then filled with predicted estimates.
1 | fill.SVDimpute(A, k = ceiling(ncol(A)/2), maxiter = 100, tol = 0.01)
|
A |
an (n\times p) partially observed matrix. |
k |
the number of regressors to be used. |
maxiter |
maximum number of iterations to be performed. |
tol |
stopping criterion for an incremental progress. |
a named list containing
an (n\times p) matrix after completion.
troyanskaya_missing_2001filling
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
## load image data of 'lena128'
data(lena128)
## transform 5% of entries into missing
set.seed(5)
A <- aux.rndmissing(lena128, x=0.05)
## apply the method with 3 different number of regressors
fill1 <- fill.SVDimpute(A, k=5)
fill2 <- fill.SVDimpute(A, k=25)
fill3 <- fill.SVDimpute(A, k=50)
## visualize only the last ones from each run
opar <- par(no.readonly=TRUE)
par(mfrow=c(2,2), pty="s")
image(A, col=gray((0:100)/100), axes=FALSE, main="5% missing")
image(fill1$X, col=gray((0:100)/100), axes=FALSE, main="5 regressors")
image(fill2$X, col=gray((0:100)/100), axes=FALSE, main="25 regressors")
image(fill3$X, col=gray((0:100)/100), axes=FALSE, main="50 regressors")
par(opar)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.