Return the least-squares solution to a linear equation.
For overdetermined systems, this finds the x that minimizes norm(ax - b). For underdetermined systems, this finds the minimum-norm solution for x.
x
norm(ax - b)
This currently uses Cholesky decomposition to solve the normal equations, under the hood. The method is not as robust as QR or SVD.
coefficient matrix of shape (M, N)
(M, N)
right-hand side of shape (M,) or (M, K)
(M,)
(M, K)
least-squares solution of shape (N,) or (N, K)
(N,)
(N, K)
Return the least-squares solution to a linear equation.
For overdetermined systems, this finds the
xthat minimizesnorm(ax - b). For underdetermined systems, this finds the minimum-norm solution forx.This currently uses Cholesky decomposition to solve the normal equations, under the hood. The method is not as robust as QR or SVD.