Solved – Continuous measure of similarity between two time series

differencespearson-rsimilaritiestime series

I have two time series, spanning about 2.5k observations each. One series is observed values, the other one is predicted values based on a simple linear regression model. Both time series share the same unit.
I plotted both observed and predicted values along the observations (x) and now I am looking for a measure that continuously investigates the similarity/difference between them. At this point, I am not interested in the coefficient of determination or other measures of goodness of fit that give you one value.
I plotted the normalised difference between observed and predicted values along x (difference here as in simply subtracting predicted from observed values). This gives me another series with equal length (x).
I was wondering if there are any other statistical measures that investigate the similarity or difference between two time series. I would like to visualize such a measure, hence, any tests with a single value outcome are not what I am looking for right now. "Continuously" might not be the ideal word for what I am after, I merely tried to highlight that I am interested in a measure that is good to plot. Is there something like a "moving Pearson" and how would it work?

Happy for any suggestions!

Best Answer

Dynamic Time Warping may be the way to go (https://en.wikipedia.org/wiki/Dynamic_time_warping). However, this method assumes that there may be a non-linear warp between different parts of the time series.

If you are not expecting warping or delays in the signal, something as simple as Euclidean distance may be a better way to go. Of course, you should apply Euclidean distance only after you applied some preprocessing (for instance, amplitude scaling).

If you can vectorize your time serie you could also measure the cosine similarity between the resulting vectors.

Related Question