I have a multiple sequences of different lengths in a list in R. I would like to construct the DTW distance matrix to be used by hierarchical clustering. When I run the following command in R:
a2<-dtw(Data[[1]][1],Data[[1]][2])
Error in dtw(Data[[1]][1], Data[[1]][2]) :
No warping path exists that is allowed by costraints
I get above error. I have no NAN or missing value but they are different lengths.I know matlab dtw can support sequence with different lengths .Can anyone suggest me how to solve this problem in R?
Also to calculate the DTW distance between all sets of observation should I write a for loop for each two data series or is there any command in R or Python that can calculate the Distance given the list or dictionary as an input.
Update: Input : 1 1 2 5 6 7 2 4
2 1 1 2 4 5 3 3 2 2 1
1 2 1 1 2 3 1 2 1 2 6 6 5
1 2 3 5 6 2 4 2 2 3
I want to be have the distance matrix for the above input.