compsvd | R Documentation |
Computes SVD.
compsvd(mat, method = c("irl", "svd"), ncomp = 30, ...)
mat |
matrix, pre-processed input; can be sparse or full (pre-processing can be performed using |
method |
character, the algorithm to be used for svd. Default is irl. Currently supports 'irl' for irlba::irlba or 'svd' for stats::svd |
ncomp |
numeric, number of components; Default is 30 |
... |
(additional arguments for methods) |
SVD result - a list with the following elements:
d
a vector of the diagonal singular values of the input mat
. Note that using svd
will result in the full set of singular values, while irlba
will only compute the first ncomp
singular values.
u
a matrix of with the left singular vectors of mat
in the columns
v
a matrix of with the right singular vectors of mat
in the columns
eigsum
sum of the eigenvalues, for calculating percent variance explained
mat <- matrix(sample(0:10, 2500, replace=TRUE), ncol=50) compsvd(mat, method = 'irl', ncomp = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.