# Cross-correlation between two seasonal series

To determine cross-correlation between Sales and Variable cost, both having monthly seasonality, do I need to de-seasonalize both series?

## 3 Answers

The essential question is, what problem are you trying to solve?

If you intend to build a good model for the data (and later use the model for hypothesis testing, forecasting or whatever), you need to account for all the patterns there are. If there is seasonality, you should include seasonal patterns in your model. If you fail to do so, the model might not be adequate; it might yield unreliable hypothesis test results, poor forecasts, etc.

Now you say you want to determine (which I will interpret as estimate) cross correlation between two series. I understand that cross correlation is just the regular correlation estimated for different lags versus leads of the two series. For the intuition it is enough to consider regular correlation, which I will do henceforth. The idea can be carried over seamlessly from regular correlation to cross correlation.

If both of your time series were bivariate $i.i.d.$, the sample correlation would correspond to a population correlation. Hence, you could have a meaningful point estimate, a confidence interval and what not. However, if at least one of the time series is not $i.i.d.$, defining a population counterpart of the sample correlation becomes difficult, and subsequently the estimates are difficult to interpret. Then it becomes easier to specify a model for your data and start asking questions in terms of the model.

Now assume that both series are bivariate $i.i.d.$ except for seasonal patterns in their means. Then you can remove those and estimate the correlation of the seasonally adjusted series (which at this point should be roughly bivariate $i.i.d.$). But be aware that the correlation you are getting after the seasonal adjustment is not informative of you original question, "What is the correlation between the two series?" For example, your two series might have exactly the same seasonal pattern and just minor random variations around it. Thus the two series are almost the same, and you would intuitively think their correlation should be positive and really high (close to unity). But the sample correlation that you get after the seasonal adjustment might be anywhere between [-1,1] since the (estimated, but also the true underlying) random noise components of the two series may or may not be correlated. Thus you would be getting an answer to a question you are not really interested in; there is no guarantee that the answer would be anywhere close to what you are actually looking for.

Therefore, I recommend you to rely on a fully specified model (unless both of your time series are bivariate $i.i.d.$) and ask questions in terms of the model. On the other hand, if you have no time for building a model and you need a quick answer (that can happen), I believe the most relevant point estimate of the correlation between the two series would be just the regular sample correlation (even though it has the problem of not having a meaningful counterpart in population and its confidence interval would be difficult to define, as explained above).

If you are regressing two (unrelated) time series with seasonality you might get what is called spurious correlation. An example of that is available here

"it is important to consider whether significant trends exist in the series; if we ignore a common trend, we may be estimating a spurious regression, in which both $y$ and the $X$ variables appear to be correlated because of the influence on both of an omitted factor, the passage of time" -- source

The commond trend could be a drift or a seasonality pattern. In order to avoid spurious correlation it is cornerstone to whiten your data, netting off the effect of trend and seasonality. You can then regress on the residuals.

A more formal intro to the problem is available here

• Lots of good points, but I have some concerns, especially whether the proposed approach would address the real problem and answer the right question. You may find my perspective in another answer to this question. – Richard Hardy Jan 25 '16 at 20:28

The link to the "more formal solution" seems to go to a generic uni page. Could you you update it to point to the article, if still available?