Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full-rank SVD has high error #28

Open
PythonNut opened this issue Dec 5, 2020 · 2 comments
Open

Full-rank SVD has high error #28

PythonNut opened this issue Dec 5, 2020 · 2 comments

Comments

@PythonNut
Copy link

PythonNut commented Dec 5, 2020

I am not exactly sure if this is correct, but I would expect the result to be close to zero.

using TSVD, LinearAlgebra
A = randn(10, 10)
U, S, V = tsvd(A, 10);
@show norm(U * Diagonal(S) * V' - A)

instead I get

julia> @show norm(U * Diagonal(S) * V' - A)
norm(U * Diagonal(S) * V' - A) = 9.224320184306517
9.224320184306517

I do realize a full-rank SVD is probably not the intended use-case of this package. If this really can't be handled by this algorithm, then maybe it should throw an error?

@adrilow
Copy link

adrilow commented May 3, 2022

I can report the same issue:

B = rand(100,100)
nvals = 55
U, s, V  = tsvd(B,nvals)
Δ = norm(U * Diagonal(s) * transpose(V) - B)

returns an error of 7.99, but increasing to 56 returns an error of 402.63. I don't see how there is a distinction between these two values. For reference, the 55th and 56th singular values are 2.09 and 2.06.

I am using Julia v1.6.4 and TSVD v0.4.3

@jmbeckers
Copy link

jmbeckers commented Jun 10, 2022

using TSVD, LinearAlgebra
A = randn(10, 10)
U, S, V = tsvd(A, 10;tolreorth=0.0);
@show U * Diagonal(S) * V'-A 

does provide the correct expansion, but how to be sure one takes a good value for tolreorth in a more general case ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants