Structure, and the solver that cannot see it

The residual knew the error

A Sylvester solve's structured backward error climbed by a factor of 26,000 while its forward error did not move, and the reading was that the condition number belonging to those structured perturbations must fall by the same factor. It was predicted to fall by at least ten thousand across the sweep, and its product with the backward error to match the forward error within ten. Neither happens. The structured condition number rises, by a factor of 2.8 at every size of C, because it is a worst case over every direction a perturbation of that size could take, and the backward error's perturbation takes the most harmless one. Their product overstates the error by up to 3·10⁶ on one route and 9·10⁶ on the other. The relative residual times the plain inverse of the Kronecker matrix's smallest singular value is within a factor of 0.96 to 9.7 of the forward error on all 120 solves.

Worth reading first: An equation whose unknown is a matrix · The exact answer to a nearby problem · Orthogonal is a number.

A backward error the answer does not feel built Sylvester equations AX+XB=CAX + XB = C on purpose to separate two numbers that a linear system keeps together. With AA symmetric with eigenvalues one to eight, B=−A+δIB = -A + \delta I and XX commuting with AA — so that C=δXC = \delta X exactly — it swept the conditioning of XX from 1 to 10810^8 and the size of CC from half of XX down to 10−6X10^{-6}X. Both routes to the answer, Bartels and Stewart’s Schur reduction and the n2×n2n^2 \times n^2 Kronecker system, left residuals at the rounding level everywhere. The structured backward error — the smallest perturbation of AA, BB and CC, each measured against its own size, that makes the computed XX exact — did not: it climbed by a factor of 26,000 across the sweep at the smallest CC. And the forward error against the exact XX did not move at all.

The essay’s explanation was that “a forward error is bounded by a condition number times a backward error, and the condition number that goes with these structured perturbations falls as fast as the backward error rises”. It asked for that condition number. “The prediction is that the structured condition number for perturbations of AA, BB and CC measured relative to their own norms, computed exactly at this order, falls by at least ten thousand across the κ(X)\kappa(X) sweep at C=10−6XC = 10^{-6}X, and that its product with the backward error is within a factor of ten of the measured forward error on every equation.”

It is computed here, and it does the opposite. And the number that does track the error turns out to be the one the earlier essay set aside in the first paragraph: the residual.

The condition number of an equation in three matrices

Perturb AA, BB and CC by ΔA\Delta A, ΔB\Delta B and ΔC\Delta C and the answer moves by ΔX\Delta X with, to first order, A ΔX+ΔX B=ΔC−ΔA X−X ΔBA\,\Delta X + \Delta X\,B = \Delta C - \Delta A\,X - X\,\Delta B. Written with the Kronecker matrix P=I⊗A+BT⊗IP = I \otimes A + B^{\mathsf T} \otimes I that an equation whose unknown is a matrix introduced, that is vec⁡ΔX=−P−1He\operatorname{vec}\Delta X = -P^{-1}H e, where ee stacks the three perturbations divided by the norms α\alpha, β\beta and γ\gamma of AA, BB and CC, and H=[α(XT⊗I), β(I⊗X), −γI]H = [\alpha (X^{\mathsf T} \otimes I),\ \beta (I \otimes X),\ -\gamma I]. That HH is the same matrix whose minimum-norm solve defined the backward error, which is why the two belong together: the backward error is the smallest ∥e∥\|e\| with HeHe equal to the residual, and the structured condition number is the largest ∥P−1He∥/∥X∥\|P^{-1}He\|/\|X\| per unit of ∥e∥\|e\|, the norm of P−1HP^{-1}H over the size of XX.

At order eight P−1HP^{-1}H is a 64 × 192 matrix and its norm can be computed directly: 192 solves with PP, then the largest singular value. It is computed here from the exact XX on every equation of the family, three bases each, and set beside the backward errors and forward errors the earlier essay measured, for both routes.

