runSVD | R Documentation |
Perform a singular value decomposition on an input matrix with a specified algorithm.
runSVD(x, k, nu=k, nv=k, center=FALSE, scale=FALSE,
BPPARAM=SerialParam(), ..., BSPARAM=ExactParam())
x |
A numeric matrix-like object to use in the SVD. |
k |
Integer scalar specifying the number of singular values to return. |
nu |
Integer scalar specifying the number of left singular vectors to return. |
nv |
Integer scalar specifying the number of right singular vectors to return. |
center |
Numeric vector, logical scalar or |
scale |
Numeric vector, logical scalar or |
BPPARAM |
A BiocParallelParam object specifying how parallelization should be performed. |
... |
Further arguments to pass to specific methods. |
BSPARAM |
A BiocSingularParam object specifying the type of algorithm to run. |
The class of BSPARAM
will determine the algorithm that is used, see ?BiocSingularParam
for more details.
The default is to use an exact SVD via runExactSVD
.
A list containing:
d
, a numeric vector of the first k
singular values.
u
, a numeric matrix with nrow(x)
rows and nu
columns.
Each column contains a left singular vector.
v
, a numeric matrix with ncol(x)
rows and nv
columns.
Each column contains a right singular vector.
Aaron Lun
runExactSVD
, runIrlbaSVD
and runRandomSVD
for the specific functions.
a <- matrix(rnorm(100000), ncol=20)
out.exact0 <- runSVD(a, k=4)
str(out.exact0)
out.exact <- runSVD(a, k=4, BSPARAM=ExactParam())
str(out.exact)
out.irlba <- runSVD(a, k=4, BSPARAM=IrlbaParam())
str(out.exact)
out.random <- runSVD(a, k=4, BSPARAM=RandomParam())
str(out.random)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.