cultivars.spectral.cycles#

Business-cycle chronology: turning points dated from the data, and how two chronologies agree.

The Bry-Boschan rules, in Harding and Pagan’s quarterly restatement (BBQ), date peaks and troughs without a model: a peak is a local maximum over a two-sided window,

\[y_t > y_{t \pm k}, \qquad k = 1, \dots, \texttt{window},\]

turns must alternate, every phase must last a minimum number of observations and every full cycle a longer minimum, and shorter episodes are deleted in pairs. That is the NBER committee’s judgement reduced to an algorithm, and the reason to have it is comparison: against the committee’s dates, against a Markov-switching model’s recession probabilities, or across countries. The concordance index of Harding and Pagan,

\[I = \frac{1}{T} \sum_{t=1}^{T} \bigl[ S_t S'_t + (1 - S_t)(1 - S'_t) \bigr],\]

is the share of dates two binary chronologies agree on, and the phase table – duration, amplitude, and the excess of the actual path over the triangle joining its ends – is the standard description of a cycle’s shape.

Two commitments shape the surface. First, the rules are stated and overridable, and their consequences are reported rather than hidden: the result carries the triple it was dated under, a contraction indicator for every date, and a phase table in which a spurious short phase is visible, because on unsmoothed data the quarterly triple will date one and the user should see it rather than trust the peak list. Second, a chronology is a description, not a test. No turn carries a p-value, the last window observations cannot be turns, and a phase open at the sample end is left out of the table; the recent end of a chronology is provisional in the same way the recent end of a Christiano-Fitzgerald cycle is, and for the same reason.

Layout. TurningPoints resolves the rules and dates a series into a TurningPointsResult, which holds the peaks, troughs, contraction indicator, and phase table and computes concordance() against another chronology; concordance() is the same index as a function of two chronologies or probability series. The numerics live in _core: _candidate_turns runs the local-extremum test, _alternate_turns thins to an alternating sequence, _enforce_durations applies the phase and cycle minima in Harding-Pagan’s paired deletions, _phase_statistics computes the duration, amplitude, and excess of each completed phase, _validate_chronology coerces a boolean or probability series, _concordance is the index, and _TURNING_POINT_RULES holds the quarterly and monthly triples. The band-pass filters in band_pass supply the cycle component for a growth-cycle chronology, and MSAR the model-based recession probabilities a chronology is most often compared against.

References

Bry, G., & Boschan, C. (1971). Cyclical Analysis of Time Series: Selected Procedures and Computer Programs. NBER.

Harding, D., & Pagan, A. (2002). Dissecting the cycle: A methodological investigation. Journal of Monetary Economics, 49(2), 365-381.

Harding, D., & Pagan, A. (2006). Synchronization of cycles. Journal of Econometrics, 132(1), 59-79.

Example

A 24-period cycle on a slow trend, dated under the quarterly rules, and its concordance with a chronology lagged by three observations:

>>> import numpy as np
>>> t = np.arange(120.0)
>>> y = 0.01 * t + 0.5 * np.sin(2 * np.pi * t / 24)
>>> res = TurningPoints().date(y)
>>> res.peaks, res.n_cycles
(array([  6,  30,  54,  78, 102]), 4)
>>> lagged = TurningPoints().date(np.roll(y, 3))
>>> res.concordance(lagged), concordance(res, lagged)
(0.75, 0.75)

Classes#

TurningPoints

Date peaks and troughs with the Bry-Boschan / Harding-Pagan rules.

TurningPointsResult

A dated chronology: peaks, troughs, the contraction indicator, and the phase table.

Functions#

concordance(first, second)

Harding-Pagan concordance of two chronologies.