That is affordable only because the order is small. The elimination the matrix does not need priced the Kronecker matrix of order n2n^2 and found the structure that lets Bartels and Stewart avoid ever forming it; the structured condition number has no such shortcut, since it is the norm of P−1P^{-1} applied to three blocks, one of them n2n^2 wide, and at order eight that is 192 solves with a 64 × 64 matrix. At order a hundred it would be thirty thousand solves with a matrix of order ten thousand. A number that expensive has to earn its place, and the question here is whether it does.

It rises

Bartels and Stewart's solution of the Sylvester family: the structured condition number (solid) and the structured backward error (dashed) against κ(X), at four sizes of C, medians over three basesC = 0.5 X: condition 13.7, 33.1, 37.3, 38.3, 38.6; backward error 1.67·10⁻¹⁵, 1.28·10⁻¹⁵, 9.74·10⁻¹⁶, 9.9·10⁻¹⁶, 8.75·10⁻¹⁶. C = 10⁻² X: condition 714, 1726, 1944, 1999, 2013; backward error 2.09·10⁻¹⁵, 2.26·10⁻¹⁵, 1.02·10⁻¹⁴, 2.26·10⁻¹⁴, 3.08·10⁻¹⁴. C = 10⁻⁴ X: condition 7.14·10⁴, 1.73·10⁵, 1.95·10⁵, 2·10⁵, 2.01·10⁵; backward error 1.88·10⁻¹⁵, 1.83·10⁻¹⁵, 5.23·10⁻¹⁴, 9.94·10⁻¹³, 1.66·10⁻¹². C = 10⁻⁶ X: condition 7.14·10⁶, 1.73·10⁷, 1.95·10⁷, 2·10⁷, 2.01·10⁷; backward error 1.48·10⁻¹⁵, 1.53·10⁻¹⁵, 4.75·10⁻¹⁴, 2.33·10⁻¹², 3.86·10⁻¹¹, at κ(X) from 1 to 10⁸.10⁻¹⁶10⁻¹²10⁻⁸10⁻⁴110⁴10⁸κ(X), on a logarithmic scalecondition number · backward error10⁰10²10⁴10⁶10⁸C = 0.5 XC = 10⁻² XC = 10⁻⁴ XC = 10⁻⁶ Xsolid: structured condition · dashed: backward errorone rises by thousands, the other by three
Fig. 1 Bartels and Stewart’s solution of the family: the structured condition number (solid) and the structured backward error (dashed) against κ(X), at four sizes of C, medians over three bases.

At C=10−6XC = 10^{-6}X the structured condition number is 7.1⋅1067.1 \cdot 10^{6} when XX is perfectly conditioned and 2.0⋅1072.0 \cdot 10^{7} when κ(X)=108\kappa(X) = 10^8. It does not fall; it rises, by a factor of 2.8. The same factor appears at every size of CC: 13.7 to 38.6 at C=0.5XC = 0.5X, 714 to 2,013 at 10−210^{-2}, 7.1⋅1047.1 \cdot 10^{4} to 2.0⋅1052.0 \cdot 10^{5} at 10−410^{-4}. Almost all of the change happens between κ(X)=1\kappa(X) = 1 and 10210^2, and from there it is flat. Over the same sweep the backward error goes from 1.5⋅10−151.5 \cdot 10^{-15} to 3.9⋅10−113.9 \cdot 10^{-11}, so the two curves in the figure run in opposite directions where the prediction needed them to run in parallel and opposite.

The size of the number is no mystery once it is computed. Each level of CC sets it at about (α+β)/sep⁡(A,B)(\alpha + \beta)/\operatorname{sep}(A, B): with α\alpha and β\beta near 14.3 each and sep⁡\operatorname{sep} equal to δ\delta for this family — the smallest ∣λi(A)+λj(B)∣|\lambda_i(A) + \lambda_j(B)| is δ\delta, at i=ji = j — that is 2.9⋅1072.9 \cdot 10^{7} at δ=10−6\delta = 10^{-6}, and the structured number sits a factor of 1.4 below it at the ill-conditioned end. Perturbing AA by a relative η\eta changes AXAX by about ηα∥X∥\eta\alpha\|X\|, and the inverse of the Kronecker matrix multiplies that by up to 1/sep⁡1/\operatorname{sep}. That direction is always available. The structured condition number is a supremum over all perturbations of a given size, and the supremum is reached by perturbing AA or BB along the direction P−1P^{-1} amplifies most, which has nothing to do with how XX is conditioned.

