runExactSVD | R Documentation |
Perform an exact singular value decomposition.
runExactSVD(x, k=min(dim(x)), nu=k, nv=k, center=FALSE, scale=FALSE,
deferred=FALSE, fold=Inf, BPPARAM=SerialParam())
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 |
A logical scalar indicating whether columns should be centered.
Alternatively, a numeric vector or |
scale |
A logical scalar indicating whether columns should be scaled.
Alternatively, a numeric vector or |
deferred |
Logical scalar indicating whether centering/scaling should be deferred, see |
fold |
Numeric scalar specifying the minimum fold difference between dimensions of |
BPPARAM |
A BiocParallelParam object specifying how parallelization should be performed. |
If any of k
, nu
or nv
exceeds min(dim(x))
, they will be capped and a warning will be raised.
The exception is when they are explicitly set to Inf
, in which case all singular values/vectors of x
are returned without any warning.
Note that parallelization via BPPARAM
is only applied to the calculation of the cross-product.
It has no effect for near-square matrices where the SVD is computed directly.
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.
u
, a numeric matrix with ncol(x)
rows and nv
columns.
Each column contains a right singular vector.
Aaron Lun
svd
for the underlying algorithm.
a <- matrix(rnorm(100000), ncol=20)
out <- runExactSVD(a)
str(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.