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!

  • $\begingroup$ I used a simple linear regression model with one independent variable b and one dependent variable y. The model has the form of y = β0 + β1 x b + e where e = residual. $\endgroup$ Nov 8, 2017 at 20:38
  • $\begingroup$ If I understand correctly, then you are looking for an entire time series of "similarities". If so, then why is the simple series of differences not enough? Possibly smoothed? Or even STL-transformed, so you could see whether differences exhibit trend or seasonality? $\endgroup$ Nov 9, 2017 at 7:37
  • $\begingroup$ @CagdasOzgenc Well, if I plug in the observed values to the LRM, I get the predicted values, which I have already plotted. I could plug in the predicted values and plot the resulting error term but that does not tell me a lot about the difference between observed and predicted time series. $\endgroup$ Nov 9, 2017 at 9:15
  • $\begingroup$ @StephanKolassa Yes, that is what I am looking for. Maybe the series of differences is indeed sufficient. I just do not know. I was assuming there might be a statistically more powerful tool to investigate a time series of similarities or differences. What is STL transformation? $\endgroup$ Nov 9, 2017 at 9:19
  • $\begingroup$ STL decomposition ("transform" was a typo) decomposes a time series into a season, a trend and a remainder series. If you apply this to your differences, you will see, e.g., any seasonal patterns in the differences. If you are looking for a better tool than just looking at differences, it would be good if you could tell us in more detail what you are looking for, or what you are unhappy about in simply looking at differences. There doesn't seem to be anything else that immediately comes to mind. $\endgroup$ Nov 9, 2017 at 9:26

1 Answer 1


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.


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.