trunc_svd | R Documentation |
Truncated SVD
trunc_svd(
A,
d,
adjust = 3,
tol = .Machine$double.eps,
override = FALSE,
force = FALSE,
maxit = 1000
)
A |
matrix to decompose |
d |
number of singular vectors |
adjust |
extra singular vectors to calculate for accuracy |
tol |
convergence criterion |
override |
|
force |
If |
maxit |
Maximum number of iterations |
Performs singular value decomposition but only returns the first d
singular vectors/values.
The truncated SVD utilizes Lanczos bidiagonalization.
See references.
This function was modified from the package irlba 1.0.1 under GPL.
Replacing the crossprod()
calls with the C wrapper to
dgemv
is a dramatic difference in larger datasets.
Since the wrapper is technically not a matrix multiplication function, it
seemed wise to make a copy of the function.
list with singular value decomposition. Has elements 'd', 'u', 'v', and 'iter'
obj <- trunc_svd( hgdp_subset, 4 )
obj$d
obj$u
obj$v
obj$iter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.