W = w
1
.. . w
K
is a contiguous set of matrix elements
that defines a mapping between Q andC under several
constrains (Keogh and Ratanamahatana, 2005):
DTW(Q,C) = min
2
v
u
u
t
K
∑
k=1
w
k
(2)
This path can be found using dynamic program-
ming to evaluate the following recurrence which de-
fines the cumulative distance γ(i, j) as the distance
d(i, j) found in the current cell and the minimum
of the cumulative distances of the adjacent elements
(Keogh and Ratanamahatana, 2005):
γ(i, j) = d(q
i
,c
j
) + min{γ(i− 1, j − 1),
γ(i− 1, j),
γ(i, j − 1)}
(3)
The Euclidean Distance between two sequences
can be seen as a special case of DTW where both time
series have same length and the warping path com-
plies with the main diagonal of the distance matrix.
However, the superiority of DTW over ED has been
demonstrated by several authors (Ding et al., 2008;
Keogh, 2003) for many data mining applications.
3 KNOWN INVARIANCE
Important considerations regarding time series dis-
tance include amplitude invariance and offset in-
variance (Batista and Wang, 2011). If we try to com-
pare two time series measured on different scales they
will not match well, even if they have similar shapes.
Similarly, even if two time series have identical am-
plitudes, they may have different offsets. To measure
the true underlying similarity we must first center and
scale the time series (by trivial z-normalization).
Furthermore, local scaling invariance or rather
warping invariance (Batista and Wang, 2011) should
be taken into account when comparing time series.
This invariance is necessary in almost all biological
signals, which match only when one is locally warped
to align with the other. Recent empirical evidence
strongly suggests that Dynamic Time Warping is a
robust distance measure which works exceptionally
well (Ding et al., 2008).
In contrast to the localized scaling that DTW deals
with, in many data sets we must account for uniform
scaling invariance (Batista and Wang, 2011), where
we try to match a shorter time series against the pre-
fix of a longer one. The main difficulty in creating
uniform scaling invariance is that we typically do not
know the scaling factor in advance, and are thus con-
demned to testing all possibilities within a given range
(Keogh, 2003).
Phase invariance (Batista and Wang, 2011) is im-
portant when matching periodic time series such as
heart beats. By holding one time series fixed, and
testing all circular shifts of the other, we can achieve
phase invariance.
In domains where a small sub-sequence of a time
series may be missing we must consider occlusion
invariance (Batista and Wang, 2011). This form of
invariance can be achieve by selectively declining to
match subsections of a time series. However, most
real-life problems require multiple invariance.
4 ORDER-INVARIANT DISTANCE
This paper introduces an Order-Invariant Distance
(OID) measure which is able to determine the
(dis)similarity of time series which have different
shapes, but exhibit similar sub-sequences in arbi-
trary order. For example, we can imagine the speed
recorded during two different car drives, from home
to the convenience store and back, where the signals
exhibit the same location-dependent traffic situations
(e.g. crosswalk, intersection, driveway, traffic light)
in reverse order (refer to Figure 1) and are therefore
similar in regard of order invariance.
Although order invariance may be an important
consideration for other real-life data mining applica-
tions, relevant literature (Batista and Wang, 2011) is
lacking a time series distance measure which is able
to determine the (dis)similarity of signals that contain
multiple similar events at arbitrary positions in time.
Commonly used measures like ED and DTW are not
designed to deal with order invariance, because they
discriminate time series according to their shapes and
fail to recognize cross-alignments between unordered
sub-sequences. To this end, we developed an Order
Invariant Distance measure which matches similar
sub-sequences regardless of their order or location.
Our proposed OID measure is based on the Cross
Recurrence Plot (CRP) approach (Marwan, 2008;
Marwan et al., 2007) which tests for occurrences of
similar states in two different systems, or rather time
series (with same physical units). The data length of
both time series can differ, leading to a non-square
recurrence matrix R:
R
i, j
= Θ(ε− ||q
i
− c
j
||)
(4)
where Θ represents the Heaviside function (i.e.
Θ(x) = 0 if x < 0, and Θ(x) = 1 otherwise), || · || is a
norm (i.e. L
2
-norm) and ε is a threshold distance that
determines the radius of the similarity neighborhood.
A closer inspection of the Cross Recurrence Plot
(matrix R) reveals small-scale structures, which can
AnOrder-invariantTimeSeriesDistanceMeasure-PositiononRecentDevelopmentsinTimeSeriesAnalysis
265