So the product is a bound, and a loose one

Every one of 120 Sylvester solves of order 8, both routes, four sizes of C and three bases: the structured backward error times the structured condition number, and the relative residual times the unstructured condition number, each over the forward error against the exact X, against κ(X)The residual's estimate over the error ranges from 0.96 to 9.65; the backward error's from 1.13 to 9.26·10⁶, growing with κ(X) and as C shrinks.10⁻¹110¹10²10³10⁴10⁵10⁶10⁷κ(X), on a logarithmic scaleestimate ÷ forward error10⁰10²10⁴10⁶10⁸backward error ×structured conditionresidual ×unstructured conditiondashed: an estimate equal to the errorthe residual's estimate stays within ten
Fig. 2 Every one of 120 solves, both routes, four sizes of C and three bases: the structured backward error times the structured condition number, and the relative residual times the unstructured condition number, each over the forward error against the exact X, against κ(X).

The product of the backward error and the structured condition number is a valid first-order bound on every solve: never below the error, its smallest ratio 1.13. But it is a bound whose slack grows with exactly the quantity the family turns up. At C=0.5XC = 0.5X it is within a factor of six for Bartels and Stewart and of 57 for the Kronecker system. At C=10−6XC = 10^{-6}X its median over the three bases is 1.2 times the error at κ(X)=1\kappa(X) = 1, 10.5 at 10210^2, 512 at 10410^4, 3.2⋅1043.2 \cdot 10^4 at 10610^6 and 6.3⋅1056.3 \cdot 10^5 at 10810^8 for Bartels and Stewart; for the Kronecker system 4.6⋅1064.6 \cdot 10^6 at the far end. The worst single solves overstate by 3.2⋅1063.2 \cdot 10^6 and 9.3⋅1069.3 \cdot 10^6. The prediction asked for a factor of ten.

The two numbers in the product describe different directions. The backward error is the size of the most economical perturbation, and the earlier essay found where that perturbation lands: almost entirely on CC, along the directions where XX is small, because ΔA X\Delta A\,X and X ΔBX\,\Delta B both pass through XX and cannot reach there cheaply. The condition number is the response to the least economical perturbation of the same size, a change in AA along the direction P−1P^{-1} amplifies most. Multiplying them supposes that the cheapest perturbation is also the most damaging one. Here it is close to the least damaging, and the product is wrong by the ratio between the two directions’ effects — six decades at the corner of the family.

The residual’s estimate

At C = 10⁻⁶ X, against κ(X): the forward error of the computed X, the relative residual times the unstructured condition number, and the structured backward error times the structured condition number, for Bartels and Stewart's solution (solid) and the Kronecker system's (dashed)Bartels–Stewart, forward error: 8.97·10⁻⁹, 2.51·10⁻⁹, 1.81·10⁻⁹, 1.47·10⁻⁹, 1.24·10⁻⁹; Bartels–Stewart, residual × unstructured: 1.06·10⁻⁸, 7.26·10⁻⁹, 6.15·10⁻⁹, 5.73·10⁻⁹, 5.21·10⁻⁹; Bartels–Stewart, backward error × structured: 1.06·10⁻⁸, 2.65·10⁻⁸, 9.25·10⁻⁷, 4.65·10⁻⁵, 7.78·10⁻⁴; Kronecker system, forward error: 3.86·10⁻¹⁰, 3.06·10⁻¹⁰, 4.17·10⁻¹⁰, 4.47·10⁻¹⁰, 4.56·10⁻¹⁰; Kronecker system, residual × unstructured: 1.51·10⁻⁹, 1.34·10⁻⁹, 1.27·10⁻⁹, 1.54·10⁻⁹, 1.5·10⁻⁹; Kronecker system, backward error × structured: 1.51·10⁻⁹, 2.27·10⁻⁸, 8.25·10⁻⁷, 6.39·10⁻⁵, 0.00208, at κ(X) from 1 to 10⁸; medians over three bases.10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²κ(X), on a logarithmic scalerelative error, or its estimate10⁰10²10⁴10⁶10⁸forward errorresidual × unstructuredbackward error × structuredsolid: Bartels–Stewart · dashed: Kroneckerthe residual knows the error; the backward error does not
Fig. 3 At the size of C on the dial, against κ(X): the forward error of the computed X, the relative residual times the unstructured condition number, and the structured backward error times the structured condition number, for Bartels and Stewart’s solution (solid) and the Kronecker system’s (dashed).

