Comprehensive implementation of Dynamic Time Warping (DTW) algorithms in R.
The basic DTW algorithm computes the time axis stretch which optimally maps one timeseries (query) onto another (reference); it outputs the remaining cumulative distance between the two. DTW is widely used e.g. for classification and clustering tasks in econometrics, chemometrics and general timeseries mining.
The R implementation in dtw provides:
dtwWindowingFunctionsstepPattern:Multivariate timeseries can be aligned with arbitrary local distance
definitions, leveraging the dist function of
package
In addition to computing alignments, the package provides:
Please see documentation for function dtw, which is the
main entry point to the package.
If you use this software, please cite it according to
citation("dtw"). The package home page is at
To get the latest stable version from CRAN, use
install.packages("dtw"). To get the development version
(possibly unstable), use
install.packages("dtw",repos="http://r-forge.r-project.org").
Rabiner, L. R., & Juang, B.-H. (1993). Chapter 4 in Fundamentals of speech recognition. Englewood Cliffs, NJ: Prentice Hall.
dtw for the main entry point to the package;
dtwWindowingFunctions for global constraints;
stepPattern for local constraints;
distance, outer for
building a local cost matrix with multivariate
timeseries and custom distance functions.