Two errors, and whose fault they are

The zero you are allowed to write

A deflation criterion sets a subdiagonal entry to zero because it is small. A drop tolerance discards an entry of a factor because it is small. A truncation discards a singular value because it is small. Three fields, three vocabularies, no shared arithmetic — and plotted as work saved against error accepted, one curve.

Worth reading first: The exact answer to a nearby problem · The algorithm the libraries actually run · Changing the condition number on purpose.

Every essay in this collection’s current run has been about a quantity going to zero on its own: a divisor vanishing, a curvature changing sign, an eigenvalue leaving for infinity, a determinant that was identically zero before anybody looked.

This one is about the other half, and it is the half a program actually contains. A zero is never met in floating point. It is declared. Every one of those events reaches the code as a comparison against a constant, and somebody chose the constant.

Three of them, in three vocabularies

The deflation criterion. The QR algorithm splits its problem when a subdiagonal entry is small compared with its neighbours, and continues on the smaller block. Deflation is what makes the whole algorithm affordable — without it every iteration would cost the full n² however much had already converged — and it works by writing a zero into a matrix entry that is not zero.

The drop tolerance. An incomplete factorisation keeps a factor sparse by discarding entries that are small. The exact factor of a sparse matrix is not sparse — the fill is the subject of a whole field here — so an incomplete one keeps a chosen subset, and the entries not kept are set to zero.

The truncation. A low-rank approximation keeps the k largest singular values and discards the rest, which is setting n − k singular values to zero — and the best approximation there is prices exactly that.

Error of the best rank-k approximation to a 10×10 matrixApproximation error against k on a logarithmic axis for a 10×10 matrix, with the measured error and the next singular value drawn as separate curves lying exactly on top of one another — they agree to better than 1 part in 10⁹ at all 9 values of k. The nearest of thirty random rank-3 matrices misses the SVD's rank-3 error by a factor of 969.12345678910⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1rank k of the approximation‖A − Aₖ‖measured, 2-normσₖ₊₁, from theorymeasured, Frobeniusthe first two agreeto 4.3·10⁻⁹worst |‖A−Aₖ‖₂ − σₖ₊₁| / σₖ₊₁4.3·10⁻⁹worst Frobenius discrepancy4.3·10⁻⁹κ = 10⁹; 30 random rank-3 matrices, none closerthe error is σₖ₊₁
Fig. 1 And the theorem that prices it exactly: the error of the best rank-k approximation is the next singular value.

What they have in common

Each of them is a perturbation of the problem, chosen deliberately.

The deflated matrix is not the matrix that was handed over; it differs from it by whatever was written into that subdiagonal entry. The incomplete factor is the exact factor of nothing; ‖A − LLᵀ‖ is what was discarded and it is not rounding. The truncated matrix is not the matrix; it differs by σₖ₊₁.

So all three are backward errors that somebody chose, in a subject where every other backward error is something the arithmetic did. And that reframing is what makes them comparable, because a backward error is a backward error whatever produced it.

The other axis is what the choice bought: iterations not taken, entries not stored, storage not used.

Which of them is the odd one out

Before the comparison, one distinction that the comparison would otherwise flatten.

Two of the three tolerances are chosen by a library author and one is chosen by the caller. The deflation criterion is buried in an eigensolver — a caller can rarely reach it and would not know what to set it to. The drop tolerance is an argument to every incomplete factorisation routine there is, with a default the caller usually keeps. The truncation is entirely the caller’s: choosing a rank is what a low-rank approximation is.

That is a distinction about visibility rather than about mathematics, and the mathematics is what this essay compares. It matters afterwards, though, because it says where the finding is actionable. A caller who understands that a rank is a decision and that the decision is a backward error can price it; a caller who understands that a deflation criterion is one has learned something about a number they cannot change.

What they can do with it is read a result differently. An eigenvalue returned by a library is the exact eigenvalue of a matrix perturbed by the deflation criterion as well as by the rounding, and the first of those is usually the larger — which is the exact answer to a nearby problem with the nearness set by a constant rather than by the arithmetic.

One curve

Sweeping each tolerance over its useful range and plotting the fraction of the work not done against the relative backward error accepted:

  • deflation criterion: from 6.7·10⁻¹³ of error and no saving, to 6.6·10⁻² of error and 55 per cent of the iterations not taken;
  • drop tolerance: from the unit roundoff and no saving, to 0.43 of error and 90 per cent of the factor’s entries not stored;
  • truncation: from 6.2·10⁻⁹ and a negative saving, to 7.8·10⁻² and 75 per cent of the storage not used.

