Comprehensive implementation of Dynamic Time Warping (DTW) algorithms in R.
The DTW algorithm computes the stretch of the time axis which optimally maps one given timeseries (query) onto whole or part of another (reference). It yields the remaining cumulative distance after the alignment and the point-by-point correspondence (warping function). DTW is widely used e.g. for classification and clustering tasks in econometrics, chemometrics and general timeseries mining.
Please see documentation for function dtw, which is the
main entry point to the package.
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:
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").
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.