Warping and elastic similarity#
Elastic similarity measures and time warping.
Sample-level DTW and its variants (dtw), edit distances, soft-DTW
and kernels (elastic), segment-level correlation-based warping
(segment_dtw), episode alignment (alignment), averaging
(averaging), path diagnostics (diagnostics) and parameter
learning (learning).
DTW and its variants, edit and kernel measures, soft-DTW, correlation-based and segment-level warping, episode alignment, averaging, diagnostics and learning.
Classes#
|
Distance, warping path and accumulated cost matrix of one alignment. |
|
Correlation-based dynamic time warping (Bankó and Abonyi, 2012). |
|
Dissimilarities of piecewise linear approximations: MPLA, SPLA and the mixed MDPLA measure (Bankó and Abonyi, 2015). |
|
Weighted multivariate segment dissimilarity (a generalization of MDPLA). |
|
Descriptor of one segment: location, level, trend and correlation structure. |
|
1-NN ensemble of elastic distances (after Lines and Bagnall, 2015). |
Functions#
|
DTW distance of two (multivariate) series. |
|
Full DTW result: distance, optimal warping path |
|
Independent multivariate DTW: the sum of the DTW distances of the variables, each warped separately (DTW_I). |
|
Derivative DTW: DTW of the Keogh--Pazzani derivative estimates. |
|
Weighted DTW: the local cost of cell |
|
Amerced DTW: every non-diagonal (warping) step costs an additional |
|
shapeDTW: DTW on local shape descriptors of every sample; the optimal path is used to accumulate the raw sample distances (Zhao and Itti, 2018). |
|
FastDTW (Salvador and Chan, 2007): project the path found at a coarser resolution, expand it by |
|
LB_Kim lower bound of DTW (squared Euclidean local cost): first and last samples. |
|
LB_Keogh lower bound of band-constrained DTW (squared Euclidean cost, equal lengths): the distance of the candidate from the envelope of the query. |
|
Best warped match of |
|
Local cost matrix |
|
Admissible cells of the warping path. |
|
LCSS distance \(1-LCSS/\min(T_x,T_y)\). |
|
Edit distance on real sequences; with |
|
Edit distance with real penalty; gaps cost the distance to the reference value |
|
Time warp edit distance with stiffness |
|
Move--split--merge distance with split/merge cost |
|
Soft-DTW value \(\mathrm{dtw}_\gamma=-\gamma\log\sum_A e^{-\langle A,C\rangle/\gamma}\); tends to DTW as \(\gamma\to0\). |
|
Soft-DTW value and the expected alignment matrix \(E=\nabla_C\,\mathrm{dtw}_\gamma(C)\): a fuzzy warping path whose entries are the probabilities that two samples are aligned under the Gibbs distribution over all alignments. |
|
Soft-DTW divergence \(\mathrm{dtw}_\gamma(x,y)-\tfrac12 (\mathrm{dtw}_\gamma(x,x)+\mathrm{dtw}_\gamma(y,y))\ge0\), zero iff \(x=y\) (Blondel et al., 2021). |
|
Global alignment kernel with a Gaussian local kernel. |
|
Coefficient-normalized cross-correlation sequence of two series (summed over the channels), computed with the FFT; length |
|
Shape-based distance \(1-\max_w NCC_w(x,y)\) of k-Shape (in [0, 2]); with |
|
Descriptors of the segments of |
|
Local cost matrix between two sequences of segment models. |
|
DTW over two sequences of segment models. |
|
SEGPCA baseline: equal numbers of PCA-homogeneous segments compared index by index with \(1-s_{PCA}\) (no warping). |
|
Pairwise alignment of two symbol sequences. |
|
Alignment of two episode sequences (Balaskó, Bankó and Abonyi, 2007). |
|
Dissimilarity \(1-\text{score}/10\) of two episode sequences. |
|
DTW over episode sequences (an mvtsa extension). |
|
DTW barycenter averaging of a (multivariate) collection. |
|
Soft-DTW barycenter by L-BFGS on the average's samples. |
|
Medoid of a collection under any distance function. |
|
Statistics of one warping path |
|
Tightness of warping (ToW) of a data set under one local dissimilarity. |
|
Warping function \(\varphi(i)\): the mean index of the second series aligned to sample |
|
Leave-one-out 1-NN accuracy from a distance matrix. |
|
Band width maximizing the LOO 1-NN accuracy (ties: the narrowest). |
|
Grid search of the weights of a segment-level measure. |
Constants#
Built-in immutable sequence. |