Fitted slopes, in fraction of the work saved per decade of error accepted: 0.039, 0.051 and 0.225. Three fields, no shared arithmetic, no shared vocabulary, and the widest pair of those is a factor of 5.7 apart.

Nothing is rescaled to make that happen. The two quantities are defined the same way for all three because they are the same two quantities, and the agreement is what comes out.

The negative end nobody plots

The low-rank curve goes below zero at the tight end, and that is worth a sentence because it is the part of the trade that gets left off.

A symmetric n×n matrix is n(n+1)/2 numbers. A symmetric rank-k factored form is k(n+1). So the factored form costs more than the matrix once k passes n/2, and at a tolerance tight enough to keep most of the spectrum the “low-rank approximation” is a more expensive object than the thing it approximates.

Every plot of approximation error against rank stops before that point. It is not wrong to stop there — nobody would use a rank-37 approximation of a 40×40 matrix — but the omission is what makes the trade look like a free lunch at the tight end rather than a bad deal.

Why the slopes are not identical, and why that is the right result

A factor of six between the slopes is not agreement to three digits, and reading it as one would be overclaiming.

What the three share is the sign and the order of magnitude: in each field, one decade of accepted error buys somewhere between four and twenty-two per cent of the work. What differs is how much structure each problem has for the tolerance to exploit.

The truncation slope is the steepest because a decaying spectrum is the most compressible thing on the list — one decade of tolerance discards many singular values when the decay is geometric. The deflation slope is the shallowest because the subdiagonal entries the criterion is testing are falling quadratically once convergence starts, so a decade of tolerance moves the deflation point by only a step or two.

Both of those are statements about the problem. Which is the useful form of the finding: the trade exists in every field, its slope is set by how much structure the particular problem has, and neither of those facts is visible from inside any one of the three vocabularies.

A fourth, which does not fit

It is worth naming one tolerance that belongs to the same family and is not on the curve, because the reason it is not is instructive.

The stopping tolerance of an iterative solver looks like the others: a constant, compared against a residual, deciding when to stop. It is not a backward error somebody chose, though. Stopping early does not perturb the problem — it returns an approximate answer to the exact problem, which is a forward error, and a small residual is not a small error is the essay about how far apart those can be, and the whole point of the site’s error identity is that those are different positions.

The distinction has a consequence that is easy to state and easy to get wrong. Loosening a drop tolerance changes the preconditioner and not the answer; loosening a stopping tolerance changes the answer and not the problem; loosening a deflation criterion changes the problem. Three constants that a caller meets in the same routine, in the same units, doing three different things to the error identity.

Conjugate gradients on an ill-posed problem at 1.0% noiseTwo curves against the step count on a logarithmic vertical axis. The relative residual falls at every one of the 120 steps without exception. The error against the true signal falls to 0.1426 at step 20 and then climbs, reaching 6.02 by the end — 42.2 times its best value.015304560759010512010⁻²10⁻¹110¹steprelative sizeleast error: 20discrepancy stop: 7errorresidualthe knob is an integerleast error, at step20error there0.14error at step 1206the residual falls at every stepthe error turns and keeps rising
Fig. 2 And the case where stopping early is not an approximation but the answer: an iteration whose error turns round while its residual keeps falling.

The knee, which is the only thing anybody actually wants

A trade curve is used by looking for its knee — the place where more error stops buying much work, or more work stops buying much error — and the three curves here have one in the same place for the same reason.

The fourth case has a knee of a different kind, and sweeping it prices the whole question. Where the tolerances above are offers, semiconvergence is a curve with a minimum in it: the error falls, reaches a best value, and then rises without limit.

Conjugate gradients on an ill-posed problem at 0.10% noiseTwo curves against the step count on a logarithmic vertical axis. The relative residual falls at every one of the 120 steps without exception. The error against the true signal falls to 0.1050 at step 44 and then climbs, reaching 0.56 by the end — 5.3 times its best value.015304560759010512010⁻³10⁻²10⁻¹1steprelative sizeleast error: 44discrepancy stop: 27errorresidualthe knob is an integerleast error, at step44error there0.11error at step 1200.56the residual falls at every stepthe error turns and keeps rising
Fig. 3 Noise 0.001. The error is least at step 44, at 0.1050, and by step 120 it has risen to 0.56 — 5.3 times worse than the best available.
Conjugate gradients on an ill-posed problem at 0.30% noiseTwo curves against the step count on a logarithmic vertical axis. The relative residual falls at every one of the 120 steps without exception. The error against the true signal falls to 0.1146 at step 32 and then climbs, reaching 1.81 by the end — 15.8 times its best value.015304560759010512010⁻²10⁻¹1steprelative sizeleast error: 32discrepancy stop: 16errorresidualthe knob is an integerleast error, at step32error there0.11error at step 1201.8the residual falls at every stepthe error turns and keeps rising
Fig. 4 Noise 0.003: least at step 32, at 0.1146, and 15.8 times worse by step 120.

