Lagged Cross-Correlation Calculator
Enter two aligned equal-frequency numeric series and a maximum lag to calculate pairwise Pearson correlation at every signed displacement. The page exposes row starts, retained pair counts and withheld constant slices while refusing best-lag, causal-lead, predictive-edge, forecast, signal and trading conclusions.
Enter two ordered equal-frequency series
Row order matters. Positive lag pairs an earlier X row with a later Y row under the displayed convention.
Whole rows only; every lag must retain at least five pairs.
Enter 5 to 500 finite values without percent signs; one complete aligned observation per row.
The Y row count and original order must match X exactly.
Signed-lag Pearson arithmetic
Entered Rank and Lag Correlation 1.0.0.
On smaller screens, scroll horizontally to inspect the complete audit table.
| Lag | X start row | Y start row | Pairs | Pearson coefficient | Status |
|---|
How signed lagged cross-correlation is calculated
h < 0: pair X[1−h…n] with Y[1…n+h]
rh = SXY,h ÷ √(SXX,hSYY,h)
The calculator scans every integer lag from minus the entered maximum through plus that maximum. At positive h, the paired Y observation occurs h rows later than X; at negative h, the paired X observation occurs minus h rows later than Y.
Each lag keeps n minus the absolute lag paired rows. The model recalculates the X and Y means and centered sums for that exact slice, then applies the centered Pearson product-moment formula. A constant paired slice is withheld rather than reported as zero.
The summary identifies the greatest absolute coefficient among valid rows. Deterministic ties prefer the smaller absolute lag and then the smaller signed lag. This is an audit convenience only and receives no multiple-testing adjustment or best-lag interpretation.
Worked example from the audited fixture
The audited fixture contains 12 aligned equal-frequency X and Y observations and scans maximum lag 3, producing seven lag rows with 9 to 12 retained pairs.
- Lag zero correlation is −0.22973063. At positive lag 1, X rows 1 through 11 pair with Y rows 2 through 12 and produce correlation 0.99215364 from 11 pairs.
- The page highlights lag +1 because it has the largest observed absolute coefficient in this entered scan. It does not claim X leads, causes or predicts Y.
Reproduce it: select “Load audited example” above. The governed engine retains full precision and rounds only the visible interface.
How to interpret the result
- Read the signed lag first: positive values move Y later relative to X, while negative values move X later relative to Y.
- Compare retained pair counts because larger absolute lags use fewer rows and can be more unstable.
- Lag zero provides the contemporaneous entered Pearson reference under the same original row alignment.
- A peak away from zero can arise from shared trends, serial dependence, seasonality, selected windows or chance across multiple inspected lags.
- Inspect the complete lag table rather than treating the highlighted row as an optimal trading setting.
Assumptions and limits
- Enter 5 to 500 aligned equally spaced observations; maximum lag is capped at 50 and must leave at least five pairs.
- The calculator cannot verify timestamps, missing intervals, timezone alignment, stationarity or preprocessing consistency.
- Pearson correlation at each lag measures linear association only and remains sensitive to outliers and structural changes.
- Autocorrelation within either series can make cross-correlation peaks appear more persistent than the independent evidence supports.
- The scan makes no multiple-testing correction and does not estimate confidence intervals or p-values.
- No best-lag, causal lead, predictive edge, hedge ratio, forecast, grade, signal, position instruction or recommendation is generated.
Which relationship diagnostic answers which question?
Average-rank association, pairwise concordance, signed-lag Pearson correlation and contemporaneous Pearson uncertainty describe different evidence. The comparison keeps ties, original magnitude, row order and inference boundaries visible. A bounded coefficient is not a universal dependence or trading score.
| Tool | Evidence entered | Primary output | Main boundary |
|---|---|---|---|
| Spearman Rank Correlation | Two aligned numeric or ordinal series | Pearson correlation of average ranks | Magnitude information is discarded. |
| Kendall Tau-b | Two aligned numeric or ordinal series | Tie-corrected concordant-minus-discordant balance | Pairwise agreement is not a significance verdict. |
| Lagged Cross-Correlation | Two ordered equal-frequency numeric series | Pearson coefficient at each signed displacement | Lag peaks do not establish lead, cause or prediction. |
| Pearson Confidence Interval | Two contemporaneous numeric series | Original-value Pearson coefficient plus Fisher limits | Linear inference remains assumption-sensitive. |
Frequently asked questions
- At positive lag h, X rows one through n minus h pair with Y rows one plus h through n, so the paired Y row occurs later.
- At negative lag h, X begins at row one minus h while Y begins at row one, so the paired X row occurs later.
- Every lagged slice uses its own paired rows, means and centered sums before the standard Pearson product-moment formula is applied.
- A displacement of absolute size h removes h unmatched edge rows, leaving n minus absolute h paired observations.
- That coefficient is undefined and is visibly withheld rather than converted to zero or silently removed from the lag table.
- No. It is only the observed maximum in the entered scan and receives no multiple-testing adjustment, stability test or trading interpretation.
- No. Shared trends, autocorrelation, alignment choices, selected windows and chance scanning can create off-zero peaks without causality or prediction.
- No. It generates no best-lag verdict, causal conclusion, predictive-edge claim, hedge ratio, forecast, grade, signal or recommendation.
Sources and methodology
- NIST — Lag Plot — Published fixed-displacement definition and two-series signed-lag construction.
- NIST — Correlation — Published centered Pearson formula applied independently to each paired slice.
Version 1.0.0 was locked only after the rank, tie and lag conventions were checked against the cited NIST and SciPy material. Canonical fixtures were independently recomputed with SciPy 1.13.1 before comparison with the browser engine. The calculator performs arithmetic locally and does not upload the entered observations.
Continue the ordered-series relationship review
Verify the ordered evidence before interpreting relationships
Reconcile the exact statement window, sampling frequency, timestamps, missing rows, realized P&L, spread, commission, financing, currency conversion, rounding and preprocessing across every series. Correct rank, pair-count or lag arithmetic cannot repair mismatched, selected or cost-inconsistent evidence.
Risk and affiliate disclosure: Leveraged forex and CFD trading can result in substantial losses. These are affiliate links, so ForexMT4Indicators.com may receive compensation if you register or trade through them, at no additional cost to you. Availability and terms vary by jurisdiction and broker entity.

