Home▸Mathematics▸Cross-Correlation Explorer (2D): Finding Lead-Lag Relationships Between Two Time Series

Cross-Correlation Explorer (2D): Finding Lead-Lag Relationships Between Two Time Series

Interactive 2D simulator: generate two related synthetic time series with a hidden lag between them, then watch the cross-correlation function (CCF) sweep across lags on a live bar chart to pinpoint which series leads and by how many steps. Drag to pan and scroll to zoom the time-series view.

Mathematics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-time-series-analysis-mathematics ↗ Open standalone

This 2D companion to the 3D cross-correlation explorer builds the same two related synthetic time series — series A, and series B constructed as a lagged, noisy copy of A — then sweeps every candidate lag through the cross-correlation function (CCF) to find which series leads and by how many steps. The two series render as an overlaid line chart you can pan and zoom, and the CCF values render as a color-coded bar chart across the search window, with the tallest bar marking the detected lag. It is the exact tool time-series analysts reach for when two related signals (rainfall and river flow, ad spend and sales, one sensor and another downstream) need their lead-lag relationship measured rather than assumed, distinct from autocorrelation (which only ever compares a series to itself).

⚙ Under the hood

Interactive 2D simulator: generate two related synthetic time series with a hidden lag between them, then watch the cross-correlation function (CCF) sweep across lags on a live bar chart to pinpoint which series leads and by how many steps. Drag to pan and scroll to zoom the time-series view.

time seriescross-correlationlead-lagstatisticssignal analysisforecasting

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)