— periods of expansion and contraction in output or financial markets — lie at the heart of macroeconomic analysis. When countries share a common currency, as in the eurozone, synchronized cycles are necessary for a one-size-fits-all monetary policy to work. This idea was first put forth by Robert Mundell (1961), the father of Optimum Currency Area theory. If, for example, Germany is in crisis and Spain is booming, as was the case after the turn of the millennium, the European Central Bank (ECB) cannot set the right interest rate for both countries. A lower interest rate would lead to overheating the economy in Spain, and a higher interest rate would exacerbate the crisis in Germany.
Traditional measures of cycle synchronization often rely on simple correlations. But what happens if two economies are following very similar business or financial patterns, but one is just “ahead” or “behind” the other by a few quarters?
Enter Dynamic Time Warping (DTW), a technique originally developed for speech recognition but increasingly popular in data science for comparing time series with similar shapes yet different timings. In our paper, “Warpings in Time: Business and Financial Cycle Synchronization in the Euro Area” (Bugdalle & Pfeifer, 2025), we construct composite indices of euro-area business and financial cycles and then use DTW to measure how closely these cycles align across countries. Our Optimal Currency Area (OCA) monitor that makes it possible to track cycle divergence in real time — and to spot phase lags without penalizing them as harshly as traditional metrics would.
Capturing phase shifts and amplitude differences
Most existing studies of cycle synchronization do three things that can be problematic:
- Static treatment of cycles: For example, trend-extraction methods (like the HP filter) remove the cyclical components from the data. Even in more complex frameworks — such as state-space models that do allow for cyclicality — the cycle frequency itself often remains fixed.
- Use of the mean: Standard dispersion indicators like variance or standard deviation always misinterpret the average as the “optimum”. In other words, distances are not measured between pairs of cycles, but relative to a mean or reference cycle. This obscures multimodality. For instance, if our cycles actually fall into two (or more) well-separated clusters, the centroid will lie between them — in a region where no real data exist — and all the cycle-to-mean distances will look moderate, even though cycles from different clusters are actually extremely distant.
- Phase shifts: Most distance measures are Euclidean. For example, two cycles may be slightly shifted in time yet still perfectly synchronized. This point may be particularly important for monetary policy. Many OCA indicators end up overstating divergence, especially in periods when economies are “nearly” in sync but offset by a few months or quarters.
Dynamic Time Warping (DTW) for cycle synchronization
DTW is a non-parametric algorithm that finds the optimal alignment (or “warping”) between two time series by allowing one series to stretch or compress in time to match the other. In our case, DTW is applied to each type of the smoothed cycle indices, meaning one measure of similarity is estimated for each type of cycle. Within each cycle category, DTW computes the alignment path πij for each pair of countries i and j that minimizes the cumulative distance between two cycles:
\[D(\mathbf{x}_i, \mathbf{x}_j) = \min{\pi_{ij}} \sum_{(t, s) \in \pi_{ij}} \left| \mathbf{x}_{i,t} – \mathbf{x}_{j,s} \right|^2,\]
where xi and xj is the smoothed cycle values at time t and s for countries i and j, respectively. The resulting distance D(xi, xj) captures the degree of similarity, with smaller values indicating closer alignment of the two cycles. To ensure that the DTW comparison reflects the timing of cyclical movements, the alignment is performed over a local window (Sakoe-Chiba Band) defined by the average cycle duration. Finally, to aggregate all pairwise DTW distances into one euro‐area indicator, we compute a GDP‐weighted mean of D(xi, xj). This weighted average is the divergence index shown below (Figure 3).
Key benefits of DTW with Sakoe-Chiba Bands in an economic-cycle context:
- Phase-invariance. Small lags or leads don’t automatically trigger large divergence scores. A one-quarter shift won’t severely penalize the distance if the underlying patterns remain almost identical.
- Shape sensitivity. DTW preserves information about amplitude, trend reversals, and the relative “shape” of booms and busts. Two countries that both experience a sharp credit boom — even if one is ahead by a quarter — will still be deemed highly similar.
- Time-varying flexibility. By applying DTW over a rolling window (e.g., a local band of ±5 quarters for business cycles, ±6 quarters for financial cycles), the method adapts to changing cycle durations without imposing a fixed frequency.
Building composite business and financial cycles
To illustrate DTW’s power, we first construct two composite cycle indices for each euro-area country:
- Business Cycle Index: Quarterly real GDP growth, private consumption growth, gross fixed capital formation growth, and unemployment growth.
- Financial Cycle Index: Quarterly real credit growth (bank lending), house-price growth, stock-price growth, and government bond-price growth.
Using a non-parametric approach introduced by Schüler et al. (2020), we extract each country’s underlying cycle — an index that alternates between 0 and 1 to reflect expansionary versus contractionary phases, but with time-varying amplitude and duration. This avoids rigid detrending and keeps turning points intact.
Figures 1 and 2

