https://github.com/cran/dtw
Tip revision: 8635857e84591d8779b36aa05f9db41e7cfd09d6 authored by Toni Giorgino on 30 November 2007, 00:00:00 UTC
version 0.3-1
version 0.3-1
Tip revision: 8635857
dtw_test.R
library(dtw);
ldist<-matrix(1,nrow=6,ncol=6); # Matrix of ones
ldist[2,]<-0; ldist[,5]<-0; # Mark a clear path of zeroes
ldist[2,5]<-.01; # Forcely cut the corner
ds<-dtw(ldist); # DTW with user-supplied local cost matrix
da<-dtw(ldist,step="a"); # Also compute the asymmetric
ds$distance
ds$index1
ds$index2
da$index1
da$index2
da$distance