Comparing two forecasters

Which forecast is better

Two forecasters, one series, and a difference in mean squared error. Whether that difference is real is a hypothesis test, its terms are not independent, and the standard error it needs is not the one a t-test computes.

Worth reading first: What the model says next · A p-value that is not flat is not a p-value.

The forecast field ends by ranking three forecasters. A fitted first-order model, the last value carried forward, and the sample mean are each run over the same series, their squared errors are averaged, and the smallest average wins. On fifty observations the fitted model wins over a band of persistence running from φ = 0.1186 to φ = 0.9231, and outside it one of the two things that estimate nothing wins instead.

Every number in that comparison is an average over a finite sample. Nothing in it says whether the winner would win again.

That is not a quibble about precision, it is a different question with its own machinery. Two forecasters have a difference in expected squared error, which is the quantity anybody cares about, and a difference in average squared error, which is what a comparison produces. Deciding whether the second is evidence about the first is a hypothesis test, and it turns out to be a test whose terms break the assumption that every test of a mean starts from.

The object is a difference, one per origin

Write the comparison down as it is actually run. Two forecasters produce a forecast at each of P origins, each origin yields two errors, and the whole comparison is the sequence

dₜ = e₁ₜ² − e₂ₜ²

one number per origin. The comparison says forecaster 1 is worse when the average of the dₜ is positive, and the test asks whether that average is far enough from zero to be worth reporting. The statistic is the one every test of a mean uses — the mean divided by its own standard error — and the whole of the argument below is about the denominator.

One comparison, and the two error bars it can be given. 60 rolling origins, a window of 60 observations, forecasts 4 steps ahead, at the persistence φ = 0.8256 where the two benchmarks have exactly equal population mean squared error. Each mark is one origin's difference in squared error; the horizontal line is their mean, 0.6522. The two vertical bars at the right are ±1.96 standard errors round that mean computed two ways — 0.5337 treating the differences as independent, 0.6880 allowing for the overlap between neighbouring forecasts. The null is true here by construction, so an interval that excludes zero is a mistake, and the narrow one does it far more often than the wide one.
Fig. 1 Sixty origins, and one number per origin: how much worse the first forecaster did than the second on that occasion. The horizontal line is their average. The two vertical bars are ±1.96 standard errors around that average, computed two different ways, and the picture is about the gap between them.

The two forecasters drawn there are the two that estimate no dynamics — the last observation carried forward, and the mean of the window. They are chosen for a reason that matters more than it looks: their comparison has an exactly true null available.

A null that is true by construction rather than approximately

Measuring how often a test rejects when it should not requires a situation where it should not. The usual way to get one is to set two things equal by fiat and hope the setup is otherwise fair. Here the equality can be solved for.

The last value carried forward has mean squared error 2γ₀(1 − φʰ) at horizon h, where γ₀ is the unconditional variance. The window mean has γ₀ multiplied by a longer expression, because that forecast carries its own sampling error and is correlated with the future it is forecasting — both terms are functions of φ and of the window length R, and dropping either puts the answer in the wrong place. Setting the two equal and solving for φʰ gives

φʰ = (1 − a) / (2(1 − b))

with a the variance of the window mean and b its correlation with the future, both of which depend on φ, so it is a fixed point rather than a formula: three iterations from φ = ½^(1/h), which is what the expression collapses to when the window is long enough for a and b to vanish. That limit is worth keeping. Two forecasts that estimate nothing are equally good when the series has forgotten half of itself over the horizon.

At a window of sixty the crossings are φ = 0.4922 at one step ahead, 0.6944 at two, 0.8256 at four and 0.9021 at eight. At those values the two forecasters have identical expected squared error to the last digit the arithmetic carries — the closed forms agree at 3.3634 at h = 4 — and a simulation that was never told the formula finds a mean difference of 0.0020 against a standard error of 0.0047. Every rejection rate below is measured at one of those four numbers, so a rejection is a false one by construction and not by approximation.

The differences are not independent, and the reason is arithmetic

At one step ahead the loss differentials look like what a t-test assumes: their lag-one correlation is −0.003, which is nothing.

