# Cross correlation influenced by self auto correlation

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.

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:

120 values for Y (STOCK1) and X (STOCK2) were analyzed utilizing 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 . 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 . AUTOBOX in a conservative mode INITALLY suggests 1 lag in the differnce of X . estimation and diagnostic checking suggests the need to add a second lag to the model . . Intervention detection examines the need to accomodate unspecified deterministic structure and suggests a pulse at period 8 which is not significant. Step-down leads to the final model and here . The model's residuals are plotted here . The Actual/Fit and Forecast (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

• (+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. – Analyst Aug 11 '15 at 10:28
• @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 ? – IrishStat Aug 11 '15 at 11:05
• it is true that model is perhaps too simple in some cases when those effects which you describes exist in the series... – Analyst Aug 11 '15 at 13:32
• @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 – Angela Zhou Aug 12 '15 at 1:39
• 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 – Angela Zhou Aug 13 '15 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! :)

• 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? – Angela Zhou Aug 11 '15 at 9:47
• 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. – Analyst Aug 11 '15 at 10:26