A fit wins where the steps were few
Worth reading first: The problem that arrives again · A warm start is degree zero.
A computation that solves the same kind of problem again and again, each member a small step along a parameter from the last, can start each solve from a guess built out of the answers it already has. The problem that arrives again listed the stored answers among the things a sequence carries from member to member, and the order a batch arrives in found that they are worth most when neighbouring members are neighbours in the parameter. A warm start is degree zero found that the previous answer is a poor guess and the line through the last two a very good one, thirteen times cheaper in inner steps. A straight path has nothing for a parabola to fit found why the parabola through the last three did not do better still: the path was straight, so the line was exact, and the parabola paid its larger amplification of the stored answers’ error for nothing. Bend the path and the parabola wins at tight tolerances. The degree the history chooses then priced the choice between them: over thirty runs of bend and tolerance, always taking the line costs 456 inner steps more than the better of the two, and always taking the parabola costs 33.
All of those starts are interpolants. The line passes through the last two answers and the parabola through the last three, so each uses as few stored answers as its degree allows, and each carries whatever error those answers hold straight into the guess. The obvious alternative uses more of them. A straight line fitted by least squares to the last five answers does not pass through any of them, and so averages their errors rather than extrapolating them.
That is a trade, and it is the trade every smoothing method makes. A fit through more points amplifies noise less and misses a curve by more. This essay measures the trade exactly — both halves of it have closed forms — and then measures where on this family of sequences each half wins. The answer is lopsided in a way the closed forms do not show: the fits win on the runs that were cheap anyway, and lose on the runs where the steps are.
Every start is a fixed combination of stored answers
Suppose the last m answers are stored at parameter values one drift step apart, and the next is wanted one step further on. Put the most recent answer at 0 and the earlier ones at . Fit a polynomial of degree d to them by least squares and evaluate it at . Because the fit is linear in the data, the result is a fixed combination of the stored answers, and the weights depend only on d and m.
For the interpolants these are the familiar coefficients: for the line through two, and for the parabola through three. For the least-squares line through three answers the weights are ; through four, ; through five, . Every set sums to one, which is what makes a constant path come out exact; every line reproduces a straight path exactly, and every parabola a quadratic one.
Two numbers describe each set completely for the question at hand.
The amplification is the Euclidean norm of the weights. If every stored answer carries an independent error of size ν, the start carries an error of about . For the line through two that is ; for the line fitted to five it is 1.05. For the parabola through three it is , and for the parabola fitted to six, 1.79.
The truncation constant is how far the start misses a path that is one degree too curved for it. For a line that is a quadratic path, for a parabola a cubic one, and the constant is measured in units of that path’s second or third difference. The line through two misses a quadratic by 2; fitted to three, by 3.33; to four, by 5; to five, by 7. The parabola through three misses a cubic by 6; fitted to four, by 10.5; to five, by 16.8; to six, by 25.2.
Each extra stored answer moves a point up and to the left: less amplification, more truncation. The interpolants sit at the bottom right of their curves. For the lines the trade is steep at first — going from two answers to three cuts the amplification by a third for two-thirds more truncation — and flattens after. For the parabolas it is the same shape at larger numbers, and fitting a parabola to six answers brings its amplification below the line through two.
This is the same arithmetic as a smoothing filter, and the same trade choosing without knowing made with a regularisation parameter: a smaller variance paid for with a larger bias. What the figure cannot say is which half matters on a real sequence, because that depends on how large the stored error is against how curved the path is — and the stored error is set by the solve tolerance, while the curvature is set by the problem.
On a straight path every fit wins
The sequence is the one the earlier essays measured. Each member is a nonlinear system of 120 unknowns — a symmetric positive definite matrix with condition number plus a small cubic term — whose exact root moves with the parameter t along a known path. It is solved by a chord iteration that keeps one Cholesky factor for four members, as a factorisation kept past its date found worthwhile, and stops when the relative residual falls below the tolerance. Twenty members are walked at a drift of 0.02. The path is for two fixed random directions, so is a straight path and larger c bends it.
On the straight path the line fitted to five is the cheapest start at every tolerance. At it takes 4 inner steps over the twenty members against the line through two’s 11; at , 8 against 12; at , 12 against 17. The parabola fitted to six beats the parabola through three by a similar margin, 15 against 23 at , and beats even the line through two, whose amplification it undercuts.
On this path the fits have nothing to lose. A straight path has no second difference, so every line is exact and the truncation constant multiplies zero. What is left is the stored error, and every fit amplifies it less.
It does not amplify it less by as much as the coefficient norms promise. The median start of the line fitted to five is 0.57 times as far from the root as the line through two’s at , where the norms predict 0.47, and at it is only a fifth closer. The norms assume the stored errors are independent, and they are not: every member is started from an extrapolation of the ones before, stopped at the same tolerance, and solved with the same factor for four members at a time, so neighbouring errors share a direction. A fit averages independent errors down and correlated ones much less.
On a bent path the truncation constant is the whole story
Turn the dial to a bend of and the order reverses at tight tolerances. At the parabola through three takes 75 steps, the parabola fitted to six 92, the line through two 105 and the line fitted to five 115.
The distance of each start from the root says why, and says it exactly.
At loose tolerances the four lines follow the tolerance down, and there the fits are closer: at the line fitted to three starts at against the line through two’s . The step counts at that tolerance do not follow the medians — 13 steps for the line through two and 20 for the fit to three — and nothing here explains why; the median leaves out the first few members, where a fit has not yet stored enough answers and starts from the line instead. From on all four go flat, each at its own floor, and the floors are , , and . Their ratios to the first are 1.67, 2.50 and 3.46. The ratios of the truncation constants are , and . Below each line’s start is its truncation error and nothing else, and the constant computed from the weights predicts where the floor lies to two figures.
The parabolas behave the same way one derivative up. Their floors at a bend of are , , and , in ratios 1.68, 2.42 and 4.0 against the constants’ 1.75, 2.8 and 4.2. The agreement is looser because the path has a fourth derivative as well, which the cubic constant does not account for.
Once a start sits on its floor, tightening the tolerance adds inner steps in proportion to the number of digits between the floor and the tolerance, and a floor 3.5 times higher costs roughly half a digit’s worth of steps on every member. That is the whole of the fits’ loss on a bent path: they trade a reduction in the amplification, which no longer matters once the stored error is far below the floor, for an increase in the truncation, which is the floor.
Which start is best, cell by cell
Lines and parabolas each through or fitted to up to six answers make eight fixed starts. On each of thirty runs — six bends from 0 to and five tolerances from to — one of them is cheapest.
A least-squares fit is the best start in fourteen of the thirty cells, and they form one corner of the map: every cell of the straight path, and the loose-tolerance cells of the bent ones. There the stored error is at least comparable with the truncation error, and a start that averages it wins. Which fit wins moves with the bend in the way the trade figure predicts. On the straight path it is a line through four or five. With a slight bend it becomes a parabola, through five or six at a bend of , because a line fitted to many points on a bent path has a large truncation constant and a parabola has none at second order.
In the other sixteen cells the parabola through three is the best start, and adding answers to the parabola never helps — 75, 80, 87, 92 steps at a bend of and , in order of the answers used.
The brackets in the fit corner are small. The largest saving anywhere is eight steps, on the straight path at , where the line through two takes 17 and the line fitted to four 9. The fourteen savings add to 58 steps.
The totals, and why the corner is cheap
Summed over the grid, no fixed start beats the parabola through three, at 1,245 steps. The fitted parabolas take 1,283, 1,367 and 1,382; the lines take 1,669 through two and 1,705 to 1,772 fitted. Every fit is worse in total than the interpolant of its own degree. The better of the two interpolants chosen per run — the target the previous essay’s rules were chasing — takes 1,212. The best of all eight chosen per run takes 1,154.
So a rule that could pick any of the eight starts perfectly on every run would improve on a perfect choice between the two interpolants by 58 steps in 1,212, under five per cent. The previous essay’s cheapest imperfect rule already came within 11 steps of 1,212, and its residual rule matched it on 29 runs in 30 for 135 steps’ worth of residual evaluations.
The asymmetry is in where the steps are. The cells a fit wins are the cells where the start is limited by stored error, and the stored error is limited by the tolerance, so the start is already close: those runs take between 4 and 24 steps. The cells an interpolant wins are the cells where the start is limited by the path’s curvature at a tight tolerance, and those take between 24 and 133 steps. A fit saves a fraction of a small number and costs a fraction of a large one. Ten of the fourteen fit cells save five steps or fewer, from runs of twenty-four steps or fewer; the most expensive run on the grid, 133 steps, is one where adding a sixth answer to the parabola would cost 17 more.
The same trade in other places
The trade itself is not special to extrapolation. A basis built from the points fitted polynomials to noisy data and found that the fit moves with the noise by an amount set by the basis and the points, which is the same amplification factor seen from the other side. The answer the last window left found a sliding least-squares window whose natural warm start — the previous window’s answer — was three orders worse than a fresh solve on a stream with any noise in it; there too the stored answer carried an error that the next problem could not use.
What this family adds is the asymmetry between the two halves. Which half wins depends on a ratio of stored error to curvature, and the cost of losing depends on the curvature alone. A method that minimises the expected distance of the start from the root — which is what a smoothing fit does — is optimising the wrong quantity when the cost is the logarithm of that distance summed over runs of very different lengths.
What a code should do
Keep the interpolants and choose between them, as the previous essay’s rules do. The parabola through three is the right default when nothing is known about the path; the line through two is the better choice on a path close to straight, and the previous essay’s free rule is built to detect those runs.
A least-squares fit is worth considering only where both conditions hold: the path is close enough to straight that its curvature is below the stored error, and the tolerance is loose enough that the stored error is the limit. In that corner, fitting a line to four or five answers roughly halves the steps. But those are runs of ten steps or fewer over twenty members, and a code that took the fit everywhere would pay for it many times over on the runs that matter.
What this rests on
One family of nonlinear sequences with 120 unknowns and a condition number of ; a chord iteration with a factor kept for four members; twenty members at a drift of 0.02; bends with c from 0 to ; tolerances from to ; lines and parabolas through or fitted to at most six stored answers, at equal parameter spacing. The amplification and truncation constants are exact for equally spaced points. The step counts are deterministic for a given run. Unequal spacing, weighted fits, and higher degrees are not measured.
The claim that has to fail
The claim is that the least-squares line through five answers is the better start because it amplifies stored error less than the line through two. Over the thirty runs it takes 1,772 inner steps against the line through two’s 1,669. The refusal is fed the claim that the fitted line takes fewer, and fails.
Still open: fits in the rule, weights that decay, and correlated error
A residual rule over better candidates. The previous essay’s residual rule chose between the line through two and the parabola through three. The map above suggests a better pair on this family: the line fitted to four or five and the parabola through three, which between them hold or come within a step of the best start in 25 of the 30 cells. Whether a residual rule over that pair reaches the best-of-eight total of 1,154, and whether the free rule’s threshold still means anything when one candidate is a fit, is one sweep of the same grid.
Weights that decay with age. A least-squares fit counts the oldest stored answer as heavily as the newest, which is where its truncation constant comes from. A weighted fit whose weights fall with age sits between the interpolant and the flat fit on the trade figure, and could be tuned to the stored error if the stored error were known — which the last correction of each member estimates for free.
The correlation. On the straight path the fits help less than their coefficient norms predict, and the explanation offered is that the stored errors are correlated from member to member. Measuring that correlation directly — the error of each stored answer against the error of the one before — would say how much of the amplification figure survives contact with a real sequence, and whether a rebuilt factorisation, which starts a fresh chord iteration, breaks it.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A tolerance that reads its own residual — both name flop count, newton iteration, stopping criterion, warm start
- What a rebuild is worth — both name cholesky factorisation, flop count, stopping criterion, warm start
- A guess worth two per cent — both name flop count, newton iteration, warm start
- One line that buys a quarter of the run — both name flop count, newton iteration, stopping criterion
- The accuracy worth paying for — both name backward error, flop count, stopping criterion
- The penalty for keeping it is a ratio — both name cholesky factorisation, flop count, warm start
Named objects
A flat tag is an object no other essay names yet.
Backward errorCholesky factorisationExtrapolationFlop countLeast-squaresNewton iterationStopping criterionWarm start