The differences are correlated up to lag 0 and not past it. The autocorrelation of the loss differential between the two benchmark forecasts at horizon 1, averaged over undefined comparisons of 600 origins each, at the persistence φ = 0.4922 where the two forecasts are exactly equally good. Forecasts made h steps ahead from neighbouring origins are about overlapping futures, so their errors share 0 shocks and the differences carry that overlap: nothing, since one-step forecasts do not overlap at the lags inside the horizon. A t-test on these differences treats every one of them as fresh information.
Fig. 2 The autocorrelation of the loss differential at one step ahead. Nothing at any lag, which is what makes the naive test right here — and what makes it worth measuring rather than assuming.

At four steps ahead they are not. Forecasts made at neighbouring origins four steps ahead are about overlapping futures: the forecast made at origin t and the one made at t + 1 both have to survive the shocks that arrive between t + 2 and t + 4, and those are the same shocks. The errors share h − 1 of them, so the differences do too.

The differences are correlated up to lag 3 and not past it. The autocorrelation of the loss differential between the two benchmark forecasts at horizon 4, averaged over undefined comparisons of 600 origins each, at the persistence φ = 0.8256 where the two forecasts are exactly equally good. Forecasts made h steps ahead from neighbouring origins are about overlapping futures, so their errors share 3 shocks and the differences carry that overlap: 0.581, 0.299, 0.108 at the lags inside the horizon, and -0.016 at lag 4, where the theory says the correlation stops. A t-test on these differences treats every one of them as fresh information.
Fig. 3 The same measurement at four steps ahead: 0.584, 0.303, 0.115, and then nothing. The correlations stop exactly where the horizon says they stop, which is a prediction the picture is checking rather than an observation it is reporting.

The theory says the loss differential of h-step forecasts is a moving average of order h − 1 — that correlations run to lag h − 1 and vanish after it — and the measurement is 0.584, 0.303, 0.115 at lags one, two and three, and −0.011 at lag four. That is not approximately the prediction; it is the prediction, on a quantity nobody tuned.

The differences are correlated up to lag 1 and not past it. The autocorrelation of the loss differential between the two benchmark forecasts at horizon 2, averaged over undefined comparisons of 600 origins each, at the persistence φ = 0.6944 where the two forecasts are exactly equally good. Forecasts made h steps ahead from neighbouring origins are about overlapping futures, so their errors share 1 shocks and the differences carry that overlap: 0.309 at the lags inside the horizon, and -0.018 at lag 2, where the theory says the correlation stops. A t-test on these differences treats every one of them as fresh information.
Fig. 4 Two steps ahead: one correlation, at one lag, and nothing after it. The structure is not a complication that grows with the horizon in some unspecified way — it is a count of shared shocks.

What ignoring it costs, computed before it is counted

A mean of P terms with correlation ρ₁ … ρₖ has variance (γ₀/P)(1 + 2Σρₖ) rather than γ₀/P. Nothing in that sentence is about forecasting. It is the same arithmetic the dependence field uses to say that fifty correlated observations are worth about six, applied to a different sequence.

Put the measured correlations into it. At h = 4, 1 + 2(0.584 + 0.303 + 0.115) = 3.004, so a standard error that leaves the correlations out is too small by a factor of 1.733, the statistic is too large by the same factor, and a test that rejects outside ±1.96 is really rejecting outside ±1.13. The share of a standard normal outside that is 25.4%.

Counted, it is 25.7%.

The over-rejection is predicted before it is counted. Four horizons, 1500 comparisons at each, every one at the persistence where the two forecasts are exactly equally good. The upper curve is the share of true nulls a t-test rejects when it treats the differences as independent: 5.0% at h = 1, 13.5% at h = 2, 25.7% at h = 4, 44.2% at h = 8. The marks on it are what the arithmetic says before any of it is simulated — a mean of correlated terms has variance (1 + 2Σρ) times the independent one, so the standard error is too small by the square root of that and the rejection rate follows. The lower curve is the same test with the long-run variance estimated, which recovers most of the gap and not all of it.
Fig. 5 Four horizons, at the persistence where the two forecasts are exactly equally good in each. The upper curve is what a t-test that treats the differences as independent actually does; the open marks on it are what the autocorrelations predict, with no simulation anywhere in the prediction. The lower curve is the same test with the long-run variance estimated, and the dashed line is a test given the true variance of the mean.

