Research question
In a hypothetical relationship the slope is 0.60 for the first 60 months and 0.10 for the next 60. What do a full-sample regression, a rolling window and a break test each show? This article uses 120 simulated months to explain rolling analysis and structural change. The data are generated with seed 20261031 and are not real data.
Data
| Item | Value |
|---|---|
| Sample | 120 months |
| Frequency | monthly |
| Generating slope | 0.60 in months 1–60; 0.10 in months 61–120 |
| Full-sample regression | b = 0.34 (SE 0.07), R² = 0.16, r = 0.40 |
| First 60 months | b = 0.54 (SE 0.11), R² = 0.30, r = 0.54 |
| Last 60 months | b = 0.20 (SE 0.09), R² = 0.07, r = 0.27 |
| 24-month rolling correlation | 97 windows, range -0.19 to 0.71 |
| 24-month rolling slope | range -0.15 to 0.83 |
| Known-break F test | F(2,116) = 2.8, p = 0.065 (not rejected at 5%) |
| First 60 months used to predict the last 60 | out-of-sample R² = -0.13 (benchmark: training-period mean) |
| License | simulated data, no external license |
In N(mu,sigma) the second parameter is the standard deviation, not the variance (this model uses 1, 0.5 and 1 in turn). x and y are monthly teaching series in arbitrary simulated units (dimensionless); a slope reads as the change in y per one-unit change in x, and the rolling statistics are computed on 24-month windows within the 120-month sample.
Method and assumptions
Rolling analysis re-estimates parameters at each point using the most recent W observations, producing a path of coefficients or correlations; shorter windows track change but are noisier. Structural change means the parameters shift at some date. With a known break, the residual sums of squares of the pooled sample and the two subsamples can be compared in an F statistic; the unrestricted model has two intercepts and two slopes, so the numerator degrees of freedom are 2 and the denominator degrees of freedom are 120 − 4 = 116. With an unknown break, Andrews (1993) computes the statistic for every candidate date and takes the supremum, whose distribution is nonstandard. R² is not model validation: residual plots reveal drift and non-constant variance (NIST 4.4.4).
Results
The full-sample slope is 0.34, apparently a moderate positive relationship. Split by regime, the first 60 months give 0.54 and the last 60 give 0.20: the second regime is clearly weaker yet still above its designed 0.10. The known-break test gives F(2,116) = 2.8 with p = 0.065, so constant parameters are not rejected at the 5% level but are at 10%. The 24-month rolling correlation ranges from -0.19 to 0.71 and the rolling slope from -0.15 to 0.83; reporting only the 0.71 window would overstate both the strength and the stability of the relationship. Using the first-60-month model to predict the last 60 months gives an out-of-sample R² of -0.13 against the training-period mean benchmark, worse than using the mean. Every figure above comes from one run of npm run sim:rolling-structure with seed 20261031, and npm run check:sim compares the body against the script output. Re-running over the 400 seeds starting at 20261031 gives a full-sample slope averaging 0.35 (95% range 0.18-0.51), an F statistic averaging 6.71 (range 0.88-15.54) and an out-of-sample R² averaging -0.38 (range -1.19 to 0.11). This draw sits at the low end, so with 60 plus 60 months and noise comparable to the break, the test has power but an unstable one: failing to reject is not evidence that nothing changed.
Robustness
- Windows of 18 or 36 months make the path noisier or smoother, but the coefficient still falls after the break.
- Robust standard errors or rank correlations leave the subsample difference in place; the exact values change.
- Use a supremum test when the break date is unknown and an F test when it is known; if the date was chosen by data mining, the critical values need adjustment.
- Check whether a subsample is driven by a few observations, and report every window length and break-selection rule.
Limitations
The simulated break is exogenous and abrupt; real structural change may be gradual, repeated, or coincide with a change in volatility. Rolling windows have endpoint effects, and both window length and break date affect the conclusion. A detected break does not explain its cause and should not be treated as a policy or institutional change on its own. Extrapolating to a later period goes beyond the observed range (OpenStax 12.5).
Reproduction
- Generate 120 months of x and the two-regime slope with the fixed seed 20261031 (
npm run sim:rolling-structure). - Estimate the full-sample and two subsample regressions.
- Compute 24-month rolling correlations and slopes.
- Run the known-break F test and predict the last 60 months from the first 60.
- Report the window length, the break-selection rule and all subsamples.
seed = 20261031
lvl[0] = 0
lvl[t] = 0.5*lvl[t-1] + N(0,1)
x[t] = lvl[t] + N(0,0.5)
b = 0.60 (t <= 60), 0.10 (t > 60)
y[t] = 0.2 + b*x[t] + N(0,1)
rolling window = 24
F test, break = 60, df = (2,116)
per month draw order: lvl innovation, then x noise, then y noise
Strength of conclusions
In the simulation the parameters really do change (designed at 0.60 and 0.10): the full-sample coefficient mixes two regimes, the rolling path is unstable and the out-of-sample forecast fails, while this draw of the F test does not reject constant parameters at 5% - a power limit, not evidence that nothing changed. These are descriptive results. Real breaks need institutional context, and a statistical break alone does not establish causation.
Related
- Required prerequisite: Trends, Nonstationarity and Spurious Regression (RES-016), Leads, Lags and Forecasting (RES-017).
- Related reading: Introduction to Linear Regression (RES-013), Trends, Nonstationarity and Spurious Regression (RES-016), Leads, Lags and Forecasting (RES-017).
Figures in plain language
The three figures below check the mechanism, boundary and comparison in this article; labels come from its own sections, not new data.
Exercises
- Why is the full-sample slope of 0.34 below the first-regime 0.54?
- What does a wide range of rolling correlations indicate?
- How do known-break and unknown-break tests differ?
Suggested answers
- The full sample pools both regimes, so the near-zero second slope pulls the average down; the weights also depend on the variance of x in each regime.
- The relationship changes over time; a single full-sample correlation hides the instability, and the window choice affects what is seen.
- A known break allows a direct comparison of subsample residuals; an unknown break takes the maximum over candidate dates, with larger critical values and a nonstandard distribution.
Sources
- Andrews, Donald W. K. “Tests for Parameter Instability and Structural Change with Unknown Change Point.” Econometrica 61, no. 4 (1993): 821–856. License unknown. https://ideas.repec.org/a/ecm/emetrp/v61y1993i4p821-56.html (accessed 2026-10-30)
- NIST/SEMATECH. e-Handbook of Statistical Methods, “4.4.4 How can I tell if a model fits my data?” U.S. Government work (public domain). https://www.itl.nist.gov/div898/handbook/pmd/section4/pmd44.htm (accessed 2026-10-30)
- OpenStax. Introductory Statistics 2e, “12.5 Prediction.” CC BY-NC-SA 4.0. https://openstax.org/books/introductory-statistics-2e/pages/12-5-prediction (accessed 2026-10-30)
Worked demo
Read-through check: can you say three things?
No recitation needed. Tick each sentence below and see whether you can explain the mechanism, one worked example and one boundary in your own words.
Ticked 0 / 3
The numbers are teaching assumptions that show relationships, not forecasts or investment advice.
This article has passed the current publication gate. Factual, calculation and translation revisions update both language versions together.