# Best step pattern for unconstrained/subsequence DTW(Dynamic Time Warping)

I am implementing an unconstrained/subsequence DTW algorithm (in R). The query of data which I am trying to find a match within the reference data is much smaller (as compared to reference). I have read in R's dtw library documentation that only normalizable step patterns can be used when dealing with unconstrained DTW. I started with asymmetric step pattern but read in the official library documentation that "the asymmetric step pattern limits time expansion to a factor of two; it would therefore be impossible to completely align a query with a reference more than twice as long". Given in my case reference data is much larger than query data this probably won't work.

I am implementing in R so I have these options available: http://finzi.psych.upenn.edu/library/dtw/html/stepPattern.html

Please note that I am not looking for guidance in terms of how to implement it in R. This is a purely statistical doubt I have. I am looking for the best step pattern that can be used in an unconstrained/subsequence DTW implementation.

• programming questions are off-topic here and should be asked on Stack Overflow – Antoine May 25 '16 at 13:02
• @antoine There appear to be statistical questions here, regardless of the programming issues. – whuber May 25 '16 at 14:17
• @Antoine sorry if I made it sound more like a programming question, but basically, I know how to implement the method in R, I am not looking for any help on that front. What I wanted to know was among the methods available for choosing a step pattern for unconstrained DTW which would be the best one from statistical point of view. Although I have quoted references in my question mostly from R's documentation, that's because it contained the most straight forward explanation of DTW in general. I will make the required edits in the question to avoid any confusion. – mosdkr May 25 '16 at 21:10
• If your query is much smaller than the reference, you could consider to use a sliding window of 2*query length and report the best match found throughout the reference. – Nikolas Rieble Feb 24 '17 at 18:05