# Wolfram Language & System 11.0 (2016)|Legacy Documentation

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

# WarpingCorrespondence

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

WarpingCorrespondence[s1,s2,win]
uses a window specified by win for local search.

## Details and OptionsDetails and Options

• WarpingCorrespondence is also known as dynamic time warping.
• WarpingCorrespondence returns {{n1,,nk},{m1,,mk}} of nondecreasing positions such that s1ni correspond to s2mi.
• The returned positions attempt to minimize the distance over all possible such positions, and with the constraint that all elements of s1 and s2 are represented as some s1ni and s2mj, respectively.
• Compute the effective distance using WarpingDistance.
• The sequences si can be lists of numeric or Boolean scalars or vectors.
• Possible settings for the search window win are:
•  Automatic a full search r a slanted band window of radius {"SlantedBand",r} a slanted band window of radius {"Band",r} band window of radius (Sakoe-Chiba) {"Parallelogram",a} parallelogram window placed at origin with slopes and (Itakura)
• A smaller typically gives a faster but less optimal result. If , then has no effect.
• The following options are supported:
•  DistanceFunction Automatic the distance function to be used Method Automatic the variant of DTW to use
• WarpingCorrespondence 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
• By default, the following distance functions are used:
•  EuclideanDistance numeric data MatchingDissimilarity Boolean data
• Using , all elements of s2 are matched with all elements of s1.
• Using Method->{"MatchingInterval"match}, s2 can be matched with a subsequence of s1. Possible settings for match includes:
•  Automatic a full match "Flexible" flexible at both ends "FlexibleEnd" flexible only at the end of the interval

## ExamplesExamplesopen allclose all

### Basic Examples  (1)Basic Examples  (1)

Find the time warping correspondence between two sequences:

 In[1]:=
 In[3]:=
 Out[3]=

Plot the correspondence between indices:

 In[4]:=
 Out[4]=

Find the time warped versions:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

The warped versions are approximately equal:

 In[7]:=
 Out[7]=