The other estimate needs nothing structured at all. The forward error is P−1P^{-1} applied to the residual: vec⁡(X^−X)=P−1vec⁡(R)\operatorname{vec}(\hat X - X) = P^{-1}\operatorname{vec}(R) exactly, with R=C−AX^−X^BR = C - A\hat X - \hat X B, by linearity, whatever perturbation of the data anybody imagines produced X^\hat X. So ∥X^−X∥\|\hat X - X\| is at most ∥R∥/sep⁡(A,B)\|R\|/\operatorname{sep}(A, B), and dividing by ∥X∥\|X\| and writing the residual relative to its own scale (α+β)∥X∥+γ(\alpha + \beta)\|X\| + \gamma gives the relative residual times ((α+β)∥X∥+γ)/(sep⁡ ∥X∥)((\alpha + \beta)\|X\| + \gamma)/(\operatorname{sep}\,\|X\|) — the unstructured condition number, which for this family is 55.6, 2,860, 2.86⋅1052.86 \cdot 10^5 and 2.86⋅1072.86 \cdot 10^7 at the four sizes of CC and does not depend on XX’s conditioning at all.

That estimate is within a factor of 0.96 to 9.65 of the forward error on all 120 solves. At C=10−6XC = 10^{-6}X with Bartels and Stewart it is 1.2, 2.9, 3.4, 3.9 and 4.2 times the error across the κ(X)\kappa(X) sweep, and 3.0 to 4.4 for the Kronecker system. Drag the dial up through the sizes of CC and the three curves of the figure behave the same way at every level: the forward error and the residual’s estimate run together, flat across κ(X)\kappa(X), and the backward error’s estimate leaves them as XX grows ill conditioned, by more the smaller CC is. At C=0.5XC = 0.5X all three of Bartels and Stewart’s lie within a factor of six.

Every one of 120 Sylvester solves: the relative residual times the unstructured condition number, against the forward error of the computed X against the exact one, on logarithmic axes, coloured by the size of C, with equality and ten times itC = 0.5 X: errors 7.5·10⁻¹⁶ to 2.3·10⁻¹⁴, estimates 1.9·10⁻¹⁵ to 2.7·10⁻¹⁴; C = 10⁻² X: errors 3.4·10⁻¹⁴ to 1.5·10⁻¹², estimates 1.1·10⁻¹³ to 1.7·10⁻¹²; C = 10⁻⁴ X: errors 1.4·10⁻¹² to 1.3·10⁻¹⁰, estimates 8.8·10⁻¹² to 1.8·10⁻¹⁰; C = 10⁻⁶ X: errors 2.2·10⁻¹⁰ to 1.1·10⁻⁸, estimates 8.7·10⁻¹⁰ to 1.4·10⁻⁸.10⁻¹⁵10⁻¹⁴10⁻¹³10⁻¹²10⁻¹¹10⁻¹⁰10⁻⁹10⁻⁸10⁻¹⁵10⁻¹⁴10⁻¹³10⁻¹²10⁻¹¹10⁻¹⁰10⁻⁹10⁻⁸forward error against the exact Xresidual × unstructured condition numberC = 0.5 XC = 10⁻² XC = 10⁻⁴ XC = 10⁻⁶ Xdashed: equality · dotted: ten timesseven decades of error, one band
Fig. 4 Every one of the 120 solves: the relative residual times the unstructured condition number, against the forward error of the computed X against the exact one, on logarithmic axes, coloured by the size of C, with equality and ten times it.

