# Comparing Multiple Time Series

I was just wondering if there was a way to compare multiple time series and try and find similarities between them. The time series depict the daily inventory of some stock held by an investor. A bit of examination of these plots suggests there is similarity in their movements since many of their peaks/troughs seem to occur on the same days (sorry, I was unable to attach pictures since I have a new account...). As a bit of extra analysis, I took the cumulative sum for both of these time series and this again suggests these two time series are similar. Are there any tests I can perform which can analyse the two time series and find similarities between them? For example, whether both the time series have peaks and troughs on the same day etc. From what I've gather from a topic I posted a few days ago (Finding Correlation between Time Series - is it a meaningless value?), the correlation between two time series is a fairly useless measure unless certain tests are performed beforehand. But what if I to find the correlation for the cumulative sum time series (the bottom 2 pictures) instead? Would that sill be a poor measure for the relationship between the two series?

Additionally, this topic https://quant.stackexchange.com/questions/489/correlation-between-prices-or-returns suggests that correlation can be useful if you change what aspect you measure of the two time series. If perhaps I try and find the correlation between the variation of the movements of the two time series then would that be better?

I also have one other final problem: I have over 80 different time series to analyse per year, so I was also wondering if there is any method or test which would allow me to analyse these time series such that I don't have to rely on observing plots (for example acf and pacf plots). Thanks in advance.

## 2 Answers

Similarity is the inverse of distance, below are commonly used distance metrics for time series.

• Correlation: You already talk about this.
• Eucledian Distance: Self explanatory I assume.
• Dynamic Time Warping: DTW finds an optimal match between two sequences of feature vectors which allows for stretched and compressed sections of the sequence.
• Mutual Information: Entropy based metric, introduced by Shannon. Applied to time series, there are quite a few papers by now. For example (this)[https://arxiv.org/abs/0904.4753].
• iSAX: The final one I want to flag is the so-called "Motif Discovery" and the related (iSAX)[http://www.cs.ucr.edu/~eamonn/iSAX.pdf] representation of time series (by Eamon Keogh), which is very scalable.

Also, I would recommend searching this website for Time Series Distance metrics, I am sure there will be a few others that I am missing here.

Estimate ARIMA models for each of the time series and see if they form clusters. If they do, you can then analyze if there are some fundamentally different factors among these clusters, like maybe P/E ratios, Book-To-Market, average liquidity etc.