Description Usage Arguments Value References Examples
OptSpace is an algorithm for matrix completion when a matrix is partially observed. It
performs what authors called trimming and projection repeatedly based on
singular value decompositions. Original implementation is borrowed from ROptSpace package,
which was independently developed by the maintainer. See OptSpace
for more details.
1 | fill.OptSpace(A, ropt = NA, niter = 50, tol = 1e-06)
|
A |
an (n\times p) partially observed matrix. |
ropt |
|
niter |
maximum number of iterations allowed. |
tol |
stopping criterion for reconstruction in Frobenius norm. |
a named list containing
an (n\times p) matrix after completion.
a vector of reconstruction errors for each successive iteration.
keshavan_matrix_2010filling
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
## load image data of 'lena64'
data(lena64)
## transform 5% of entries into missing
A <- aux.rndmissing(lena64, x=0.05)
## apply the method with different rank assumptions
filled10 <- fill.OptSpace(A, ropt=10)
filled20 <- fill.OptSpace(A, ropt=20)
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
image(A, col=gray((0:100)/100), axes=FALSE, main="5% missing")
image(filled10$X, col=gray((0:100)/100), axes=FALSE, main="rank 10")
image(filled20$X, col=gray((0:100)/100), axes=FALSE, main="rank 20")
par(opar)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.