Bergmeir 2018 - Theorem 1 Validity of K-Fold CV for Autoregressive Models
Summary
Theorem 1 of Bergmeir, Hyndman & Koo says that for a stationary, ergodic, correctly specified nonlinear AR() model with a consistent leave-one-out estimator and martingale-difference errors, the leave-one-out CV estimate of mean squared prediction error, computed by deleting whole rows of the lag-embedded matrix, converges in probability to the true prediction error on an independent copy of the process. The same holds for K-fold CV. Serially uncorrelated errors are the load-bearing condition. A misspecified, underfitting model breaks it; an overfitting but flexible model does not.
Overview
The theorem formalises the heuristic of Bergmeir 2018 - Lag-Embedded K-Fold CV vs h-Block CV: if the residuals of the embedded regression are white, its rows behave like independent regression cases, and ordinary CV works. The authors use leave-one-out “without loss of generality” because “generalisation to the K-fold CV is straightforward” (p. 4). The proof is in Bergmeir 2018 - Proof of Theorem 1 and Lemma 1.
Main Content
Setup (§3, pp. 4-5)
Let be observations from a stationary process where each has distribution on .
Nonlinear regression form of the AR( ) model (§3, eq. (3), p. 4)
where is continuous and differentiable in for all , and is a regression error.
Estimator. with
Prediction error PE (§3, p. 5)
Let be another process with the same distribution as the sample , for example the future, with . Then
where solves the estimating equations
with . By construction has the same distribution as .
Leave-one-out CV estimator (§3, p. 5)
The training sample is and the test sample is . The entire row of matrix (2) for is left out. Then
where solves
obtained by differentiating .
Goal: should approximate PE closely.
Assumptions (§3, pp. 5-6)
Assumption A1: stationary nonlinear AR( ) process
The sequence is represented by the nonlinear AR() process (3). The process is stationary and ergodic.
Role: A1 fixes the model CV is applied to and “ensures that no misspecification is considered in our setup” (p. 6). The paper adds: “Note that (3) is a standard AR(p) process and our setup covers common applications of CV for dependent data” (p. 6). That is, the linear AR() model is the special case , and the authors present the nonlinear form as covering the usual uses of CV on dependent data. Under regularity conditions (Mokkadem 1988), is strong mixing:
- (a) for all , , any ;
- (b) .
Assumption A2: consistency of nonlinear least squares
is a consistent estimator of .
By stationarity, the conditions for consistency of and are equivalent. One sufficient set (following Andrews 1987):
- (i) the parameter space is a compact subset of ;
- (ii) is continuous and differentiable in for all ;
- (iii) uniformly in , where is a nonstochastic function with a unique minimum at .
Assumption A3: errors are a martingale difference sequence (MDS)
The disturbances satisfy:
- (i) is a martingale difference sequence, where is the sigma field generated by . I.i.d. errors are an MDS.
- (ii) and for some and .
- (iii) has an absolutely continuous distribution with respect to Lebesgue measure. This holds for the usual error distributions, including the normal.
Role: “A3.(i) ensures that errors are serially uncorrelated, which will be the key component for the success of the cross-validation” (p. 6).
Strength: A2 and A3 “are not strong assumptions but rather are standard ones, e.g., when Machine Learning methods are used for prediction” (p. 6).
Counterexample to A3: “errors with discrete values, say do not satisfy A3” (p. 6).
The theorem
Theorem 1 (§3, eq. (4), p. 6)
Suppose that Assumptions A1-A3 hold. Then
The same conclusion holds for K-fold CV over rows of the embedded matrix (the paper treats the extension as straightforward, p. 4).
Proof sketch (full version in Bergmeir 2018 - Proof of Theorem 1 and Lemma 1):
- Following Burman & Nolan (1992), write PE and each as a variance term, a squared-bias term and a noise term .
- The bias and noise terms agree asymptotically.
- The variance term of PE equals a diagonal sum plus an off-diagonal double sum .
- Because whole rows are left out and the errors are an MDS, the off-diagonal sum is a martingale whose normalised fourth moment vanishes (Lemma 1). So it converges to zero in probability, and the diagonal sum matches ‘s variance term.
When the assumptions fail (pp. 6-7)
The CV method “makes use of features of residuals”, so “residuals should emulate error terms for the success of this type of CV” (p. 6).
- A1 violated (misspecification). “The residuals will no longer have zero serial correlation. Then, the violation of A3 follows naturally since is no longer a MDS, which renders Lemma 1 in the appendix invalid. Therefore, the CV does not work any longer” (pp. 6-7).
- A2 violated (inconsistent estimator). The paper writes: “Because A2 ensures that approximates PE closely through consistency of the OLS estimator of φ, its violation invalidates the proposed CV not only for the dependent setup but also even for the independent setup” (p. 7).
Notation slip in the source (p. 7) nonlinear least squares for a generic parameter (A2 is titled "Consistency of the Nonlinear Least Squares", and solves the estimating equation ). "OLS" and "φ" belong to the linear AR() special case, where and NLS reduces to OLS. Read the sentence as "consistency of the least-squares estimator (and )". This is the vault's reading; the paper does not comment on it.
The sentence speaks of “the OLS estimator of φ”. The setup of §3 is
- A3 violated directly. The paper’s only explicit counterexample is discrete errors: “errors with discrete values, say do not satisfy A3” (p. 6), because they break A3(iii). It also implies that serially correlated errors break A3(i) (through the A1 discussion above).
- Vault inference, not stated in the paper: errors whose conditional variance changes with (conditional heteroskedasticity) break A3(ii)‘s , and heavy-tailed errors without a finite moment break A3(ii)‘s moment bound. In either case the Burkholder step of Lemma 1 loses its justification as written. Whether CV actually fails in those cases is not studied in the paper. (Note that a GARCH-type error is still an MDS, so A3(i) alone would survive.)
Scope of the result (§3, p. 7)
Provided the errors are serially uncorrelated, Theorem 1 covers linear or nonlinear parametric regression. Its validity “is extended to models considered ‘nonparametric’ such as regression splines, smoothing splines, locally polynomial regression, and neural networks, which can all be represented by (3)” (p. 7).
§4.4 (p. 9) adds that results “would not change much” for support vector regression or random forests. The argument concerns the residuals, whose features (zero mean, zero correlation) are universal across model families.
Overfitting vs underfitting: the asymmetry
Reading A1 and A3 together gives the paper’s practical message (pp. 2-3):
| Situation | A1 (correct spec.) | A3 (white errors) | CV status |
|---|---|---|---|
| Model equals the DGP | ✓ | ✓ | valid |
| Model nests the DGP (too many lags, flexible learner) | ✓ (true inside the class) | ✓ | valid. CV can detect the overfitting |
| Model approximates the DGP well (e.g. AR() for MA(1)) | approximately | approximately | works well empirically (Exp. 2) |
| Model underfits (missing seasonal lag, too few lags) | ✗ | ✗ (residual autocorrelation) | biased: CV underestimates error |
| Exogenous persistent regressors | outside eq. (3) | often ✗ | not covered. Use time-ordered evaluation |
The last row is not discussed in the paper. It is the vault’s extension, developed in Bergmeir 2018 - Conclusions, Decision Rule and Scope Limits.
Examples
Why underfitting breaks the MDS condition
Setup: the DGP is with i.i.d. , and the fitted model is AR(1): .
Step 1, the fit: the best AR(1) approximation has , so .
Step 2, the residuals: . The residuals are strongly autocorrelated at lag 12 and are not an MDS, so A3(i) fails.
Step 3, the leak: a test row at time sits next to training rows at (and others) whose errors are correlated with its own. The flexible fit partly absorbs this shared component, so the held-out error looks smaller than true out-of-sample error.
Result: CV is optimistic, as in Experiment 3 of Bergmeir 2018 - Monte Carlo Results for AR and MLP Forecasters (5-fold CV MPAE from to ). A Ljung-Box test on the pooled out-of-fold residuals at 20+ lags flags the problem.
Connections
- Cross Validation Checking: LOO-CV in the exchangeable setting; this theorem is its dependent-data analogue.
- Model Testing and Specification and Single Marketing Time Series: residual whiteness diagnostics that make A3 checkable.
- Model Selection and Overfitting: CV as a guard against overfitting. The theorem shows the guard stays valid for autoregressions.
- Spurious Regression and Nonsense Correlations: what happens with persistent exogenous regressors, which are outside eq. (3).
- Q - Exchangeability and What Replaces It When It Fails: the broader map of exchangeability failures.
See Also
- Bergmeir 2018 - Proof of Theorem 1 and Lemma 1: Appendix A.
- Bergmeir 2018 - Monte Carlo Results for AR and MLP Forecasters: empirical confirmation and the counterexample.
- Out-of-Sample Validation for Time-Series Models: what to do when the conditions fail.