The best achievable error is almost flat and the penalty for missing it is not. Across noise of 0.001, 0.003, 0.03, 0.05, 0.1 and 0.2 — a factor of two hundred — the best error moves only 0.1050, 0.1146, 0.1523, 0.1562, 0.1675, 0.1918, a factor of 1.8. Over the same range the cost of running to step 120 instead of stopping goes 5.3, 15.8, 118.9, 193.8, 361.5 and 631 times the best.

Conjugate gradients on an ill-posed problem at 3.0% noiseTwo curves against the step count on a logarithmic vertical axis. The relative residual falls at every one of the 120 steps without exception. The error against the true signal falls to 0.1523 at step 7 and then climbs, reaching 18.1 by the end — 118.9 times its best value.015304560759010512010⁻¹110¹steprelative sizeleast error: 7discrepancy stop: 4errorresidualthe knob is an integerleast error, at step7error there0.15error at step 12018the residual falls at every stepthe error turns and keeps rising
Fig. 5 Noise 0.03: least at step 7, and 118.9 times worse by 120.
Conjugate gradients on an ill-posed problem at 10% noiseTwo curves against the step count on a logarithmic vertical axis. The relative residual falls at every one of the 120 steps without exception. The error against the true signal falls to 0.1675 at step 3 and then climbs, reaching 60.5 by the end — 361.5 times its best value.015304560759010512010⁻¹110¹10²steprelative sizeleast error: 3discrepancy stop: 3errorresidualthe knob is an integerleast error, at step3error there0.17error at step 12061the residual falls at every stepthe error turns and keeps rising
Fig. 6 Noise 0.1: least at step 3, at 0.1675, and 361.5 times worse by 120.

So two hundred times more noise costs under a factor of two in the answer, provided the stopping step is right — and the step that is right moves from 44 to 2 across the same range. Nearly all of the available accuracy is decided by when to stop rather than by how good the data was, which inverts the intuition that a noisier problem is a worse-answered one.

Conjugate gradients on an ill-posed problem at 5.0% noiseTwo curves against the step count on a logarithmic vertical axis. The relative residual falls at every one of the 120 steps without exception. The error against the true signal falls to 0.1562 at step 5 and then climbs, reaching 30.3 by the end — 193.8 times its best value.015304560759010512010⁻¹110¹steprelative sizeleast error: 5discrepancy stop: 3errorresidualthe knob is an integerleast error, at step5error there0.16error at step 12030the residual falls at every stepthe error turns and keeps rising
Fig. 7 Noise 0.05: least at step 5, 193.8 times worse by 120.
Conjugate gradients on an ill-posed problem at 20% noiseTwo curves against the step count on a logarithmic vertical axis. The relative residual falls at every one of the 120 steps without exception. The error against the true signal falls to 0.1918 at step 2 and then climbs, reaching 121 by the end — 631.1 times its best value.015304560759010512010⁻¹110¹10²steprelative sizeleast error: 2discrepancy stop: 2errorresidualthe knob is an integerleast error, at step2error there0.19error at step 120121the residual falls at every stepthe error turns and keeps rising
Fig. 8 And noise 0.2, where the best is at step 2 and step 120 is 631 times worse.

The rule that is actually used stops too early, consistently, and by a knowable amount. The discrepancy principle halts at steps 27, 16, 4, 3, 3 and 2 against optima of 44, 32, 7, 5, 3 and 2 — short by 39%, 50%, 43% and 40% at the four lower noise levels, and exact at the two highest. It is therefore safe in the direction that matters, since the curve is far steeper to the right of its minimum than to the left, and it is leaving real accuracy on the table on exactly the problems where the most is available.

