Compute SVD of low-rank matrix sketch
[
returns the singular value decomposition (SVD) of a low-rank matrix sketch of input matrixU
,S
,V
] = svdsketch(A
)A
. The matrix sketch is a low-rank approximation that only reflects the most important features ofA
(up to a tolerance), which enables faster calculation of a partial SVD of large matrices compared to usingsvds
.
Usesvdsketch
when you do not know ahead of time what rank to specify withsvds
, but you know what tolerance the approximation of the SVD should satisfy.
svds
computes the best possible rank-k approximation of the SVD (using the default"largest"
method).svdsketch
does not guarantee its rank-k approximation is the best one, which accounts for its speed advantage oversvds
.
svdsketch
applies a tolerance to form a low-rank matrix approximation
of the input matrixA
. This low-rank approximation is called amatrix sketch. The matrix sketch only preserves important features fromA
, filtering unnecessary information out. The relative approximation errorapxErr
of the matrix sketch aims to satisfy the specified tolerancetol
:
The processsvdsketch
follows to form the matrix sketch is:
svdsketch
forms the matrix sketch iteratively, with each iteration adding new columns toQand new rows toB. The new columns and rows are created by extracting features fromA
using a random sample matrix. You can control the number of columns and rows added in each iteration with theBlockSize
name-value pair.
During each iteration,svdsketch
uses power iterations to improve the orthogonality of the new columns inQ. You can adjust the number of power iterations with theNumPowerIterations
name-value pair.
The iterations to form the matrix sketch stop when: the number of columns inQand rows inBreach the specified value forMaxSubspaceDimension
, the number of iterations reachesMaxIterations
, or the relative approximation error converges (apxErr <= tol
).
To improve convergence speed,svdsketch
might increase the specified initial value forBlockSize
from iteration to iteration if the decay inapxErr
is not sufficient.
After the matrix sketch
is formed,svdsketch
计算奇异值分解)the matrix sketch via[U1,S,V] = svd(B,'econ')
, such that
Ifsvdsketch
is able to filter out some features ofA
based on the specified tolerance, then the resulting SVD factors contain fewer singular values and singular vectors than if a full SVD was performed onA
.
[1] Yu, Wenjian, Yu Gu, and Yaohang Li. “Efficient Randomized Algorithms for the Fixed-Precision Low-Rank Matrix Approximation.”SIAM Journal on Matrix Analysis and Applications39, no. 3 (August 2018): 1339–1359.https://doi.org/10.1137/17M1141977.