update condition

This commit is contained in:
jverzani 2024-10-16 11:46:03 -04:00
parent c7c60bd436
commit 0ad3cec62e

View File

@ -11,25 +11,25 @@ This sense of "small" is quantified through a *condition number*.
If we let $\delta_x$ be a small perturbation of $x$ then $\delta_f = f(x + \delta_x) - f(x)$.
The *forward error* is $||f(x+\delta_x) - f(x)||$, the *relative forward error* is $||f(x+\delta_x) - f(x)||/ ||f(x)||$.
The *forward error* is $\lVert\delta_f\rVert = \lVert f(x+\delta_x) - f(x)\rVert$, the *relative forward error* is $\lVert\delta_f\rVert/\lVert f\rVert = \lVert f(x+\delta_x) - f(x)\rVert/ \lVert f(x)\rVert$.
The *backward error* is $||\delta_x||$, the *relative backward error* is $||\delta_x|| / ||x||$.
The *backward error* is $\lVert\delta_x\rVert$, the *relative backward error* is $\lVert\delta_x\rVert / \lVert x\rVert$.
The *absolute condition number* $\hat{\kappa}$ is worst case of this ratio $||\delta_f||/ ||\delta_x||$ as the perturbation size shrinks to $0$.
The relative condition number $\kappa$ divides $||\delta_f||$ by $||f(x)||$ and $||\delta_x||$ by $||x||$ before taking the ratio.
The *absolute condition number* $\hat{\kappa}$ is worst case of this ratio $\lVert\delta_f\rVert/ \lVert\delta_x\rVert$ as the perturbation size shrinks to $0$.
The relative condition number $\kappa$ divides $\lVert\delta_f\rVert$ by $\lVert f(x)\rVert$ and $\lVert\delta_x\rVert$ by $\lVert x\rVert$ before taking the ratio.
A *problem* is a mathematical concept, an *algorithm* the computational version. Algorithms may differ for many reasons, such as floating point errors, tolerances, etc. We use notation $\tilde{f}$ to indicate the algorithm.
The absolute error in the algorithm is $||\tilde{f}(x) - f(x)||$, the relative error divides by $||f(x)||$. A good algorithm would have smaller relative errors.
The absolute error in the algorithm is $\lVert\tilde{f}(x) - f(x)\rVert$, the relative error divides by $\lVert f(x)\rVert$. A good algorithm would have smaller relative errors.
An algorithm is called *stable* if
$$
\frac{||\tilde{f}(x) - f(\tilde{x})||}{||f(\tilde{x})||}
\frac{\lVert\tilde{f}(x) - f(\tilde{x})\rVert}{\lVert f(\tilde{x})\rVert}
$$
is *small* for *some* $\tilde{x}$ relatively near $x$, $||\tilde{x}-x||/||x||$.
is *small* for *some* $\tilde{x}$ relatively near $x$, $\lVert\tilde{x}-x\rVert/\lVert x\rVert$.
> "A *stable* algorithm gives nearly the right answer to nearly the right question."
@ -41,14 +41,14 @@ $$
\tilde{f}(x) = f(\tilde{x})
$$
for some $\tilde{x}$ with $||\tilde{x} - x||/||x||$ is small.
for some $\tilde{x}$ with $\lVert\tilde{x} - x\rVert/\lVert x\rVert$ is small.
> "A backward stable algorithm gives exactly the right answer to nearly the right question."
The concepts are related by Trefethen and Bao's Theorem 15.1 which says for a backward stable algorithm the relative error $||\tilde{f}(x) - f(x)||/||f(x)||$ is small in a manner proportional to the relative condition number.
The concepts are related by Trefethen and Bao's Theorem 15.1 which says for a backward stable algorithm the relative error $\lVert\tilde{f}(x) - f(x)\rVert/\lVert f(x)\rVert$ is small in a manner proportional to the relative condition number.
Applying this to the zero-finding we follow doi:10.1137/1.9781611975086.
Applying this to the zero-finding we follow @doi:10.1137/1.9781611975086.
To be specific, the problem is finding a zero of $f$ starting at an initial point $x_0$. The data is $(f, x_0)$, the solution is $r$ a zero of $f$.
@ -63,7 +63,7 @@ Suppose for sake of argument that $\tilde{f}(x) = f(x) + \epsilon$ and $r$ is a
&= 0 + f'(r)\delta + \epsilon
\end{align*}
Rearranging gives $||\delta/\epsilon|| \approx 1/||f'(r)||$ leading to:
Rearranging gives $\lVert\delta/\epsilon\rVert \approx 1/\lVert f'(r)\rVert$ leading to:
> The absolute condition number is $\hat{\kappa}_r = |f'(r)|^{-1}$.
@ -83,4 +83,4 @@ Practically these two observations lead to
For the first observation, the example of Wilkinson's polynomial is often used where $f(x) = (x-1)\cdot(x-2)\cdot \cdots\cdot(x-20)$. When expanded this function has exactness issues of typical floating point values, the condition number is large and some of the roots found are quite different from the mathematical values.
The second observation helps explain why a problem like finding the zero of $f(x) = x * exp(x)$ using Newton's method starting at $2$ might return a value like $5.89\dots$. The residual is checked to be zero in a *relative* manner which would basically use a tolerance of `atol + abs(xn)*rtol`. Functions with asymptotes of $0$ will eventually be smaller than this value.
The second observation helps explain why a problem like finding the zero of $f(x) = x \cdot \exp(x)$ using Newton's method starting at $2$ might return a value like $5.89\dots$. The residual is checked to be zero in a *relative* manner which would basically use a tolerance of `atol + abs(xn)*rtol`. Functions with asymptotes of $0$ will eventually be smaller than this value.