fill.OptSpace {filling} | R Documentation |
OptSpace
Description
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.
Usage
fill.OptSpace(A, ropt = NA, niter = 50, tol = 1e-06)
Arguments
A |
an |
ropt |
|
niter |
maximum number of iterations allowed. |
tol |
stopping criterion for reconstruction in Frobenius norm. |
Value
a named list containing
- X
an
(n\times p)
matrix after completion.- error
a vector of reconstruction errors for each successive iteration.
References
Keshavan RH, Montanari A, Oh S (2010). “Matrix Completion From a Few Entries.” IEEE Transactions on Information Theory, 56(6), 2980–2998. ISSN 0018-9448.
Examples
## 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)