The agreement is the point. The over-rejection is not a mysterious small-sample effect to be guarded against with a rule of thumb; it is a computable consequence of a known correlation structure, and its size follows from three numbers a comparison already contains.

At eight steps ahead the naive test rejects 44.2% of true nulls at a nominal 5%. A reader handed that comparison would be told that one forecaster beat the other with a p-value below 0.05, and would be right to conclude nothing at all.

One comparison, and the two error bars it can be given. 60 rolling origins, a window of 60 observations, forecasts 8 steps ahead, at the persistence φ = 0.9021 where the two benchmarks have exactly equal population mean squared error. Each mark is one origin's difference in squared error; the horizontal line is their mean, -0.9141. The two vertical bars at the right are ±1.96 standard errors round that mean computed two ways — 0.7432 treating the differences as independent, 1.2982 allowing for the overlap between neighbouring forecasts. The null is true here by construction, so an interval that excludes zero is a mistake, and the narrow one does it far more often than the wide one.
Fig. 6 Eight steps ahead, where seven of every eight shocks are shared between neighbouring origins. The sequence of differences has visible runs in it — stretches where one forecaster is ahead for a dozen origins together — and each run is one piece of information wearing a dozen coats. The two error bars are now a factor of two apart.

One construction detail carries more weight than it looks. Both forecasts at every origin are made from the same window, and the difference is taken within the origin rather than between two averages computed separately. Pairing that way removes everything the two forecasters have in common — the shock that arrives after the origin hits both of them, and cancels — so what is left in dₜ is only the difference in how they handled the information they shared.

Lining the two error sequences up differently, which is what happens when one forecaster’s file starts at a different date, puts that common noise back. Measured over four hundred comparisons: the standard error of the mean difference goes from 0.2437 to 0.3295, a factor of 1.35, and the rejection rate from 7.2% to 2.0% — without a single forecast changing.

The repair, and the part of it that does not go away

The repair is to estimate the variance of the mean rather than assume it: add the autocovariances back, weighted, up to some bandwidth. That is the standard construction and it does most of the job.

Five denominators for one statistic, at 4 steps ahead1500 comparisons of 60 origins at the persistence where the two forecasts are exactly equally good, so every rejection here is a false one. The same mean difference is divided by five different standard errors. Treating the differences as independent rejects 26.5% of the time where 5% is claimed; truncating the long-run variance at h − 1 lags — the textbook prescription — brings it to 11.6%; the small-sample correction leaves 10.5%; and a test given the true variance of the mean rejects 4.7%. The gap between the last two is the estimator's own bias, and it does not close with more origins.the differences independent26.5%long-run, h − 1 lags11.6%long-run, weighted13.5%long-run, small-sample corrected10.5%the variance known4.7%5%, which all five claim1500 comparisons of 60 origins, h = 4, φ = 0.825626.5% down to 4.7%
Fig. 7 Five denominators for one statistic at four steps ahead, on the same three thousand comparisons. Treating the differences as independent, truncating at h − 1 lags, weighting them, correcting for the small sample — and, at the bottom, dividing by the true variance of the mean, which is not a test anybody can run and is what says the null here is exactly true.

The five rows are worth reading in order. The naive test rejects 26.4%. Truncating the long-run variance at h − 1 lags — the textbook prescription, and now visibly the right bandwidth rather than a convention — brings it to 10.7%. The weighted version gives 12.7% and the small-sample correction with a t reference 9.8%. And a test handed the true variance of the mean rejects 4.9%, which is 5% to within the standard error of the count.

So the correlations account for the whole of the null being true, and the estimator accounts for the rest of the failure. The residue is the denominator’s own bias. A long-run variance estimated from the same sixty numbers whose mean is being tested is biased low — it must be, since it is a sum of estimated autocovariances each shrunk towards zero by the estimation of the mean — and a denominator that is 10% too small on average turns a 5% test into a 10% one. That does not improve with more origins in the way the naive test’s failure does not improve at all: it shrinks slowly, and it is still there when the comparison has four hundred origins in it.

