The Problem:

Given two time series, I want to determine if the (Pearson) correlation between the two time series is constant throughout time.


For example, I have the following two time series:enter image description here

Clearly, there is correlation between them. If I calculate the Pearson correlation coefficient I get $\rho = 0.960$. However, I want to test whether this correlation coefficient remains the same throughout time. In principle, the correlation of two time series could change through time right?

My current 'solution':

I partition the two time series into sub-time series of equal length. In this case the total length of the time series is $n \approx 2600$, so I split each time series into 52 time series of length 50. Then I calculate the Pearson coefficient for each of the 52 pairs. I then plot the coefficients:

enter image description here

Apart from the three earlier points, the correlation looks to be fairly constant. However, this method isn't very mathematical. Is there a more rigorous test that I can do to determine if the correlation remains constant?

  • 3
    $\begingroup$ Hi: You're dealing in a very dangerous-subtle area here because the correlation of two time series should only be defined after the series have been filtered so that the residuals are white noise. I can't explain this here ( too long and I wouldn't do it justice anyway ) but I would google for "pre-whitening a time series" or "transfer response" because what you're doing can lead to incorrect inference if not done correctly. If you google for those terms, you will see what I am referring to. Apologies for not providing all the details but it's quite involved. $\endgroup$
    – mlofton
    Commented Aug 6, 2020 at 16:29
  • $\begingroup$ This gives some idea of the issue. online.stat.psu.edu/stat510/lesson/9/9.1 $\endgroup$
    – mlofton
    Commented Aug 6, 2020 at 16:31

2 Answers 2


Wouldn't you want to start with if they are cointegrated? If they are not I would think the correlation is besides the point (since there is no real relationship anyway in the long run).

  • $\begingroup$ Hi. The OP is looking at correlations ( hopefully at various lags but he wasn't clear on that ) which is a very different thing from testing for cointegration. Cointegration tests whether there is a relationship between the levels of the series so that the spread between the levels tends to revert. That's not what I'm suggesting when I point to that link. $\endgroup$
    – mlofton
    Commented Aug 6, 2020 at 22:52
  • $\begingroup$ I understand. I was questioning if correlation made sense for time series. I think with data that moves over time the danger of spurious regression or changing relations in the time series is so high that it is dangerous to use correlations. But I am still learning time series so maybe this is not the case. $\endgroup$
    – user54285
    Commented Aug 7, 2020 at 17:21
  • $\begingroup$ yes, the stability of correlation measurements can an issue.but a more funadamental issue is that any ccf analysis requires pre-whitening or a transfer response type approach. Also, note that there are many correlations between two series because there is one at each non-zero lag and zero lag so you should always specify what lag correlation you are referring to. I think you are referring to lag zero but it's better to be explicit. $\endgroup$
    – mlofton
    Commented Aug 8, 2020 at 10:16

A slightly modified version of your question can be answered using the tools in the following paper: Aue, Alexander, et al. "Break detection in the covariance structure of multivariate time series models." (2009): 4046-4087. This paper can be found here: https://projecteuclid.org/journals/annals-of-statistics/volume-37/issue-6B/Break-detection-in-the-covariance-structure-of-multivariate-time-series/10.1214/09-AOS707.full.

Essentially this paper allows you to test for a changepoint in the covariance matrix of the two series.


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.