Skip to content

rsvd

linear-algebra · scripts/linear-algebra/rsvd.m

: S = rsvd (A, k)
: [U, S, V] = rsvd (A, k)
: [U, S, V] = rsvd (A, k, q)
: [U, S, V] = rsvd (A, k, q, p)

Randomized rank-k SVD via Gaussian random projection.

Draws a Gaussian test matrix, optionally applies q power iterations (default 2), orthonormalises the range, and computes an economy SVD of the projected matrix. Oversampling p defaults to 10. With one output, S is a column of singular values (largest first), matching svds. With three outputs, S is diagonal.