The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
sparseLRMatrix
provides a single matrix S4 class called
sparseLRMatrix
which represents matrices that can be
expressed as the sum of sparse matrix and a low rank matrix. We also
provide an efficient SVD method for these matrices by wrapping the
RSpectra
SVD implementation.
Eventually, we will fully subclass Matrix::Matrix
objects, but the current implementation is extremely minimal.
You can install the released version of sparseLRMatrix from CRAN with:
# install.packages("remotes")
::install_github("RoheLab/sparseLRMatrix") remotes
library(sparseLRMatrix)
#> Loading required package: Matrix
library(RSpectra)
set.seed(528491)
<- 50
n <- 40
m <- 3
k
<- rsparsematrix(n, m, 0.1)
A
<- Matrix(rnorm(n * k), nrow = n, ncol = k)
U <- Matrix(rnorm(m * k), nrow = m, ncol = k)
V
# construct the matrix, which represents A + U %*% t(V)
<- sparseLRMatrix(sparse = A, U = U, V = V)
X
<- svds(X, 5) # efficient s
And a quick sanity check
<- A + tcrossprod(U, V)
Y <- svds(Y, 5) # inefficient, but same calculation
s2
# singular values match up, you can check for yourself
# that the singular vectors do as well!
all.equal(s$d, s2$d)
#> [1] TRUE
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.