How many digits of of accuracy do I expect the have the solution $x$ of $||Ax-b||=0$

condition numberfloating pointleast squaresmatrix decompositionnumerical linear algebra

A least-square problem $||Ax-b||=0$ is solved using a backward stable algorithm (In my case, QR decomposition using householder projectors). The condition number is $\kappa(A)=10^5$.

If the problem is solved using double-precision floating-point arithmetic($10^{-16}$), how many digits of accuracy I should expect the solution $x$ to have?

What I have tried:

I have tried to use this inequalities form the trefethen book page 131-Numerical Linear Algebra

enter image description here

And also I used this table from the same book.
enter image description here

I also found that the exponent of $\kappa(A)=10^5$ means that I will lose 5 digits of accuracy. I would conclude that the accuracy is $10^{-11}$

My doubt: is it this reasoning is ok?. And the second question is:
When do I have to take into account $\kappa(A)^{2}$ rather than only $\kappa(A)$?

Best Answer

To answer your first question, a rule of thumb for a linear system of equations is that if the unit roundoff is $10^{-a}$ and the condition number is $10^b$, then you can expect about $a-b$ digits of accuracy in your answer. This is because, for a backwards stable algorithm, the numerical errors made during your computation can be viewed as a relative perturbation of size $\approx 10^{-a}$ of the initial data. Then the forward error is smaller than the backwards error times condition number so the forward relative error for $x$ is $\approx 10^{b-a}$, leading to $\approx a-b$ correct digits.

A least squares problem has additional subtleties over a pure linear system. For a formal derivation, Trefethen and Bau explain how the $(\kappa(A))^2$ appears in Eqs. (18.13-18.16) of the book you quote. Is their explanation good enough or do you have additional questions?

Regarding the $(\kappa(A))^2$ term in the error bound, note that the $(\kappa(A))^2$ term is tamped by two additional factors. if $\eta$ is on the order of $\kappa(A)$ (which will "usually" happen if $y$ is "randomly chosen"), then $(\kappa(A))^2 / \eta \approx \kappa(A)$. Additionally, if the angle between $y$ and $b$ is small (that is, if $Ax$ is a good approximation for $b$), then $\tan\theta$ will be $\approx 0$ and $(\kappa(A))^2 \tan(\theta)/ \eta$ will be small or at least on the order of $\kappa(A)$. Thus, the $(\kappa(A))^2$ term in the error bound is usually not as bad as it seems, and the rule of the thumb from the first paragraph is usually valid for least squares problems as well.

For some vague intuition as to why we might not be surprised $(\kappa(A))^2$ pops up, remember that the least squares problem is mathematically equivalent to the normal equations $A^\top A x = A^\top b$, which has condition number $\kappa(A^\top A) = (\kappa(A))^2$. Normally, the least-squares problem is significantly better conditioned than the normal equations, but in the worst case (which as established in the previous paragraph is a somewhat special situation) the conditioning becomes the same.

Related Question