Plotted directly, error against estimate, the 120 solves make one band seven decades long. The errors run from 7.5⋅10−167.5 \cdot 10^{-16} at C=0.5XC = 0.5X to 1.1⋅10−81.1 \cdot 10^{-8} at C=10−6XC = 10^{-6}X, each size of CC a cluster two decades further along, and every cluster sits between equality and ten times it. The conditioning of XX, which moved the backward error’s estimate by six decades, moves points only within their cluster. That is what an estimate is for: a reader handed only the residual and sep⁡(A,B)\operatorname{sep}(A, B), knowing nothing about how XX was built or which route computed it, could place the error within a decade on every one of these equations.

Bracketing an error nobody can measure put two computable numbers either side of an error that could not be computed directly, and asked how far apart they had to be. Here the error can be computed — the family has an exact XX — and the residual’s estimate sits above it by a factor between one and ten on every solve, which is as tight a single computable number as a reader could ask for. The structured product sits above it too, always, and is useless for the same purpose, because a bound that can be a million times too large says nothing about the error it bounds.

It is not quite a bound, since the residual’s own size is rounded and the inverse’s action is not always at its worst, and the lowest of the 120 sits at 0.96. But it is an estimate in the sense the prediction wanted: it says what the error is, to within a factor of ten, on every equation of a family built to make the backward error say something else.

The smaller residual, the worse estimate

At C = 10⁻⁶X, each first-order estimate of the forward error over the error itself against κ(X), for Bartels and Stewart's solution (solid) and the Kronecker system's (dashed): the structured backward error times its condition number, and the residual times the unstructured oneBartels–Stewart, backward error's estimate: 1.18, 10.5, 512, 3.17·10⁴, 6.29·10⁵; Bartels–Stewart, residual's estimate: 1.18, 2.89, 3.4, 3.91, 4.21; Kronecker system, backward error's estimate: 3.91, 74.1, 1981, 1.43·10⁵, 4.56·10⁶; Kronecker system, residual's estimate: 3.91, 4.36, 3.05, 3.44, 3.29, medians over three bases.110¹10²10³10⁴10⁵10⁶10⁷κ(X), on a logarithmic scaleestimate ÷ forward error10⁰10²10⁴10⁶10⁸the backward error'sthe residual'sdashed: Kroneckerdashed line: an estimate equal to the errorthe smaller residual, the worse estimate
Fig. 5 At C = 10⁻⁶X, each first-order estimate of the forward error over the error itself against κ(X), for Bartels and Stewart’s solution (solid) and the Kronecker system’s (dashed).

The two routes rank differently, and the earlier essay found the reason. The Kronecker system’s residual is about four times smaller than Bartels and Stewart’s, and its backward error is larger wherever κ(X)≥106\kappa(X) \ge 10^6 and CC is small, because more of its residual lies where only CC can reach. The backward error’s estimate therefore does worse on the route with the smaller residual — 4.6⋅1064.6 \cdot 10^6 times the error against 6.3⋅1056.3 \cdot 10^5 at the far corner — while the residual’s estimate ranks them correctly: the Kronecker system’s forward error is smaller, and so is its residual. A reader choosing between the two routes by their backward errors would choose the less accurate one at every κ(X)\kappa(X) from 10610^6 up; choosing by their residuals they would choose the more accurate one everywhere.

What the earlier explanation got right

The earlier essay’s account of why the forward error did not move was half right. It said that the backward error’s perturbation “lies on CC along the directions where XX is small, and moving CC in those directions moves the answer only in those directions, where it is small to begin with”. That is a statement about a direction, and it is true. What does not follow is that a condition number captures it, because a normwise condition number is a supremum over directions and cannot know which direction a particular backward perturbation took. A condition number that did know would be a function of the residual — it would have to be told where the perturbation lies — and at that point it is simpler to apply P−1P^{-1} to the residual and skip the backward error altogether.