The p-values say the same thing one level down, which is the check that a rejection rate cannot make. The naive test’s p-values sit 0.278 from flat by the Kolmogorov–Smirnov distance; the corrected test’s, 0.094; and a test with the right denominator would be at the sampling noise of three thousand draws.

The inflation has a closed form in the horizon

The over-rejection at h = 4 is predicted above from three measured autocorrelations, and the autocorrelations themselves can be predicted, which turns the whole horizon curve into one expression.

An h-step forecast error is a sum of h shocks and neighbouring origins share h − k of them at lag k. For Gaussian errors the covariance of two squared errors is twice the square of their covariance, so

ρₖ = ((h − k)/h)²

which at h = 4 gives 0.5625, 0.2500 and 0.0625 against the counted 0.584, 0.303 and 0.115 — the same shape, a little low, the shortfall being that a loss differential is not a single squared error. Summing it, Σ((h − k)/h)² = (h − 1)(2h − 1)/(6h), so the naive standard error is too small by

√( 1 + (h − 1)(2h − 1)/(3h) )

which is 1 at one step, 1.225 at two, 1.658 at four and 2.318 at eight, against the 1.733 the measured correlations give at h = 4. Pushing those through a normal predicts naive rejection rates of 5.0%, 11.0%, 24.0% and 39.8%, against counted values of 5.2%, — , 26.4% and 44.2%.

Two things follow that the single measured horizon cannot say. The expression grows like √(2h/3) for large h, so the naive test’s size approaches one as the horizon lengthens rather than settling at some tolerable level — at twenty steps the inflation is 3.7 and the size is about 60%, and at fifty it is 5.8 and 74%. And it says the whole curve without any comparison being run, so an evaluation can know before it starts how much of its own reported significance is overlap.

The expression is also the right bandwidth argument, stated as arithmetic rather than as a convention. The correlations it gives are exactly zero past lag h − 1 and positive before it, which is what a truncation at h − 1 lags is for; and they fall as the square of the shared fraction, which is why the first lag carries most of the correction — at h = 8 the first lag alone is 0.766 of the sum’s leading term and the last three together are under a tenth of it.

And the effective count is not P over h

The essay reads sixty origins at horizon four as “about fifteen independent comparisons”, which is P/h and is the count of non-overlapping windows. The variance arithmetic gives a different and larger number: P/(1 + 2Σρₖ) = 60/3.004 = 20.

The gap is real and in the useful direction. Non-overlapping windows throw away every partially overlapping origin; the effective sample size keeps the fraction of each that is new. At h = 4 that is worth a third more information than the non-overlap count admits, and by the closed form above the ratio tends to 3/2 as the horizon grows — the effective count settles at 3P/(2h) rather than P/h.

So a forecaster choosing between overlapping and non-overlapping evaluation is not choosing between a biased standard error and an honest one. Overlapping origins with the right denominator carry half again as much as non-overlapping ones, and the only thing wrong with them is the denominator.

The repair is not free where there was nothing to repair

The advice in circulation is unconditional: use a long-run variance when comparing forecasts. At one step ahead there is no overlap, the differences are uncorrelated, and estimating a long-run variance means estimating several autocovariances that are zero and adding their noise to the denominator.

Five denominators for one statistic, at 1 step ahead. 1500 comparisons of 60 origins at the persistence where the two forecasts are exactly equally good, so every rejection here is a false one. The same mean difference is divided by five different standard errors. Treating the differences as independent rejects 5.3% of the time where 5% is claimed; truncating the long-run variance at h − 1 lags — the textbook prescription — brings it to 5.6%; the small-sample correction leaves 7.0%; and a test given the true variance of the mean rejects 4.6%. The gap between the last two is the estimator's own bias, and it does not close with more origins.
Fig. 8 The same five rows one step ahead. The naive test is right — 5.2% at a nominal 5% — and the two long-run versions over-reject, at 7.0% and 6.3%, because they are estimating a correction that is not needed out of the same sixty numbers.

