Simulated Nulls · Breakpoint

Did the Level Shift?

Searching for the year a series changed runs many tests at once. Simulate the search in null worlds to see how large a shift has to look before it is unusual in a world without one.

Simulate the Search

The test statistic is now the largest \(|t|\) over every split with at least 10 years on each side. Simulate series with no shift, search each one the same way, and see how often the largest \(|t|\) is at least as large as the observed one.

Data
Null world

Largest \(|t|\) of every simulated series

This Test's Choices

  • Test statistic: the largest \(|t|\) over every split with at least 10 years on each side, which for 100 years is 81 splits.
  • Null model: no shift, and either
    • shuffled years: the series' own values in a random order; or
    • Gaussian years: each year an independent Gaussian draw with the series' mean and standard deviation.
  • Alternative hypothesis: a shift up or down at some unknown year, so large values of the largest \(|t|\) count against the null.

In series of 100 independent Gaussian years with no shift, the best split's \(t\)-test gives p < 0.05 in 40% of series, and each of these is a false alarm: a p below 0.05 when the null is true. The cutoff for one split, \(|t| =\) 1.98, is far too low for the largest of 81. (Neighboring splits share most of their years, so the 81 tests overlap; 81 independent tests would give at least one p below 0.05 in 98% of series.) To keep false alarms at 5%, the largest \(|t|\) has to exceed about 3.0. For the series above, the simulated p-value is about 0.11, not 0.009.

The largest \(|t|\) doesn't change when every value is shifted or rescaled, so Gaussian years with any mean and standard deviation give the same null distribution: one simulation serves every series of the same length.

For a split after year \(k\) of \(n\), with segment means \(\bar y_{1:k}\) and \(\bar y_{k+1:n}\) and pooled standard deviation \[s_k = \sqrt{\frac{\sum_{i \leq k} (y_i - \bar y_{1:k})^2 + \sum_{i > k} (y_i - \bar y_{k+1:n})^2}{n - 2}},\] \[t_k = \frac{\bar y_{k+1:n} - \bar y_{1:k}}{s_k \sqrt{1/k + 1/(n-k)}}, \qquad t_{\max} = \max_{10 \leq k \leq n - 10} |t_k|.\] For one split fixed in advance, \(t_k\) has a \(t_{n-2}\) distribution in the Gaussian null world. \(t_{\max}\) has no such simple distribution.

Formulas for the Search

Formulas exist for this maximum. The largest \(t^2\) is the sup-\(F\) statistic of Andrews (1993), who gave its large-sample critical values, and Hansen (1997) gave p-values; both depend on how many years are excluded at each end. With 10% excluded at each end, Andrews' corrected tables (Andrews 2003) give a 5% cutoff of about 3.02 for the largest \(|t|\). Simulating Gaussian series gives 3.00 for 100 years and 3.03 for 2,000. Simulation gives the p-value for the record length, the minimum segment and the statistic at hand without a table, and the same steps work for a statistic no table covers.

The Nile

Choose "Nile at Aswan" in the figure. The Nile's annual flow at Aswan drops after 1898: the mean is about 1,098 × 108 m³ for 1871–1898 and 850 × 108 m³ for 1899–1970, and the largest \(|t|\) is 8.71. None of 200,000 shuffled series reached it, so the simulated p-value is below 0.0001. The drop coincides with the building of the first Aswan dam (1898–1902), although the flows alone can't show what caused it. If a split year had been fixed from the dam's history before looking at the flows, the \(t\)-test for that one split would be a valid test. Choosing 1898 because the plot drops there is a search.

Bootstrap and Permutation Tests

"Shuffled years" is a permutation test, and "Gaussian years" is a parametric bootstrap test from the no-shift fit. The shuffle assumes that, with no shift, the years are exchangeable: their order carries no information. Gaussian years go further and treat the years as independent draws. Once its shift is removed, the Nile's flow in one year is only weakly correlated with the next year's (correlation 0.16, against 0.51 before the shift is removed), so the shift, not persistence from year to year, accounts for most of the raw series' correlation. For a series with stronger persistence, a block bootstrap keeps it in the null world: it resamples blocks of consecutive years from the deviations around the two segment means.