rsvd {kazaam} | R Documentation |
Randomized singular value decomposition.
rsvd(x, k = 1, q = 2, retu = TRUE, retv = TRUE)
x |
The input data matrix. |
k |
The number of singular values and/or left/right singular vectors to estimate. |
q |
An integer exponent, say 1, 2, or 3. See the paper for details. |
retu |
Logical; should the left singular vectors ("U") be returned? |
retv |
Logical; should the right singular vectors ("V") be returned? |
TODO
A list of elements d
, u
, and v
, as with R's own
svd()
. The elements are, respectively, a regular vector, a shaq, and
a regular matrix.
The operation is completely local except for forming the crossproduct, which
is an allreduce()
call, quadratic on the number of columns.
Halko, Martinsson, and Tropp. 2011. Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review 53 217-288.
## Not run: library(kazaam) x = ranshaq(runif, 10, 3) svd = rsvd(x) comm.print(svd$d) # a globally owned vector svd$u # a shaq comm.print(svd$v) # a globally owned matrix finalize() ## End(Not run)