A condition number sent to infinity met the same shape in an interior-point method: a matrix driven deliberately toward singularity, a normwise condition number heading off without limit, and an answer that kept its digits because the errors the factorisation made lay in directions the answer was not sensitive to. The normwise number there was a supremum over directions the computation never visited. The structured condition number here is the same kind of object, and the only cure in both places is to look at the direction the error actually took — which, for a linear equation, is what applying the inverse to the residual does.

A small residual is not a small error is the site’s warning against reading a residual as an answer’s accuracy, and it stands: the residual here is 10−1610^{-16} relative and the error 10−910^{-9}, seven decades apart, because the residual has to be multiplied by a condition number of 2.9⋅1072.9 \cdot 10^{7}. What this family adds is that the multiplication is honest. The residual, times the one condition number that does not depend on anything but AA and BB, is the error to within a factor of ten. It is the backward error, the quantity that is supposed to be the more meaningful one, that needs a second number to translate it, and that second number is wrong by up to six decades.

When the backward error is still the right question

None of this makes the structured backward error a bad measure. It answers a question about the data, not the answer: whether the computed XX is the exact solution of an equation whose coefficients are within their own uncertainty of the given ones. If AA, BB and CC come from measurement, that is the question that decides whether the computation added anything to what the data already allowed, and the exact answer to a nearby problem is the long argument for asking it. On this family it says that Bartels and Stewart’s XX needs a perturbation of 3.9⋅10−113.9 \cdot 10^{-11} — far more than rounding — to be exact, and that is true and worth knowing about the algorithm.

Cost points the same way. The residual’s estimate needs the residual, which costs two matrix products, and sep⁡(A,B)\operatorname{sep}(A, B), the smallest singular value of the Kronecker matrix, which is itself expensive to compute exactly and is in practice estimated from the Schur forms both routes already have. The structured product needs the backward error — a minimum-norm solve with an n2×3n2n^2 \times 3n^2 matrix — and the structured condition number on top. The cheaper number is the better one.

What it does not do is predict the error, and the measurement shows the gap is not a constant to be calibrated but a function of the problem: a factor of one on a well-conditioned XX and of millions on a badly conditioned one with a small right-hand side. A condition number scaling cannot move found Skeel’s componentwise number smaller than the normwise one by an amount that depends on the matrix in the same way; there the smaller number was the one that told the truth, and the same is true here of the residual’s estimate against the structured product.

What eight-by-eight equations do not show

One family, built so that XX commutes with AA and CC is exactly δX\delta X. In a family where XX does not commute — the earlier essay’s other open prediction, still untested — the backward error’s perturbation need not lie so cleanly on CC, and the product could be much closer to the error; the residual’s estimate does not depend on that. Order eight only, which makes P−1HP^{-1}H small enough to form; at realistic orders the structured condition number is estimated rather than computed, and an estimate of a supremum can only be looser. And the forward errors are measured against an XX that is exact by construction, which a real application does not have.

Still open: a family that does not commute, and a residual for the Schur route

Not commuting. The earlier essay’s prediction for a non-commuting XX still stands: with XX replaced by a random matrix of the same singular values, the backward error over the residual at κ(X)=108\kappa(X) = 10^8 and C=10−6XC = 10^{-6}X falls below a thousand on both routes. This essay adds a prediction with a sign about the estimates: there the structured product overstates the forward error by less than a hundred on every equation, while the residual’s estimate stays within ten — so that the gap measured here is a property of the commuting family’s geometry, not of structured estimates in general.

A residual for the Schur route that costs nothing. Bartels and Stewart solve a triangular equation SY+YT=FSY + YT = F in the Schur bases, and its residual there is available without forming AX^A\hat X. The prediction is that that residual, rotated back, is within a factor of two of the true residual on every equation here, so that the residual’s estimate of the error can be had for the price of the solve itself.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Backward errorCondition numberForward errorKronecker productMatrix equationResidualStructured perturbation