Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

TimeWarpingCorrespondence

TimeWarpingCorrespondence[s1,s2]
gives the time warping (DTW) similarity path between sequences and .

TimeWarpingCorrespondence[s1,s2,r]
uses a window of radius r for local search.

Details and OptionsDetails and Options

• TimeWarpingCorrespondence is also known as dynamic time warping.
• TimeWarpingCorrespondence returns of nondecreasing positions such that correspond to .
• The returned positions attempt to minimize the distance over all possible such positions and with the constraint that all elements of and are represented as some and , respectively.
• The number of positions k satisfies .
• The sequences can be lists of numeric or Boolean scalars or vectors.
• The search window radius r can be a non-negative integer that bounds the search for optimal correspondence such that will be compared with elements only for .
• A smaller r typically gives a faster but less optimal result. If , then r has no effect.
• TimeWarpingCorrespondence accepts a option with settings:
•  Automatic automatically determine distance function EuclideanDistance Euclidean distance ManhattanDistance Manhattan or "city block" distance BinaryDistance 0 if elements are equal; 1 otherwise ChessboardDistance Chebyshev or sup norm distance SquaredEuclideanDistance squared Euclidean distance NormalizedSquaredEuclideanDistance normalized squared Euclidean distance CosineDistance angular cosine distance CorrelationDistance correlation coefficient distance BrayCurtisDistance Total[Abs[u-v]]/Total[Abs[u+v]] CanberraDistance Total[Abs[u-v]/(Abs[u]+Abs[v])] MatchingDissimilarity matching dissimilarity between Boolean vectors
• The Automatic setting uses EuclideanDistance for numeric data and MatchingDissimilarity for Boolean data.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Find the time warping correspondence between two sequences:

 Out[3]=

Plot the correspondence between indices:

 Out[4]=

Find the time warped versions:

 Out[5]=
 Out[6]=

The warped versions are approximately equal:

 Out[7]=