That asymmetry is the reason the rule survives being wrong by half. Stopping ten steps early on the 0.001 curve costs a few per cent; stopping ten steps late costs a factor. A rule tuned to the midpoint of its own error bar would be worse than one biased low, and the discrepancy principle is biased low by construction rather than by accident.

The three curves look, on the figure, as though they flatten below about 10⁻¹⁰ and steepen above about 10⁻³, with the useful band the four decades in between. That reads as a reassuring result, and it is the one claim in this essay that a picture makes and a number does not support.

Where each curve actually starts buying

Take the error at which each trade first buys five per cent of its work, and the error at which it reaches half:

                 five per cent      half
deflation          1.1·10⁻¹⁴      1.5·10⁻³
drop               3.5·10⁻⁵       8.1·10⁻³
truncation         6.1·10⁻⁵       6.0·10⁻³

The onsets are nine orders apart. Deflation is not flat below 10⁻¹⁰ at all: it has bought 21% of its iterations at an accepted error of 6.7·10⁻¹³ and 9% at 1.2·10⁻¹⁴, both of which are inside the region the paragraph above calls flat, and roughly two fifths of everything it ever buys is bought below 10⁻¹⁰. The other two are flat well past 10⁻¹⁰ — the drop curve is still at 0.4% of its entries at an accepted error of 3.8·10⁻⁷.

So of the three, none has its onset near 10⁻¹⁰. One is ten thousand times tighter and two are five thousand times looser, and the four-decade band is not a shared feature; it is the range the figure’s axis happens to cover.

The truncation curve has a second problem the band conceals, which the negative-end section above already names: its saving is negative for its first four points and crosses zero only at 6.1·10⁻⁵. Its useful range therefore begins two decades above where the essay’s band ends the flat region, and the part of the curve inside the supposedly-useful band is the part where the factored form costs more than the matrix.

What the three do agree about

The halfway points: 1.5·10⁻³, 8.1·10⁻³ and 6.0·10⁻³, which sit inside a factor of five of each other. The curves agree about where the work is mostly gone and not about where it starts being bought, and those are different claims with different consequences.

The second is the one a defaults argument needs. If the three onsets were together, a library author in any of the three fields could reason about a tolerance by analogy with another field’s. They are nine orders apart, so nobody can: a deflation criterion at the drop tolerance’s onset would deflate nothing, and a drop tolerance at the deflation criterion’s would store the exact factor. What is shared is the shape — a flat region, a rise, a steep end — and the shape is what the three vocabularies have in common. Where the features sit on the axis is a property of each problem, which is what the differing slopes already said and what the knee claim would have contradicted.

Where the defaults came from

The three defaults do all sit somewhere on the useful part of their own curve, which is worth asking about even though — per the section above — those parts are not the same band. The answers are unrelated.

The deflation criterion in every implementation descended from the original QR algorithm — whose shifts are never formed either — is a small multiple of the unit roundoff times the sum of two neighbouring diagonal entries. That form has a reason: it makes the perturbation relatively small compared with the local scale, so a deflation does not damage a small eigenvalue in a matrix with a large one. It was chosen to be as tight as it could be while still firing, which puts it at the flat left end of its curve.

The drop tolerance’s usual default of 10⁻³ or 10⁻⁴ came from a different argument entirely: it is what was found, empirically, to produce a factor that fits in memory while still preconditioning usefully. That is a statement about the other axis — the work — and it was tuned by watching iteration counts rather than accuracy.

The truncation rank is usually chosen by a caller from a plot of singular values, by eye, at a visible gap or a visible knee. That is neither axis; it is a judgement about the data.

Three constants arrived at by three arguments — tightness, memory, and a picture — each landing on the part of its own curve where the trade is live rather than in the flat region or past the damage. That is the modest cheerful result at the centre of this essay, and it is smaller than the version that had all three landing in one band: what the three communities got right is each its own curve, independently, and there is no evidence that they got a shared one.

The distinction matters because only the smaller claim is defensible from the measurement. Three defaults on three curves is three separate pieces of good judgement, which is what one would hope for. Three defaults in one band would have been a coincidence worth explaining, and there is no coincidence to explain.

What this is not

Two things it would be easy to take from the above and should not be.

It is not that the three tolerances are interchangeable. They perturb different objects and the perturbations propagate differently. A deflation criterion’s error enters as a perturbation of the matrix whose eigenvalues are wanted, so it is amplified by the eigenvalue conditioning. A drop tolerance’s error enters as a perturbation of a preconditioner, which affects the rate and not the answer — the iteration converges to the solution of the original system whatever the preconditioner is. A truncation’s error enters as a perturbation of the answer itself, with no amplification at all.

