Jorge Quitério Search
Mathematics

Searching for cycles in 150 years of Rhine discharge

Annual river flows are often expected to contain cycles. Three independent methods, the periodogram, autoregressive models and wavelets, agree that the annual flow of the Rhine at Basel is consistent with white noise. A simulation shows how convincing apparent cycles in pure noise can be.

People tend to perceive patterns in irregular data, including apparent cycles in river flows.

One dataset in my statistical modelling course was the annual mean flow of the Rhine at Basel from 1807 to 1956: 150 years, averaging about 1,026 cubic metres per second. Rivers are driven by weather, and weather has seasons and oscillations, so it is natural to expect a cycle. Over two assignments I searched for one with three different families of methods. All three reached the same conclusion: the series contains no predictable structure.

This article explains how to test for a cycle, why a null result is legitimate and useful, and shows how apparent cycles arise in pure noise.

The question has practical consequences. Barges on the Rhine are loaded according to the water level, and in the dry autumns of 2018 and 2022 many vessels could carry only part of their usual cargo. Hydropower operators and flood planners depend on the flow in the same way. If annual flows followed a seven-year cycle, a shipping company could anticipate the next dry year and plan its fleet accordingly. If they do not, a plan built on a supposed cycle prepares for the wrong years.

The relevant literature is as follows.

Fisher (1929) derived an exact test for the largest peak of a periodogram under white noise, the first rigorous test of whether a periodogram peak indicates a real cycle.

Priestley (1981) is the standard reference for spectral analysis, including the smoothing of periodograms with lag windows (Bartlett, Tukey-Hanning, Parzen).

Akaike (1974) proposed the information criterion now used to choose the order of autoregressive models, and Ljung and Box (1978) the portmanteau test for leftover autocorrelation.

Torrence and Compo (1998) wrote the practical guide to wavelet analysis with significance testing, and Percival and Walden (2000) the reference on the maximal-overlap discrete wavelet transform.

Zhang (2003) proposed hybrid models in which a neural network learns what an ARIMA model leaves in its residuals.

Method 1: the periodogram

A periodogram decomposes a series into sine waves and measures how much variance each frequency carries. A real cycle appears as a peak that is much larger than the others.

The largest Rhine peaks sat at periods of about 7.1, 5.0, 4.3, 12.5 and 30 years. Visually, these suggest cycles. Fisher's test asks whether the biggest peak is larger than pure noise would produce. Its statistic is the largest ordinate's share of the total,

g=max⁡jI(ωj)∑jI(ωj), g = \frac{\max_j I(\omega_j)}{\sum_{j} I(\omega_j)},

and under white noise its distribution is known exactly. For the Rhine, g=0.061g = 0.061 with p≈0.55p \approx 0.55: a peak at least that large appears by chance about half the time. Smoothed periodograms, with three lag windows at several widths, were flat within their confidence bands.

Method 2: autoregressive models

The time-domain view asks whether this year's flow helps predict next year's. Unit-root and stationarity tests agreed the series is stationary. Among autoregressive models of increasing order, the Akaike criterion preferred AR(0): independent fluctuations around a constant mean. The Ljung-Box test found no remaining autocorrelation (p≈0.26p \approx 0.26 at 20 lags).

Method 3: wavelets

Wavelets look for cycles that come and go, which a periodogram would average away. A Morlet analysis found significant power in only 3.4% of the time-frequency plane, about what chance produces at a 5% level. A maximal-overlap decomposition split the variance across scales as roughly 45%, 32%, 14%, 6%, 3% and 1%, close to the 50%, 25%, 12.5%, … that white noise gives, with slightly more at the 4-8-year scale.

A note on neural networks

A later assignment tried a hybrid model in the style of Zhang. On the last 15 years, held out for testing, the plain long-run mean was the most accurate forecast (root mean square error 187.6). The neural network, the ARMA model and the hybrid all did worse, the hybrid worst of all (218.6). The residuals were already white noise, so the network could only learn noise.

The figure below generates series of pure noise and tests them for cycles. White noise always produces a tallest peak, often at a tempting period, and Fisher's test flags it only about 5% of the time. A real cycle of moderate size is found most of the time.

Suggested settings:

  1. Pure noise. With the amplitude at 0, press "New 150-year series" a dozen times. Every periodogram has a largest peak, often at a plausible period of 5, 7 or 12 years. Fisher's p-value is usually not significant.
  2. False alarm rate. Press "Test 1,000 series". About 5% are flagged at the 5% level. This is the nominal behaviour of the test: one false detection in twenty.
  3. A real cycle. Set the amplitude to 0.5 and the period to 7 years. Now "Test 1,000 series" flags roughly three quarters of them. At amplitude 0.3, only about one in six: a weak cycle in 150 years of data is easily missed.
  4. Compare with the Rhine. Its g=0.061g = 0.061 is an ordinary value for noise. Generated noise series show how often the largest share lands around 0.05-0.07.

Derivation of Fisher's formula. For Gaussian white noise of length nn, the m=⌊(n−1)/2⌋m = \lfloor (n-1)/2 \rfloor periodogram ordinates at the Fourier frequencies are independent, each proportional to an exponential random variable. Their shares of the total are then distributed like the spacings of m−1m-1 uniform points on [0,1][0,1], and Fisher showed that the largest share exceeds xx with probability

P(g>x)=∑j=1⌊1/x⌋(−1)j−1(mj)(1−jx)m−1. P(g > x) = \sum_{j=1}^{\lfloor 1/x \rfloor} (-1)^{j-1} \binom{m}{j} (1 - jx)^{m-1} .

The widget evaluates this sum exactly, with m=74m = 74 for a series of 150 years.

Reporting the seven-year peak as a discovery, or the hybrid model as an advance, would have been misleading. Three methods with different assumptions agreeing on "no structure" is a stronger conclusion than any single positive finding. It also has a practical meaning: for this river at this scale, the best forecast of next year's flow is the long-run average, with an appropriate measure of uncertainty. A shipping company or an insurer preparing for next year should therefore work from the long-run distribution of flows, including how often dry years occur, and not from the phase of a cycle that the data do not support.

  • Every periodogram has a tallest peak. It should be tested before it is interpreted.
  • When residuals are white noise, a more flexible model can only overfit.
  • A carefully established null result is a valid result. For a white-noise series the mean is the appropriate forecast.

References

  1. R. A. Fisher, "Tests of significance in harmonic analysis", Proceedings of the Royal Society of London, Series A, 125(796), 54-59, 1929.
  2. H. Akaike, "A new look at the statistical model identification", IEEE Transactions on Automatic Control, 19(6), 716-723, 1974.
  3. G. M. Ljung and G. E. P. Box, "On a measure of lack of fit in time series models", Biometrika, 65(2), 297-303, 1978.
  4. M. B. Priestley, Spectral Analysis and Time Series, Academic Press, 1981.
  5. C. Torrence and G. P. Compo, "A practical guide to wavelet analysis", Bulletin of the American Meteorological Society, 79(1), 61-78, 1998.
  6. D. B. Percival and A. T. Walden, Wavelet Methods for Time Series Analysis, Cambridge University Press, 2000.
  7. G. P. Zhang, "Time series forecasting using a hybrid ARIMA and neural network model", Neurocomputing, 50, 159-175, 2003.