Sequence Shifted Dynamic Time Warping (SSDTW)
- SSDTW is a lag-aware time series similarity measure that applies temporal shifts before computing DTW to capture delayed dependencies.
- It identifies the optimum alignment by calculating DTW distances over a set of candidate shifts and selecting the minimum value.
- Integrated within the TLCCSP framework, SSDTW improves forecasting accuracy for weather, stock, and real estate data, despite increasing computation which is mitigated by a contrastive learning encoder.
Searching arXiv for the cited SSDTW and related DTW work to ensure the article is grounded in current papers. Sequence Shifted Dynamic Time Warping (SSDTW) is a time-series similarity measure introduced within the Time-Lagged Cross-Correlations-based Sequence Prediction (TLCCSP) framework to identify delayed dependencies between sequences. Rather than comparing two series only in synchronous alignment, SSDTW computes Dynamic Time Warping (DTW) distances after applying candidate temporal shifts to one sequence and retains the minimum such distance. In the TLCCSP formulation, this makes SSDTW the mechanism for detecting time-lagged cross-correlations that can be exploited by downstream forecasting models, particularly in settings where informative relationships emerge only after delays ranging from a few days to several weeks or months (Wu et al., 9 Aug 2025).
1. Definition and mathematical formulation
SSDTW is defined for a target sequence , a candidate sequence , and a set of admissible time shifts . Its purpose is to capture time-lagged cross-correlations by searching over shifted versions of the candidate sequence before applying DTW.
The paper gives the shift operation as
and defines the SSDTW distance by
where the minimization selects the lag producing the best alignment (Wu et al., 9 Aug 2025).
This formulation differs from ordinary lag-agnostic similarity measures because the distance is not evaluated on a single fixed temporal coordinate system. Instead, the coordinate system itself is searched over through the set of candidate shifts. A plausible implication is that SSDTW functions as a discrete lag-selection layer wrapped around standard DTW, with the lag set encoding the temporal horizon over which delayed dependence is considered meaningful.
2. Algorithmic procedure
The SSDTW procedure consists of three explicit steps. First, for each , the candidate sequence is shifted to form . Second, a DTW distance is computed between the target sequence and each shifted sequence 0. Third, the minimum DTW value across all tested shifts is taken as the SSDTW distance.
In compact form, the workflow is:
- shift 1 by each candidate lag 2;
- compute 3 for every shift;
- return the minimum over all such distances.
Because SSDTW explicitly searches over lagged alignments, it is tailored to cases in which one sequence may lead or follow another. The paper frames this as a way to identify relationships “that occur with a delay (lag)” rather than only instantaneous comovement (Wu et al., 9 Aug 2025).
Within the stated notation, SSDTW remains a pairwise distance, but one designed for later use in sequence selection. This is significant because the algorithm is not presented as a standalone forecasting model; it is a retrieval and ranking primitive whose output is subsequently consumed by a predictive architecture.
3. Relation to standard DTW and other DTW-based alignment research
Standard DTW computes an alignment-based distance between synchronously aligned time series, that is, series whose comparison is anchored to the same timestamps. SSDTW, by contrast, aligns 4 with multiple shifted versions of 5 and chooses the minimum-distance alignment. The key difference stated in the paper is that SSDTW detects lagged, asynchronous, or time-delayed similarities that standard DTW cannot detect (Wu et al., 9 Aug 2025).
This distinction is methodologically important. Standard DTW can accommodate local stretching and compression once two sequences are placed in correspondence, but SSDTW adds an outer search over coarse temporal displacement before local warping. In the forecasting setting of TLCCSP, that outer search is the mechanism through which lagged cross-series dependencies are surfaced.
A useful contrast appears in other DTW-derived research. In “A time warping approach to multiple sequence alignment” (Arribas-Gil et al., 2016), DTW is extended toward multiple sequence alignment by constructing a median path from pairwise alignments, with no template or guide tree. That work addresses consensus alignment across many discrete sequences rather than lag discovery between forecasting covariates. This suggests that SSDTW occupies a different point in the DTW design space: it is not a multiple-alignment consensus method, but a lag-aware pairwise similarity for selecting auxiliary sequences relevant to prediction.
4. Function inside the TLCCSP forecasting framework
In TLCCSP, SSDTW is the principal tool for measuring time-lagged cross-correlation between a target sequence and a pool of candidate auxiliary sequences. The framework first computes SSDTW distances
6
for the target 7 and each candidate 8. It then ranks candidates by these distances and selects the top-9 subset
0
after which forecasting is performed through feature fusion of the target and the selected lagged auxiliary sequences:
1
The role of SSDTW is therefore upstream of prediction proper. It determines which external sequences are judged most strongly time-lagged correlated with the target and thus worthy of inclusion in the fused model input. The paper’s framing is explicit that the objective is not merely better similarity measurement in the abstract, but better auxiliary-sequence selection for forecasting.
This architecture also clarifies why SSDTW matters beyond pairwise distance estimation. If the auxiliary sequence selection stage is improved, the downstream prediction model 2 receives more informative inputs. The paper attributes forecasting gains precisely to this ability to exploit hidden lagged dependencies ignored by single-sequence and standard multi-sequence methods (Wu et al., 9 Aug 2025).
5. Empirical performance and computational profile
The reported experiments cover weather, stock, and real estate datasets. SSDTW improves mean squared error relative to single-sequence baselines, and the associated contrastive learning encoder (CLE) further reduces error while dramatically lowering computational cost.
| Dataset | SSDTW MSE reduction | CLE MSE reduction |
|---|---|---|
| Weather | 16.01% | 17.88% |
| Stock | 9.95% | 6.13% |
| Real Estate | 21.29% | 8.62% |
The paper also reports larger model-specific improvements in some cases: up to 27.42% on the weather dataset for iTransformer, up to 26.19% on the stock dataset, and up to 36.93% on LSTM for real estate. In the ablation study, SSDTW outperforms both traditional DTW and random selection (RS), with the interpretation that DTW can improve performance by matching similar patterns but lacks the ability to detect truly lagged effects, making SSDTW more suitable when cross-series dependencies are delayed (Wu et al., 9 Aug 2025).
The computational cost is a central part of the SSDTW profile. For 3 time series of length 4, the paper states a complexity of 5. On the stock dataset, consisting of 4,426 stocks over hundreds of days, exhaustive SSDTW computation over all pairs takes approximately 980 hours. To address this, TLCCSP introduces a contrastive learning-based encoder that approximates SSDTW distances in a lower-dimensional space and reduces computation time by approximately 99%, down to about 3 hours in that stock experiment (Wu et al., 9 Aug 2025).
These results establish a two-part empirical picture: exact SSDTW is effective but computationally demanding, whereas the CLE is presented as a scalability mechanism that preserves the utility of SSDTW-like distance structure while making large-scale or real-time deployment more plausible.
6. Interpretation, use cases, and limitations
The paper explains SSDTW’s forecasting benefit through lagged dependence structures that are natural in several domains. In weather forecasting, conditions in an upstream city may affect a target city only after a delay dependent on flow or wind. In stocks, one sector’s movements may lead another, with the paper giving the example of beverage stocks leading food stocks. SSDTW is intended to recover such lead–lag relationships so that forecast models can incorporate historically informative auxiliary sequences (Wu et al., 9 Aug 2025).
Several interpretive points follow from the reported results. First, a common misconception is that DTW alone is sufficient for delayed dependence; the ablation results are presented specifically to show that standard DTW helps only partially because it does not explicitly search over temporal shifts. Second, the method does not imply that any additional auxiliary sequence is beneficial. The case studies and sensitivity analyses indicate that proper identification of lagged correlated sequences significantly boosts forecasting accuracy, whereas random selection or excessive auxiliary data can harm performance. Third, the contrastive learning encoder should not be conflated with exact SSDTW; it is introduced as an approximation mechanism, motivated by the prohibitive cost of exhaustive pairwise SSDTW computation (Wu et al., 9 Aug 2025).
Within the broader DTW family, SSDTW can therefore be understood as a specialized lag-aware retrieval criterion for forecasting pipelines rather than a universal replacement for DTW. Its distinctive contribution lies in combining temporal shift search with warping-based alignment so that delayed cross-series structure can be converted into a practical sequence-selection signal. The TLCCSP results suggest that this is particularly relevant when real-world dependencies are not contemporaneous, but instead manifest after variable lags ranging from days to weeks or months.