I have two stationary time series ts1, ts2, I wanna find the cross correlation ($\textrm{CCF}$) between them. As a result, it show a significant correlation on lag 0, and 1 days. However, it also shows significant auto-correlation on 1 day lag inside each time series. I doubt the cross correlation between two time series are influenced by the $\textrm{ACF}$ inside each time series. Could anyone help? Should I use prewhitening like mentioned here ? However, I am doubting that turning the data into white noise will lose some valuable information which also reflect their correlation.


2 Answers 2


Pre-whitening is definitely the way to go. It does not change the relationship but enables identification of the relationship between the original series.. Care should be taken to identify any deterministic structure in the original series and develop the pre-whitening filters in conjunction with them . See http://viewer.zmags.com/publication/9d4dc62a#/9d4dc62a/66 for a review which highlights Transfer Function identification. If you wish you can post your data in an excel format and I will try and explain each step.

EDITED AFTER RECEIPT OF DATA:enter image description here

120 values for Y (STOCK1) and X (STOCK2) were analyzed utilizing https://web.archive.org/web/20160216193539/https://onlinecourses.science.psu.edu/stat510/node/75/ guidelines using an automatic option available in AUTOBOX http://www.autobox.com/cms/ a commercially available system which I have helped develop. Modelling is an iterative,self-checking process, which extracts structure from the data (with possible model pre-specification) and culminates in a parsimonious equation. I will try and walk through the steps showing details from the automatic process which is faithful to the PSU reference.

The intial pre-whitening filters for X and Y are shown here enter image description here enter image description here . Each of the two series is non-stationary and each one required one order of differencing to obtain stationarity.

The pre-whitened cross-correlations and proportional Impulse Response Weights are enter image description here . AUTOBOX in a conservative mode INITALLY suggests 1 lag in the differnce of X enter image description here . estimation and diagnostic checking enter image description here suggests the need to add a second lag to the model .enter image description here . Intervention detection examines the need to accomodate unspecified deterministic structure and suggests a pulse at period 8 enter image description here which is not significant. Step-down leads to the finaenter image description herel model and here enter image description here . The model's residuals are plotted here enter image description here . The Actual/Fit and Forenter image description hereecast (based upon future expectations of X and the model) are here .

All Transfer Functons can be expressed as Regression-type equations aiding interpretation by humans. The model in this form is enter image description here

  • $\begingroup$ (+1) of course one should take into account all relevant effect when doing this filtering. R allows one to do readily this filtering via prewhiten function in package TSA which basically tries AR(p) model. $\endgroup$
    – Analyst
    Commented Aug 11, 2015 at 10:28
  • $\begingroup$ @Analyst I don't believe TSA identifies/accounts for any pulses/level shifts/local time trends which could cause incorrect ARIMA filter identification consequently it is often not robust enough. Is that correct ? $\endgroup$
    – IrishStat
    Commented Aug 11, 2015 at 11:05
  • $\begingroup$ it is true that model is perhaps too simple in some cases when those effects which you describes exist in the series... $\endgroup$
    – Analyst
    Commented Aug 11, 2015 at 13:32
  • $\begingroup$ @IrishStat dropbox.com/s/9svqqacuzlo9sbr/time_series.xlsx?dl=0 Here is the data I am dealing with and I am now trying to find the lead lag (if there is ) between them. The data is the logged price of two indexes $\endgroup$ Commented Aug 12, 2015 at 1:39
  • $\begingroup$ Thanks for your explanation. However, there are several points I didn't understand. 1.You mentioned "Intervention detection examines the need to accomodate unspecified deterministic structure and suggests a pulse at period 8" I don't understand how you come out this result. 2. D.W statistic says "the test is invalid". so it could be not true that it shows no significant lag at 1. I am a starter and due to my limit knowledge and I Have go through your answer several times, I don't know where is the result. Thanks for you help $\endgroup$ Commented Aug 13, 2015 at 1:58

Prewhitening does not mean that you turn both series into white noise, it means that model used to turn series x into white noise is used to filter series y. After that cross-correlation function/plot can be used.

I had problem in my energy consumption and temperature data that strong autocorrelation and seasonality would mask true lead/lag relations in a way that needed prewhitening. After prewhitening it was found out that outside temperature in certain area leads energy consumption! :)

  • $\begingroup$ I have several questions 1. when you turn series x into white noise, you lose the information right? Is it possible the filtered data could influence the lead-lag correlation?2. Could you please inform me that how do you do prewhitening? 3. I always got high correlation on lag 0 days, do you have any idea on this? $\endgroup$ Commented Aug 11, 2015 at 9:47
  • $\begingroup$ Some answers 1) You filter out seasonal and autoregressive features in series x but not in y when y is filtered by model developed for x 2) I use existing functions and do not code myself. R package TSA contains prewhiten function which tries AR(p) model 3) CCF at lag zero is simply correlation between series. It can be negative or positive. $\endgroup$
    – Analyst
    Commented Aug 11, 2015 at 10:26

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.