Note: Indices of business cycle and financial cycles as deviations from their historical median growth — 0.5 corresponds to the long-term median growth rate of each index. The composite financial cycle combines quarter-on-quarter growth in credit, house prices, equity prices and bond prices — showing both the raw (unfiltered) series and the band-pass-filtered series using country-specific frequency bands. The filtered business cycle combines quarter-on-quarter growth in GDP, consumption, investment, and unemployment
From pairwise DTW distances to an aggregate divergence monitor
Once each country’s business and financial cycles are estimated, we compute pairwise DTW distances between every pair of countries (e.g., Germany vs. Spain, France vs. Italy, etc.). To form a single euro-area “divergence index,” they take a GDP-weighted average of all pairwise DTW distances. A higher index value means greater divergence across national cycles; a lower value means tighter synchronization.
Figure 3

Note: The figure shows quarterly measures of cycle divergence in the euro area from 1985Q1–2023Q4. The dashed purple line plots the mean dynamic-time-warping (DTW) distance across all pairwise comparisons of national financial-cycle indices; the dashed blue line shows the equivalent for business-cycle indices. The solid black line is the GDP-weighted average of these two series, our composite Divergence Monitor. Shaded grey bands mark OECD recession periods for the eurozone. Higher values indicate greater divergence across member-state cycle
When you plot this series (Figure 3), several patterns emerge:
- 1990s convergence: Business-cycle divergence fell sharply as convergence criteria under Maastricht took hold.
- Pre-2008 financial divergence: Financial cycles actually diverged well before the global financial crisis — that peak in divergence is almost invisible to correlation or amplitude-based metrics.
- Post-2010 re-alignment: ECB unconventional monetary policy (OMT, QE) coincided with convergence in both business and financial cycles.
- Late-2021 uptick: Since the COVID-19 shock, divergence has begun creeping back up, as some countries likely recovered faster than others.
Takeaways for data scientists and economists
- Flexible pattern matching: When comparing economic (or any) time series that may share the same “shape” but are out of phase, DTW is often a better similarity measure than Euclidean distance or straightforward correlation.
- Handling non-stationary frequencies: Business and financial cycles don’t come in neat, fixed-length packages. DTW’s ability to adapt to varying cycle durations preserves real-world turning points.
Interested in exploring the code or following the live “Divergence Monitor” for the euro area? Check out https://github.com/Moritz-Pfeifer/Divergence_Monitor for data, Python notebooks, and https://moritz-pfeifer.github.io/eurozone-divergence-monitor/ for an interactive visualization that lets you see how synchronization has evolved since the 1980s.
References:
Bugdalle, T., Pfeifer, M. (2025). Warpings in time: Business and financial cycle synchronization in the euro area. SSRN preprint. Link to working paper
Sakoe, H., Chiba, S. (1978). Dynamic programming algorithm optimization for spoken word recognition. IEEE Transactions on Acoustics, Speech, and Signal Processing, 26(1), 43–49. Link to paper
Schüler, Y. S., P. P. Hiebert, and T. A. Peltonen (2020). Financial cycles: Characterisation and real-time measurement. Journal of International Money and Finance 100. Link to paper
Mundell, R. (1961). A theory of optimal currency areas. American Economic Review, 51(4), 657–665. Link to paper