Quant Memo
Core

Lead-Lag and Cross-Correlation Analysis

A way to test whether one time series tends to move before another by correlating each series against shifted copies of the other, so you can find the time lag where the relationship is strongest.

Prerequisites: Autocorrelation and Serial Correlation, Correlation

E-mini S&P futures and the SPY ETF track the same underlying index, but they don't move in perfect lockstep tick for tick — futures trade in a deeper, faster market and often shift first, with SPY following a beat later. If you only check whether the two series move together right now, you'll see a strong relationship but miss the more useful fact: which one moves first, and by how much time. Cross-correlation analysis answers exactly that — it tells you not just whether two series are related, but at what lag.

An analogy: two cars with a gap

Picture two cars on a highway, one trailing the other by a roughly constant few seconds. If you only compare their positions at the same instant, they look loosely related — the trailing car is usually somewhere near the leading one, but not exactly. If instead you compare the leading car's position now to the trailing car's position a few seconds later, the match becomes almost perfect. The "right" comparison isn't at lag zero; it's at whatever lag matches the actual gap between them. Cross-correlation analysis is the systematic way of trying every possible gap and finding which one lines the two series up best.

The maths, one symbol at a time

Let XtX_t and YtY_t be two time series observed at the same time steps tt. For an integer lag kk (positive, negative, or zero), define the cross-correlation function:

ρXY(k)=corr(Xt,Yt+k)\rho_{XY}(k) = \text{corr}(X_t, Y_{t+k})

In words: shift YY backward or forward in time by kk steps relative to XX, then compute an ordinary Pearson correlation between the two aligned series. A positive kk tests whether XX leads YY by kk steps (today's XX lines up with YY, kk steps in the future); a negative kk tests the reverse. Plotting ρXY(k)\rho_{XY}(k) against kk gives a cross-correlogram. If the peak of that plot sits at k=2k = 2, that means XX's moves are best matched by YY's moves two steps later — evidence XX leads YY by two time steps.

Worked example 1: a clean synthetic lead

Suppose XtX_t for t=1,,6t = 1,\dots,6 is 2,1,3,2,1,02, -1, 3, -2, 1, 0 and YtY_t is an exact one-step-delayed copy: Y2,,Y6=2,1,3,2,1Y_2,\dots,Y_6 = 2, -1, 3, -2, 1 (so Yt=Xt1Y_t = X_{t-1}). At lag k=1k=1, we compare X1,,X5=2,1,3,2,1X_1,\dots,X_5 = 2,-1,3,-2,1 against Y2,,Y6=2,1,3,2,1Y_2,\dots,Y_6 = 2,-1,3,-2,1 — identical sequences, so ρXY(1)=1\rho_{XY}(1) = 1, a perfect match. At lag k=0k=0, we'd compare X1,,X5X_1,\dots,X_5 against Y1,,Y5Y_1,\dots,Y_5, but Y1Y_1 doesn't exist and the aligned pairs are simply mismatched values from different points in the cycle, giving a much weaker correlation, well below 1. The cross-correlogram correctly flags k=1k=1 as the true lag.

Worked example 2: futures leading an ETF

A desk records 1-second returns for E-mini futures (XX) and SPY (YY) over a trading session and computes ρXY(k)\rho_{XY}(k) for k=3k = -3 to 33 seconds. Say the results are: ρ(1)=0.10\rho(-1) = 0.10, ρ(0)=0.55\rho(0) = 0.55, ρ(1)=0.71\rho(1) = 0.71, ρ(2)=0.34\rho(2) = 0.34, ρ(3)=0.12\rho(3) = 0.12, with other lags near zero. The peak at k=1k=1 (0.71, higher than the lag-0 value of 0.55) says futures moves are best explained by SPY moves one second later — futures lead SPY by about one second. A market maker in SPY could use the futures tape as an early read on where SPY is about to move, sizing quotes ahead of the lag rather than reacting after the fact.

Correlation explorer
X →Y ↑
ρ = 0.60r² = 0.36relationship: moderate positive

Drag the correlation slider above to see how a scatter of paired observations tightens around the fit line as ρ\rho rises — the same idea applies at whichever lag you're testing, just with YY shifted before pairing.

lag k (seconds) -1 0 1 2 3 peak
The tallest bar sits at lag k=1, not k=0 — the correlogram's peak location is the estimated lead time, here futures leading SPY by about one second.

What this means in practice

Lead-lag analysis underpins pairs trading (which leg to trade first), execution sequencing (using a faster-moving proxy to anticipate a slower one), and index-arbitrage strategies that watch futures to predict ETF or cash-basket moves. The estimated lag also tells you how much of an edge is actually exploitable: a one-second lead is tradeable for a low-latency desk, but useless for a strategy that rebalances daily.

Cross-correlation analysis finds the time shift at which two series line up most tightly, by testing correlation at every candidate lag and reading off the peak — this is how you distinguish "moves together" from "one moves first."

Both series usually have their own autocorrelation — today's SPY return is a little predictable from yesterday's SPY return alone, with no reference to futures at all. That internal autocorrelation can inflate cross-correlation estimates at every lag, including spurious ones, making a coincidental relationship look like genuine lead-lag structure. Before trusting a cross-correlogram, "prewhiten" each series (strip out its own autocorrelation, e.g. by differencing or fitting an AR model to the residuals) so that any remaining cross-correlation reflects a real link between the two series, not each one echoing its own past.

Related concepts

Practice in interviews

Further reading

  • Tsay, Analysis of Financial Time Series, ch. 2
  • Hasbrouck, Empirical Market Microstructure, ch. 8
ShareTwitterLinkedIn