I'm trying DTW from mlpy, to check similarity between time series.

Should I normalize the series before processing them with DTW? Or is it somewhat tolerant and I can use the series as they are?

All time series stored in a Pandas Dataframe, each in one column. Size is less than 10k points.


2 Answers 2


DTW often uses a distance between symbols, e.g. a Manhattan distance $(d(x, y) = {\displaystyle |x-y|} $). Whether symbols are samples or features, they might require amplitude (or at least) normalization. Should they? I wish I could answer such a question in all cases. However, you can find some hints in:


I am glad you asked ;-)

In 99% of cases, you must z-normalize.

Want to know why? I wrote a tutorial on this, page 46 http://www.cs.unm.edu/~mueen/DTW.pdf

  • $\begingroup$ Any easy way to do this z-normalizaiton in Python? $\endgroup$
    – KcFnMi
    Jan 3, 2017 at 10:00
  • $\begingroup$ And, by the way, nice presentation! $\endgroup$
    – KcFnMi
    Jan 3, 2017 at 10:17
  • $\begingroup$ @KcFnMi z-normalization in Python: docs.scipy.org/doc/scipy-0.14.0/reference/generated/… $\endgroup$ Jan 5, 2017 at 8:56
  • $\begingroup$ @eamonn Awesome slides, thanks for sharing your experience, I can't up vote the answer enough $\endgroup$
    – Emer
    Mar 14, 2019 at 14:59
  • $\begingroup$ @eamonn What if the data is multimodal? $\endgroup$
    – Alex
    Aug 22, 2020 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.