Least Squares Solver using SVD and the Pseudoinverse
Compute the least squares solution \(\mathbf{x} = A^{\dagger}\mathbf{b}\) using the Moore-Penrose pseudoinverse1.
Most robust method for rank-deficient and ill-conditioned matrices2.
The SVD-based method uses the pseudoinverse to solve least squares problems:
\[\mathbf{x} = A^{\dagger}\mathbf{b}\]
How it works:
Compute SVD: \(A = U\Sigma V^T\), then form the pseudoinverse:
\[A^{\dagger} = V\Sigma^{\dagger}U^T\]
where \(\Sigma^{\dagger}\) inverts nonzero singular values and transposes.
Advantages:
- Handles rank-deficient matrices automatically
- Most numerically stable method3
- Provides minimum-norm solution for underdetermined systems
- Reveals condition number and numerical rank
Enter dimensions and click Generate Matrix to create the input grid and b vector.
1 — Compute
Solves the least-squares problem via SVD and the pseudoinverse A⁺ = VΣ⁺Uᵀ.
Resets all dimensions, matrix entries, and results.
Cite this tool
Kapita, S. (2026). Least Squares Solver using SVD and the Pseudoinverse. Math Tools. https://doi.org/10.5281/zenodo.20981273
Kapita, Shelvean. "Least Squares Solver using SVD and the Pseudoinverse." Math Tools, 2026, doi.org/10.5281/zenodo.20981273.
@online{kapita2026leastsquaressvd,
author = {Shelvean Kapita},
title = {{Least Squares Solver using SVD and the Pseudoinverse}},
year = {2026},
organization = {Math Tools},
doi = {10.5281/zenodo.20981273},
url = {https://doi.org/10.5281/zenodo.20981273}
}