Three positions in the error identity, and only the first of them is amplified by a condition number.

The condition number a sketched preconditioner leaves, against the condition number it was givenTwo curves against κ(A), both axes logarithmic. The matrix's own condition number climbs the diagonal from 100 to 10¹⁰; κ(AR⁻¹), where R comes from a QR of a 2n-row sketch, is 6.1286 at every one of them — the same number to ten digits, not a similar one. The reason is two lines of algebra: with G = SU the preconditioned singular values are those of (GᵀG)⁻¹, which has no spectrum of A in it at all.10²10⁴10⁶10⁸10¹⁰110²10⁴10⁶10⁸10¹⁰condition number of the matrixcondition number seen by the iterationκ(A), unchangedκ(AR⁻¹)a bound with no κ(A) in itκ(AR⁻¹), every κ(A)6.1κ(SU), the other route6.1κ(A), across the sweep10⁸κ(AR⁻¹), across the sweep1the sketch never sees the spectrumand the spectrum cancels out of the answer
Fig. 9 And the reason the middle one is the mild case: a preconditioner changes the rate, not the fixed point.

And it is not an argument for tuning them. The flat left end of every curve says that tightening a tolerance below the knee costs work and buys nothing measurable, and the steep right end says loosening it past the knee buys work and costs the answer. The defaults are in the band. The value of the picture is understanding what kind of quantity is being chosen, not choosing it differently.

What the rest of this site does with the same idea

There is a fourth instance on this site that is not a tolerance and is the same trade, and it is worth finishing on because it makes the shape general rather than particular to a comparison.

Every mixed-precision result in this collection is a point on this curve. Computing a preconditioner at three significand bits rather than fifty-three is accepting a backward error in the preconditioner — a large one — in exchange for work not done. The essays that measured it found the preconditioner roundable to three bits and the residual not roundable at all, which is the same statement as the distinction above: the preconditioner’s error is in the mild position of the error identity and the residual’s is not.

So the general form of what this essay has been about:

Any decision to compute something less exactly than possible is a backward error accepted in exchange for work not done, and it can be plotted. Precision, sparsity, rank, deflation, and the whole of iterative refinement are the same trade in different units, and a code contains dozens of them that were each chosen by somebody looking at one of them alone.

Preconditioned conjugate gradients with one part of it roundedIteration count against significand bits, on the 100-unknown model problem. Rounding the preconditioner's output takes the count from 18 to 35 and leaves the answer correct to 8.8·10⁻¹³ throughout. Rounding the working arithmetic instead leaves the count at 18–300 and takes the answer to 0.159. The horizontal line is the 39 steps the unpreconditioned method takes.21018263442500102030405060708090100110120130140150160170180190200210220230240250260270280290300310320330340significand bitsiterationspreconditioner roundedarithmetic roundedno preconditionersame bits, different casualtyerror, 3-bit preconditioner8.8·10⁻¹³error, 3-bit arithmetic0.16‖A − LLᵀ‖/‖A‖ of the factor0.083a direction may be roundeda measurement may not
Fig. 10 The measurement that made that concrete on this site: which parts of a solver may be rounded and which may not, and how far apart the two answers are.

The refusal

The assertion is fed a drop tolerance of one.

At that value every off-diagonal entry of the incomplete factor is discarded, so LLᵀ is diagonal and the “incomplete factorisation” is a scaling. On the model problem the diagonal is constant, so the preconditioner is a multiple of the identity and buys exactly nothing: the preconditioned iteration takes the same number of steps as the unpreconditioned one.

A trade curve that reported it as an ordinary point would be reporting a preconditioner that does not precondition, at a plausible-looking place on the axis, with a backward error of 0.43 that looks like the honest right-hand end of a sweep. The refusal is what keeps the last point on a curve from being a different kind of object from the rest of it.

What is next

Every tolerance in this essay is an offer: accept this much error, save this much work, and the trade is monotone in both directions so there is no way to be wrong about it except by choosing a point nobody wanted.

The last essay is about the other kind, where both directions are failures — where the constant does not buy anything, it decides which of several true answers the computation returns, and at a low enough precision it produces a proof of something false from a comparison that was performed correctly.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

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 errorDeflationDrop toleranceEckart–YoungIncomplete factorisationLow-rank approximationPreconditioningThe QR algorithmTolerance