Singular value decomposition method for solving least squares problems
25 views (last 30 days)
Steven Lord on 16 Nov 2022
In this case Σ does not represent summation. One of the ways in which the singular value decomposition is represented is:
John D'Errico on 16 Nov 2022
Please stop asking this same question multiple times.
If you are asking how to solve a least squares problem of the form A*x = y, using the svd, then you already have a simple formula right there, based on the output of the SVD, in the form
[U,S,V] = svd(A,0);
Remember that Sigma is a square MATRIX, but that it is also a diagonal matrix, so computing the inverse is easy, as long as none of the singular values are zero, or too close to zero, in which case your matrix was numerically singular anyway. In that case, the pinv solution falls into your lap.
If you are asking how to show that expression does result in a least squares solution, then this is not even a question about MATLAB. Regardless, then you could start with the normal equations solution for least squares. (Usually a bad idea, but it does work here.) Effectively, what is called the OLS method here:
Substitute in the factorization for A=U*S*V' from the SVD, and everything collapses. How to show that is not a question about MATLAB however, but just basic linear algebra.