The proposed solution of misses the right-hand side by only , yet the true solution is , so the proposal is wrong by percent. How can both statements be true? This lesson separates the residual, the forward error and the backward error, which answer different questions, proves the bound that connects them through the condition number, and explains what backward stability promises and what it cannot. It also separates exact rank from numerical rank and shows that a tiny determinant does not by itself signal ill-conditioning. Throughout, is or , a tuple such as stands for a column vector, and every error is measured in a declared vector norm with its induced matrix norm, usually the Euclidean one.
Key terms
Residual and forward error
Definition Let and , and let be a proposed solution of . The residual of is
It measures the mismatch in the equation, in the output space, and it can be computed from the data without knowing any exact solution. In exact arithmetic exactly when solves the system. For the relative residual is . Now let be square and invertible and , so that the exact solution is nonzero. The forward error of is , measured absolutely by or relatively by
The forward error lives in the input space, and it usually cannot be computed, because is unknown. A residual and an error are different kinds of quantity, with different units in general, so they should not be compared as bare numbers without a sensitivity relation. A residual computed in floating-point arithmetic also carries its own rounding error, so a tiny computed residual has to be read together with that error.
In plain words The residual asks how badly the proposed answer fails the equation. The forward error asks how far the proposed answer is from the true one. The first can be checked directly, and the second usually cannot.
Example Let , and . Then , so and the relative residual is . The exact solution is , so the forward error is and the relative forward error is . The matrix compresses the second input direction by the factor , so a large error in that direction produces only a small mismatch in the output.
Backward error
Definition The backward error of a proposed solution is the size of the smallest change of the data, within a stated class of allowed changes, that makes an exact solution. The class and the way changes are measured must be stated, because different models give different numbers.
In the right-hand-side model, stays fixed and we require . The only such change is , so the backward error is , and relative to it equals the relative residual .
In the matrix model with the Euclidean norm, stays fixed, , and we require , that is . Every such has , because . The rank-one matrix
satisfies and has , so it attains the minimum. Relative to the backward error is , which has a different denominator from the first model. If and , no change of alone can help, since every matrix sends to . Allowing changes of both and , or bounding each entry separately, defines still other backward errors.
In plain words Backward error turns the question around. Instead of asking how wrong the answer is, it asks how little the problem would have to change for the answer to be exactly right.
Example With the data of the previous example, exactly solves , a right-hand side that differs from by . So the relative backward error in the right-hand-side model is . In the matrix model the minimal change and the changed matrix are
and indeed . Here , while . In both models exactly solves a very nearby problem, although its forward error is percent.
Residual bound on the forward error
Definition Let be invertible, let and , and let have residual . In any vector norm on with its induced matrix norm and condition number ,
Subtracting from gives , so and . Dividing by and using gives the upper bound. For the lower bound, and . Multiplying by gives it. The relative residual is the relative right-hand-side backward error, so in this model the relative forward error is at most the condition number times the relative backward error. In the Euclidean norm both bounds are attained for suitable and , but for a particular the error can lie anywhere between them. The proof uses , so it does not apply to a singular system.
In plain words Multiplying the relative residual by gives a ceiling for the relative error, and dividing by gives a floor. The true error lies somewhere between them. So a small residual guarantees a small error only when the ceiling is small too, and the larger the condition number, the smaller the residual has to be.
Example In the first example and the relative residual is , so the upper bound is , and the actual relative error attains it. For the same and , the proposal has , so its relative residual is , and its relative forward error is also . The two bounds give the range from to . The upper bound is valid but far from the truth, because this error lies along the direction that does not compress.
Ill-conditioned system
Definition Let be invertible, with a declared norm. The system , with fixed and subject to error, is ill-conditioned when is large, so that, for some right-hand sides, small relative changes in can cause relative changes in up to times larger. There is no universal threshold. If the data carry relative errors up to , solutions consistent with the data can differ from by relative amounts up to , and for some right-hand sides and perturbations that worst case is reached. When is near or larger, the bound no longer guarantees even one correct digit. Ill-conditioning belongs to the problem, its norm and its error model. No algorithm removes it, although a poor algorithm can add errors of its own.
The size of the determinant is not a test of conditioning. Writing with unitary and , whose determinants have absolute value , gives
In absolute value the determinant is the product of the singular values, while the condition number is a ratio of two of them. Scaling by multiplies the determinant by and leaves the condition number unchanged.
In plain words An ill-conditioned system is one whose data cannot pin down the answer to the accuracy one might expect. What matters is how unevenly the matrix stretches different directions, not how small its entries or its determinant are.
Example For the matrix has determinant , but . Every relative change in gives the same relative change in , although absolute changes are multiplied by . In the other direction, has determinant and , so a relative error of in can produce a relative error of in .
Backward stability
Definition The floating-point rounding model describes arithmetic with a unit roundoff . A real number in the normal range is stored as with , and each basic operation , one of , , and , applied to stored numbers and returns
Overflow and underflow are excluded from this simple model. Rounding to nearest with significant decimal digits gives , and IEEE double precision has .
An algorithm for square systems is backward stable, normwise and under this model, if for every input it returns a vector that exactly solves a nearby system
with and , where is a modest constant that depends only on the dimension. If is invertible, and is the exact solution, combining this with conditioning gives
which follows from , the inequality and . So backward stability guarantees a small forward error only when is small. It controls the error that the algorithm adds, while the condition number decides what that error does to the answer. Proving that a whole algorithm is backward stable requires bounding every rounded operation it performs. A small residual in one example proves nothing of the kind.
In plain words Every arithmetic step may be off by a tiny relative amount. A backward stable method promises that its answer is the exact answer to a problem that differs from yours by a modest multiple of that tiny amount. It cannot promise more accuracy than the problem itself allows.
Example With four significant digits, . Solving by one division gives , with relative error . Since , the computed value is the exact solution of , whose right-hand side differs from by the relative amount . In general, for , the computed exactly solves , so one rounded division is backward stable with . Because , it is also accurate in the forward sense.
Numerical rank
Definition Let have singular values , where . Its exact rank is the number of nonzero singular values, counted with no tolerance. For a tolerance , its numerical rank is the number of singular values greater than . By the Eckart-Young theorem in the spectral norm, this is the smallest rank of a matrix within spectral distance of ,
If exactly singular values exceed , the truncated SVD has rank and , with read as , while every of rank less than has . The tolerance has to come from the problem, for example from the size of the measurement errors in or from the rounding errors of the arithmetic, not from a wish for tidy output. It is an absolute size in the units of , so rescaling without rescaling can change the count. Replacing by a matrix of lower rank also changes the problem. It can make a solution less sensitive to noise, but the reduced model no longer represents every direction of .
In plain words Exact rank asks whether a direction is crushed to exactly zero. Numerical rank asks whether it is crushed below the level at which the data can be trusted.
Example The matrix with columns and has orthogonal columns, so its singular values are their lengths and , and its exact rank is . If the matrix is known only to within in spectral norm, the tolerance gives numerical rank . Indeed the rank-one matrix with columns and lies at spectral distance , well inside that uncertainty. If the matrix is accurate to , the tolerance gives numerical rank , and both directions are resolved.
Check yourself
- Let , and . Find the residual, the relative residual, the relative forward error and , and compare the error with the upper bound from the residual.
Show the answer
The product is , so and the relative residual is . The exact solution is , so the forward error is and the relative forward error is . The singular values are and , so , and the upper bound is . The bound is attained. The relative right-hand-side backward error is only , yet the answer is off by percent.
- Let and , and take . Compute the relative residual and the relative forward error. Does a large residual prove that an answer is poor?
Show the answer
The exact solution is . The product is , so . Since , the relative residual is . The forward error is , so the relative forward error is , and the lower bound is attained.
So a large residual does not prove that an answer is poor. Here a residual of percent sits next to an error of percent. The right-hand side is small because the exact solution lies along the direction that compresses, while the error points along the direction that leaves alone. The answer is accurate in the forward sense, but its relative right-hand-side backward error is large. Which one matters depends on the question being asked.
- Let . Find and . Is the system ill-conditioned? Find the numerical rank of for the tolerances and .
Show the answer
The determinant is . All three singular values equal , so and the system is perfectly conditioned. A relative change in produces the same relative change in , although absolute changes grow by the factor . The tiny determinant says nothing about conditioning.
For all three singular values exceed the tolerance, so the numerical rank is . For none does, so the numerical rank is . The zero matrix lies within spectral distance of , so if is known only to within in spectral norm, the data cannot be told apart from zero. That is a statement about absolute size in the units of , not about conditioning.