Solved – Interpretation of CCF plot from R

cross correlationtime series

I am analyzing two time series, and when I used the ccf function, I received this output:

enter image description here

I am pretty confused. I do not have too much experience with time series, but this looks weird to me. What exactly am I looking for in this plot? What does this tell me, and is this normal?

Thanks in advance!

Best Answer

The cross correlation function (ccf) is used to visually explore the correlation between two time series. But compared to a simple scatterplot which would only show the contemporaneous relationship between the two series, ccf shows how the relationship is distributed over time. More specifically, a spike at lag k shows the correlation between xx[t+k] and yy[t]. Obviously, if k=0 you are measuring the contemporaneous correlation, that is the linear relationship between xx[t] and yy[t]. However, the real value of ccf is that there are multiple spikes, each telling you something about how past or present of one series relates to the past or present of the other series. A negative spike at lag k (k>0), for example, means that the present value of yy series (present meaning at time [t]) is correlated with the future value of the yy series at time [t+k]. Similarly, a negative spike at lag k (k<0) means that the historic value of series xx at time [t+k] (historic because k<0 and that makes t+k less than the present time t) is correlated with the present value of yy at time [t].

Now, regarding the ccf that you provided. Clearly the cross correlations are not much different across the lags as all the spikes extend down to about -0.2. It has been shown that uninformative or misleading ccfs can result when the xx series is autocorrelated. One remedy to that is to "prewhiten" xx prior to cross-correlating with yy. Prewhitening is the process of removing autocorrelation from input and output time series (i.e. xx and yy) prior to cross-correlating them.

Below are the steps that need to be carried out for prewhitening and determination of the dynamic relationship between the series. A friendly introduction to this can be found in Bisgaard, S., & Kulahci, M. (2006). Quality Quandaries: Studying input-output relationships, part I. Quality Engineering, 18(2), 273-281.

ccf

Related Question