MODULE REFERENCE

dtw

anomx.data.processing.dtw

Dynamic Time Warping (DTW)

Tools for computing Dynamic Time Warping alignment between time series, including cost matrices, alignment algorithms, and windowing constraints (Sakoe-Chiba, Itakura).

Public exports

Import these names directly from anomx.data.processing.dtw.

CRWindow

Compressed row representation window. Stores the range of active grid cells in each column. Any window with contiguous columns can be expressed as a CRWindow. Supports efficient iterative construction and updates.

CostMatrix

(n+1) x (m+1) Matrix Cell (i,j) corresponds to minimum total cost/distance of matching elements (i-1, j-1) in series1 and series2.

DTWAlignment

Dynamic Time Warping (DTW) Alignment.

Itakura

Forms the Itakura parallelogram, where max_slope determines the slope of the steeper side.

NoWindow

Window covers the entire grid, meaning every possible alignment between series1 and series2 is considered.

SakoeChiba

Forms a diagonal window where window_size controls the maximum allowed shift between the two series. If both time-series have the same time axis, window_size corresponds to the maximum number of time periods

dtw

Determines the optimal alignment between two time series `series1` and `series2`, according to the Dynamic Time Warping algorithm. The alignment minimizes the distance between pair-wise elements after warping. All elements in the two series are matched and are in strictly monotonically increasing order. Considers only the values in the series, ignoring the time axis.