# How to measaure the similarity between two series?

I'm confused about how to measure the similarity between two time series with the same length. For example, both time series are 2 hours in length and every 5 minutes a point. I really want to know which Distance Algorithm should I use. I have tried the Euclidean Distance but it didn't work well on this type of data. Should I find some point-to-point distance algorithms?

• You can search the asked and now answered questions with the search bar up on this site. For example "distance time series" gives a variety of ideas, how to measure. Maybe this question on stackoverflow gives you more ideas how to define your distance. And if you are there now, you can find a lot of answered questions related, if you use the search too. I hope you find something that fits to your problem. If you have questions, that are not to find in this searches, you are welcome to ask again :) – Allerleirauh Apr 4 '19 at 9:02
• It is not possible to answer your question, unless you show examples of the time series. To answer the question, we need to know the invarances needed, for example...warping, uniform scaling, offset, amplitude scaling, phase, occlusions, uncertainty and wandering baseline [a]. [a] cs.ucr.edu/~eamonn/… [b] cs.unm.edu/~mueen/DTW.pdf – Eamonn Keogh Apr 4 '19 at 17:33

A classical approach for time series similarity computation is Dynamic Time Warping (DTW).

• The mapping of the indices from the first sequence to indices from the other sequence must be monotonically increasing, and vice versa, i.e. if $$j>i$$ are indices from the first sequence, then there must not be two indices $$l>k$$ in the other sequence, such that index $$i$$ is matched with index $$l$$ and index $$j$$ is matched with index $$k$$, and vice versa
• In such a setting, a simple $L_1$ distance would be a good fit. – ncasas Apr 26 '19 at 15:48
• Yeah, I think so too. And I have already implemented $L_1$ distance (and $L_2$ distance) but the results are not so good. Since I was calculating directly on the raw data (not exactly, $z-score$ implemented), I am now studying whether I can use some time series representations to make the results better. Can you help me? Thank you. – mister lee May 6 '19 at 7:46