150 likes | 388 Views
Qualitative approximation to Dynamic Time Warping similarity between time series data. Blaž Strle, Martin Možina, Ivan Bratko Faculty of Computer and Information Science University of Ljubljana Slovenia. Dynamic Time Warping (1/4).
E N D
Qualitative approximation to Dynamic TimeWarping similarity between timeseries data Blaž Strle, Martin Možina, Ivan Bratko FacultyofComputerandInformationScience Universityof Ljubljana Slovenia
Dynamic Time Warping (1/4) • Dynamic time warping (DTW) is a method for measuring similarity between two time series • Time series is a sequence of observations, measured at successivetimes, spaced at (often uniform) time intervals • Time series ex.: TS = (9.47, 9.50, 9.48, 9.41, 9.32, 9.26, 9.21, 9.11, 9.01, 8.83, … )
Dynamic Time Warping (2/4) Euclidean distance DTW aligns two time series in the way some distance measure is minimized time series sizes may vary • does not align values • both time series need to be of the same size
Dynamic Time Warping (3/4) • DTW can be efficiently calculated using dynamic programming: D(i, j) = min( D(i-1, j), D(i, j-1), D(i-1, j-1) ) + d(ai, bj) D(i, j) = DTW( A(1..i), B(1..j)) d(ai, bj)is a distance between two values of time series
Dynamic Time Warping (4/4) Drawback – time complexity O(N2) Large amout of data Portable devices
Improvements of Dynamic TimeWarping • Constraints • limit a minimum distance warp path searchspace by reducing allowed warp along time axis • Data abstraction • reduce the size of the input time series
QDTW (1/3) • Idea:reduce time series size byremoving information that is irrelevant for DTW • Theorem: If two sequences A and B, |A| = n, |B| = m are qualitatively equal then: DTW(A,B) ≤ ε, where ε = min(n × maxdiff(A)/2, m × maxdif(B)/2). • two sequences are qualitatively equal if bothsequences are monotonic and their start and end values areequal • Term maxdiff (S) is the maximal absolute difference between two adjacent elements in a time series S.
QDTW (2/3) 1. Transform time series into qualitative representation (QING) 2. Use DTW on extreme points
QDTW (3/3) • If two sequences A = (a1, a2, … an), B = (b1, b2, …, bm), are qualitatively equal than : • QDTW(A,B) = DTW( (a1, an), (b1, bm) ) = 0 • |DTW(A,B) - QDTW(A,B)| ≤ ε – from Theorem Violatins of conditions for the applicability of Theorem Extreme points do not coincide Sequences are not monotonic DTW(A,D) > DTW(A,C) > DTW(A,B) QDTW(A,D) = QDTW(A,C) > QDTW(A,B) • Non monotonic part of B is not detected: • QDTW(A, B) = 0, DTW(A, B) > 0 • Monotonic part is detected: • QDTW(A, B) is larger than it should be
Experimental Evaluation (1/3) • Datasets: • Australian Sign Language signs (UCI) • Character Trajectories (UCI) • Character Recognition • Accuracy • Classification using k-nn (k=3) • Leave one out
Experimental Evaluation (2/3) • Efficiency • Estimated by size of the martix D • Size D = |A| x |B|, where A and B are time series we are comparing
Conclusion • DTW is a method for measuring similarity between two time series • DTW’s time complexity O(N2) makes it useful only for relatively short time series • QDTW is qualitative approximation to DTW • QDTW can be up to 1000 faster than DTW • Improvements in efficiency are often obtained at acceptable loss in classification accuracy • Future work: improve QDTW accuracy by reducing errors due to violations of the conditions for the applicability of the theorem