The other side was small too
Worth reading first: A correction cheaper than the problem · The exact answer to a nearby problem · The same arithmetic at a different price.
The test that made the answer small moved the blame for an unstable inverse from the inverse to the right-hand side. Solving as , with a computed inverse, has a backward error of about , where is the answer’s size over the largest it could be. The test every earlier measurement used, for a random , makes about as small as it gets, and so found the inverse route twelve decades worse than LU at a condition number of . A random right-hand side has near a quarter and no gap at all.
That inverse was formed the obvious way, one column at a time, by solving with the LU factors. Each column is then the exact solution of a nearby system, so the residual is small. Nothing in that construction says anything about the other residual, , and the earlier essay predicted, with a sign, what would happen if the sides were swapped. LAPACK’s inversion routine does not solve . It inverts , then solves for row by row, and undoes the permutation, so satisfies in the sense that the column form satisfies . The prediction was that this form’s backward error on random right-hand sides would be at least ten times the column form’s at , while its forward error on would fall to within twice LU’s, against the column form’s fifteen times.
The forward error half holds. The backward error half fails, and the reason it fails is the more useful finding: the form the prediction was about does not have a large residual on its other side at all. A third form, which really is the column form turned around, does, and behaves exactly as predicted.
Three inverses of one matrix
The matrices are the earlier essay’s: order 30, singular values spaced geometrically from one down to , singular vectors drawn at random and kept, so that the exact solution of any system is available to rounding and can be read off. Three inverses are formed from the same partially pivoted factorisation :
- the columns of , each column by a forward and a back substitution;
- the transpose’s columns, the same thing done to and transposed back, so that each row of solves a system and is the residual made small;
- , LAPACK’s order: by columns, then by rows against , then .
The second is the clean mirror of the first and the third is what a library does. The prediction had the third in mind and assumed it behaves like the second.
At the column form’s own side, , is 0.13 units of roundoff, scaled by , and its other side is 5.7. The transpose’s form is the exact mirror: 0.12 on its own side, , and 6.7 on . The third form is 0.17 on its own side and 0.38 on the other. Turning the dial down to shrinks the mirrored pair’s other sides to just over one unit and leaves the third form at half a unit or less on both. Every number on this figure is a few units of roundoff or less. That alone says the prediction’s picture, of an inverse whose other residual is not controlled, was too strong: what the other side does is grow, slowly, from about one unit to about six across twelve decades of condition number, and only for two forms of the three.
The other side, as the condition number grows
The two mirrored forms track each other closely: at , rising to to at , a factor of about eight over twelve decades. A bound that would let the other side grow with , which is what the algebra allows, is nowhere near attained. The third form’s other side does not grow at all: it drifts from down to . Three other matrices of the same construction at give the same split, the column form’s other side between 1.3 and 2.3 units and the third form’s between 0.25 and 0.42, so the matrix drawn here is the column form’s worst of four and not a typical one.
So the side on which an inverse’s residual is small is not settled by which equation the inverse was computed from. The third form computes from and is small on both sides; the first two compute it from and respectively and are small on one. Something about the order of the work matters.
What the backward error was reading
The size of the residual on each side would be a curiosity if it did not show up in the solve. It does, and it shows up in the constant of the earlier essay’s law. The residual of is
so the backward error, which divides by , is about , which is the scaled residual on the side times . The earlier essay found its backward error equal to “about a tenth of a unit of roundoff over ”, and the constant was a fitted range from 0.006 to 0.34. The tenth was the column form’s own residual, 0.13 units. That law was a law about one inverse, and the constant in it belongs to the form.
The mirror form, with 6.7 units on that side, should then lose about fifty times as much on any right-hand side, and on random right-hand sides that is what the figure shows: at , against for the column form and for LU. That is forty times the column form’s and fifty-eight times LU’s, which satisfies the letter of the prediction, a factor of ten or more, and “breaks the agreement with LU” by a digit and a half. It does not break it by anything like the twelve decades that costs, because the random right-hand side’s is still near a quarter: the loss is the residual’s growth, from 0.13 units to 6.7, and nothing else.
The third form, the one the prediction was about, sits at , between the column form and twice it, at every condition number. On a random right-hand side LAPACK’s inverse is as good as the column form’s to within a factor of two. The prediction misidentified the form, and its claimed mechanism, a residual on the far side that is not controlled, belongs to a form no library uses.
What b = Ax was reading
The forward error is a different expression. With , up to the rounding in forming ,
so it reads the other residual, . That is the column form’s bad side.
The column form’s forward error on these right-hand sides climbs from 2.2 times LU’s at to 13 and 14 times at and , which is where the earlier essay’s “fifteen times” came from. Both forms that keep small stay within twice LU’s throughout: the mirror at 1.7 and the third form at 1.46 at , and neither above 1.6 anywhere on the range. This half of the prediction holds, and it holds for both of the forms that might have been meant.
Put the two halves side by side and the column form and its mirror simply trade. The column form is nearly LU on backward error and fourteen times worse on the forward error of an arranged test; the mirror is nearly LU on that forward error and fifty times worse on backward error everywhere. Neither has both. The third form has both: under twice LU’s forward error on , and under three times its backward error on a random .
Four kinds of right-hand side at the worst condition number
On the two kinds of right-hand side with small , and along the top left singular vector, all three inverses are equally bad: backward errors between and , eleven to twelve decades above LU’s. That is the earlier essay’s at its worst, and the form does not rescue it, since every form’s residual is at most a few units and is . On the two kinds with near a quarter or a third, the random and along the bottom singular vector, the forms separate by exactly the factor of their residuals, and the mirror sits a digit and a half above the others. So the right-hand side decides whether there is a loss at all, and the form decides its size only where the loss is small.
Their forward errors along the top singular vector tell the same story from the other side: the column form’s is , the other two and , LU’s . The column form loses a digit to the others wherever is small, which is wherever is being read.
Where the conditioning sits
Why should the third form keep both sides? It computes three things in turn: by columns, which leaves small; by rows against , which leaves small; and a permutation, which is exact. On the side it did not aim for, , the error of the second step is carried through , and the error of the first through and on either side. The mirrored column forms instead carry their wrong-side error through the triangular factor that holds the conditioning.
Partial pivoting bounds every multiplier in by one, and on these matrices that leaves between 160 and 250 at every condition number from to . All the conditioning goes into , whose condition number tracks the matrix’s, at . So a form whose wrong-side solve is against is amplifying its rounding by a fixed and modest factor, and that is consistent with what the third form does. The argument is suggestive rather than proved: the worst-case amplification, a factor of or , is nowhere near attained by either form, since the mirrored forms’ other side reaches seven units where would allow , and this measurement does not separate the factor’s conditioning from the alignment of the errors with it. What it does show is that the conditioning is all in one factor, and that the one form whose wrong-side work avoids that factor is the one that keeps both residuals.
How a program ends up holding the mirror
The mirror form would be a curiosity if nobody computed it, and nobody sets out to. It arrives by a route that involves no decision at all. A program that stores its matrices by rows and hands one to a routine that works by columns has handed over the transpose, since the same block of memory read the other way is . If the routine inverts by solving for the columns of the identity, the most direct way to write an inverse with a solver, then it has solved by columns, and the block of memory that comes back, read by rows again, is : the transpose’s columns, transposed. That is exactly the second form here, produced by a program whose source contains the words “solve” and “identity” and nothing about sides. The same happens when an inverse of is wanted for its own sake, in a least squares or adjoint computation, and is obtained by transposing an inverse already in hand.
None of this changes a single entry by more than a few units of roundoff, and the forward error of such a program on its own tests would look better than the column form’s, not worse, because the tests are usually built as . That is the arrangement under which the mirror shines. Its cost shows only on the right-hand sides a test is not built from, a digit and a half of backward error that every solve then carries. A program that checks its inverse by multiplying it back, , will find it at a tenth of a unit and report a good inverse, a check that passes on the measure the program did not need, which is the shape of a backward stable answer to a problem nobody asked in miniature. The column form would have reported 5.7 units on the same check and been the better inverse for the solves.
The constant in a law belongs to an algorithm
There is a general point under the particular one. The earlier essay’s law, backward error about a tenth of the roundoff over , was a good law: fourteen decades of , a hundred right-hand sides, the constant inside a factor of ten either way. It read as a law about multiplying by an inverse. It was a law about multiplying by one inverse. The belongs to the problem, since it measures how much the answer’s size lets a fixed residual matter, and every form shares it. The tenth belongs to the arithmetic that built , and two forms of three have a different one.
This is the same separation three errors and one number draws between what a problem contributes to an error and what each decision about the computation does, and it is why a fitted constant should be reported with the algorithm that produced it. A constant fitted on one route is a measurement; carried to another route it is an assumption, and here the assumption would be off by a factor of fifty in one direction, on a measure that the most natural check reports as better.
What a person holding an inverse should take from this
The inverse that is never formed gave the usual advice and the usual reason: solve, do not invert, because one route is backward stable and the other is not. The gap refinement can close found that one step of refinement repairs the inverse route’s backward error, and the earlier essay narrowed the instability to the right-hand sides that make small. This adds one more condition, about the inverse itself. An inverse that has to exist, because it is the quantity a program reports or because it is applied to vectors that arrive one at a time, should be formed LAPACK’s way: its backward error on a forgiving right-hand side matches the column form’s within a factor of two, and its forward error on an unforgiving one matches LU’s within a factor of two. The mirrored column form, which is what a program gets by forming the inverse of a transpose and transposing it back, is the worst of the three on the measure that matters on forgiving right-hand sides, and a check of its residual would pass it.
That last point is the one to keep. A small residual is not a small error, and for an inverse a small residual is not even a statement about the inverse, until it says which side. A library that reports as its inverse’s accuracy has told the user about the forward error on arranged tests and nothing about the backward error of the solves that will be done with it; one that reports has told the opposite. The exact answer to a nearby problem is the standard of backward stability, and for the nearby problem’s distance is the side divided by , whichever side the inverse was built along.
What order thirty does not settle
One family of matrices, one order, one factorisation with partial pivoting. The factor stayed near a condition number of two hundred here because these matrices have random singular vectors; matrices for which partial pivoting produces a badly conditioned exist, the bound that is never attained describes their growth, and on them the third form’s argument above would predict a larger far-side residual. Matrices with graded rows or columns, tried in passing at grading up to , did not separate the forms on either measure, since normwise measures are dominated by the scaling; componentwise measures would see more and were not computed. Larger orders let the column forms’ far side grow further, and how fast is not measured.
Still open: an L that is badly conditioned, and the componentwise sides
A matrix that conditions L. The argument from where the conditioning sits predicts that the third form keeps its far side small only while is well conditioned. The prediction with a sign is that on a matrix whose partially pivoted has above , such as a Wilkinson-type matrix with small perturbations or a matrix built as with an of graded columns, the third form’s rises to within a factor of ten of the column forms’ far side, and its backward error on random right-hand sides with it. If it does not rise, the order of the work, not the conditioning of , is what keeps it small.
Componentwise. On graded matrices the normwise measures hide everything. The prediction is that the componentwise residuals against separate the three forms by more than the normwise ones do here, by at least a factor of a hundred at a grading of , with the third form again the only one small on both sides.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- An accuracy that is a backward error — both name backward error, condition number, forward error, residual
- Bracketing an error nobody can measure — both name backward error, condition number, forward error, residual
- Elimination is a sequence of choices — both name backward error, lu factorisation, partial pivoting, residual
- The fifth author — both name backward error, condition number, forward error, residual
- The problem the solver was actually given — both name backward error, condition number, forward error, residual
- The residual knew the error — both name backward error, condition number, forward error, residual
Named objects
A flat tag is an object no other essay names yet.
Backward errorCondition numberForward errorLU factorisationMatrix inversePartial pivotingResidual