Description Usage Arguments Details Value Author(s) References Examples
A function to calculate the dynamic time warping value between two trajectories.
1 | DTW(traj1, traj2, pointSpacing=-1)
|
traj1 |
An m x n matrix containing trajectory1. Here m is the number of points and n is the dimension of the points. |
traj2 |
A k x n matrix containing trajectory2. Here k is the number of points and n is the dimension of the points. The two trajectories are not required to have the same number of points. |
pointSpacing |
An integer value of the maximum index difference between trajectory1 and trajectory2 allowed in the calculation. A negative value sets the point spacing to unlimited. |
The dynamic time warping algorithm (DTW) calculates the smallest warp path for the two trajectories. This is the DTW version discussed by Berndt & Clifford (1994). Several variations of calculating the warping cost exist. In this version, the warping path is equal to the sum of the distances at each point along the path. Please see the references for more information.
A floating point value representing the smallest warp path is returned. If a problem occurs, then a string containing information about the problem is returned.
Kevin Toohey
Berndt, D. and Clifford, J. (1994) Using Dynamic Time Warping to Find Patterns in Time Series. Paper presented at the KDD workshop.
1 2 3 4 5 6 7 |
[1] 16
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.