ShiftDTW: adapting the DTW metric for cyclic time series clustering
Lucas Foulon, Ilyes Korichi, Xavier Millot
TL;DR
ShiftDTW addresses clustering of cyclic time series by integrating a Sakoe-Chiba–bounded DTW variant with K-Means, preserving cyclic alignment without incurring CDTW’s full cost. It standardizes seasonality using Prophet and then leverages a doubled distance matrix to explore multiple bounded alignments, achieving $O(mn)$ time like DTW. The method preserves per-series shifts during centroid updates, enabling effective grouping of seasonally offset patterns. Empirical results on synthetic cyclic data and real accounting series show shifts can improve clustering over Euclidean and DTW baselines, while remaining computationally efficient. Future work includes broader benchmarks, comparisons with CDTW, and extensions to multi-indicator and barycenter-aware DTW clustering.
Abstract
The elasticity of the DTW metric provides a more flexible comparison between time series and is used in numerous machine learning domains such as classification or clustering. However, it does not align the measurements at the beginning and end of time series if they have a shift occurring right at the start of one series, with the omitted part appearing at the end of that series. Due to the cyclicity of such series - which lack a definite beginning or end - we rely on the Cyclic DTW approach to propose a less computationally expensive approximation of this calculation method. This approximation will then be employed in conjunction with the K-Means clustering method.
