Description Usage Arguments Value See Also Examples
The function may be faster when x is a sparseMatrix object and a few components need to be calculated. In addition, NA values could be presented in x.
1 | svd.nipals(x, nf, ...)
|
x |
a numeric matrix whose SVD decomposition is to be computed |
nf |
the number of singular vectors want to computed |
... |
other parameters passed to |
the same as svd, list of three components, d, u, v
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # small matrix
m <- matrix(rnorm(200), 20, 10)
s <- svd.nipals(m)
# large sparse matrix
## Not run:
library(Matrix)
m <- matrix(sample(c(rnorm(10000), rep(0, 9990000))), 10000, 1000)
ms <- Matrix(m, sparse=TRUE)
system.time(
s1 <- svd(m)
)
system.time(
s2 <- svd.nipals(ms, nf = 1)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.