# Continuous measure of similarity between two time 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!

• 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. Nov 8 '17 at 20:38
• 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? Nov 9 '17 at 7:37
• @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. Nov 9 '17 at 9:15
• @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? Nov 9 '17 at 9:19
• 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. Nov 9 '17 at 9:26