How to solve $Ax=y$ according to minimal linear error? I have an overconstrained problem $Ax = y$ that I’m solving for x with a least squares solver (eigen library).
I would like to have the problem solved however such that not the sum of squared errors is minimized, but the sum of errors.
Is there a way to modify the original problem so that I can still use my least-squares solver to solve for x?
If not, what algorithms can solve for that?
As the comments mentions you want to look into L1 regression but first give yourself some time to thinkt if that would make sense for your problem, maybe explaint why you would want to use L1.
If you're using MATLAB or Python with a convex solver such as CVX you shouldn't have any problem. Instead of solving $$\min_\mathbf{x}\,\|A\mathbf{x}-\mathbf{y}\|_2^2 $$ just solve the problem $$\min_\mathbf{x}\,\|A\mathbf{x}-\mathbf{y}\|_2 $$ which is still a convex program. Convergence will be slower than the squared version, but it's still a problem that can be efficiently solved.