Two points of size, bought for nothing. It is a small cost and it is in the same direction as the failure it was meant to fix, which is worth stating plainly: the standard repair is a repair at horizons past one and a mild defect at horizon one, and which of those applies is decided by the horizon rather than by preference.

What the test can find when there is something to find

A rejection rate at the crossing is the test’s size. Everywhere else it is power, and the two are the same measurement taken at different truths.

What the test finds, away from the point where there is nothing to find. The corrected test's rejection rate across the persistence of the series, 900 comparisons at each point, with the horizon fixed at 1 and 60 origins. The vertical line is the φ at which the two benchmarks are exactly equally good, solved from the autocovariances; there the rejection rate is the test's size and everywhere else it is power. The curve is not symmetric about that point, because moving right makes the last value a better forecast at an accelerating rate while moving left makes the mean better slowly — which is a fact about the two forecasts rather than about the test.
Fig. 9 The corrected test’s rejection rate across the persistence of the series, at one step ahead and sixty origins. The vertical line is the φ where the two forecasters are exactly equally good; there the curve is at 5.4%, and everywhere else it is the chance of noticing a difference that exists.

At φ = 0.9 the last value carried forward is much the better forecast and the test finds it 93.0% of the time. At φ = 0.6, one tenth of the way from the crossing, it finds it 11.0% of the time. The curve is not symmetric about the crossing, and the asymmetry is a fact about the two forecasters rather than about the test: moving right makes the last value better at an accelerating rate, and moving left improves the mean slowly.

Sixty origins at horizon four contain about fifteen independent comparisons, and that is the quantity power is a function of. The effective number of comparisons, not the number of rows in the table, is what a forecast evaluation has to report — which is the dependence field’s effective sample size arriving from a third direction.

That has a practical consequence worth separating from the arithmetic. Lengthening the evaluation window buys power at the usual rate only while the added origins are contributing something new; past the point where the horizon is a large fraction of the window, each new origin brings h − 1 shocks already counted. Two evaluations reporting “two hundred out-of-sample forecasts” can carry two hundred and twenty-five pieces of information respectively, and nothing in the phrase distinguishes them.

What is claimed here, and what is not

This field takes forecast comparison as a testing problem: the loss differential, the variance of its mean, the reference distribution, and the nested case the next essay is about. The forecast field named it as explicitly not claimed when it was written, and it is claimed now.

What stays out and is named as a decision rather than an oversight: comparisons of more than two forecasters at once, which is a multiplicity problem this site has a field for and which needs a reference distribution over the whole set of comparisons rather than over one; forecast combination as a subject, though the arithmetic that makes an equal-weight average beat both its parts is measured in the forecast field; loss functions other than squared error, where the same construction runs with a different dₜ and every number changes; and forecast encompassing, which asks a different question about the same pair.

The boundary against the exact-inference field is worth stating. That field builds a reference distribution by re-running the mechanism that assigned the data. Nothing here can: the mechanism that generated the series is the thing being estimated, so the reference distribution has to come from an asymptotic argument, and the whole content of this essay is that the argument has an assumption in it that the practice does not carry a warning about.

The checks, and the refusal that makes them mean something

Four claims are gated in this field’s library. The crossing solved from the autocovariances is the crossing a simulation finds, and the closed forms agree to nine decimals while the simulation agrees to its own noise. The correlations of the loss differential are required to be large inside the horizon and small past it, at two horizons. The counted over-rejection is required to match the rate the correlations predict, to within three points, with no simulation in the prediction. And the oracle test — the one handed the true variance — is required to be exact, because if it were not, every other number in the essay would be measuring the setup rather than the test.

The refusal is a comparison whose two error sequences are not paired by origin. It is the mistake a rolling comparison makes easy — two files that start at different dates line up without complaint — and the standard it fails is that a paired comparison’s standard error is a property of the two forecasters rather than of how their files were aligned. It inflates it by 35%, and the check requires that failure, because a check that has never rejected anything proves nothing.

What links here

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

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.

AutocorrelationBenchmark forecastDiebold–MarianoEffective sample sizeError rateForecast errorForecast horizonLong-run varianceLoss differentialMean squared errorMonte CarloNull hypothesisp-valueUniformity