I need to calculate a low rank SVD of a large matrix for a pseudoinverse, but I also need the individual matrices. I currently do I like this:
X_svd = svd(X)
r = 20
U = X_svd.U[:, 1:r]
Σ = Diagonal(X_svd.S[1:r])
Vt = X_svd.Vt[1:r, :]
svd
does not have a parameter to produce the low rank approximations, interestingly pinv
has an option for that (atol
and rtol
).
Am I right that this is a limitation of LAPACK and not julia calling it? I don’t know much about the algorithmic side of this, how large are the potential gains (computation and memory) when only calculating a lower rank?
I found LowRankApprox.jl but I have yet to try it.