Patterns › Time series

Cross-correlation (CCF)

The cross-correlation function measures correlation between two series at lags −lagMax..+lagMax, with ±1.96/√n significance bounds.

What is Cross-correlation (CCF)?

CCF generalises the autocorrelation function (ACF) to two series. CCF(k) = corr(xₜ, yₜ₊ₖ); a peak at positive k means x leads y by k periods, negative k means y leads x.

Pre-whiten first: spurious lead-lag relationships are easy to find between two series that share a trend or strong autocorrelation. Fit an ARIMA to one series, apply the same filter to the other, then compute the CCF of the residuals.

When should I use Cross-correlation (CCF)?

  • Lead-lag analysis between two time series (economic indicators, signal-response delays).
  • Identifying the lag at which one variable's effect on another peaks.
  • Pre-step for transfer-function modelling.

What data does it need?

Two numeric series + max lag.

What does it report?

ECharts bar chart with bars outside ±1.96/√n band coloured red + peak |CCF| + its lag. Positive lag = first series leads.

How do I interpret the result?

Without pre-whitening, the CCF is dominated by the autocorrelation in each series. A clean lead-lag spike usually requires residuals of an ARIMA fit on each side.

See also

References

  • Box, Jenkins, Reinsel & Ljung (2015). Time Series Analysis: Forecasting and Control, 5th ed.