Residual Leakage and Whiteness Check¶
A residual diagnostic — instantiates Model-Guided Signal Separation
Tests whether what's left after extraction is structureless noise — leftover pattern in the residual means the target leaked out or nuisance leaked in.
Residual Leakage and Whiteness Check is a diagnostic on the leftover, not a separator itself. After some extraction has run, it asks whether the residual — what was removed, or what remains beside the recovered estimate — is white: free of autocorrelation and uncorrelated with the target. Structure in the residual is evidence the separation went wrong in one of two directions: either target energy was thrown away (it leaked out into the residual) or nuisance was left behind (it leaked in to the estimate). What makes it this mechanism and not its siblings is that it produces a verdict against a threshold, never a cleaned signal, and it is separator-agnostic — the same check runs on the output of any extraction mechanism in the family.
Example¶
An analyst fits a model to a weekly demand series and, before trusting its forecast, tests the residuals for autocorrelation with a Ljung–Box test. If the residuals were pure noise, no lag would show structure. Instead a significant spike appears at lag one: the residuals still carry predictable week-to-week structure, which means the model left real signal on the table — the target leaked into the residual. The finding points at the model, not the threshold: the fix is a better model, not a looser cutoff. Had the test come back clean, it would license only a modest claim — that no obvious structure remains — not that the extraction is correct.
How it works¶
The residual is formed (observation minus reconstructed nuisance, or the leftover beside the estimate) and then tested two ways: for whiteness in itself — autocorrelation, spectral flatness — and for correlation with the recovered target. Any structure exceeding the significance threshold is flagged as leakage. Its distinguishing limitation is precise: it detects leakage, the presence of leftover structure, but says nothing about amplitude bias, and it never touches the separator that produced the residual — it only judges the output.
Tuning parameters¶
- Whiteness statistic — which test is used (lagged autocorrelation, a portmanteau statistic, spectral flatness); each is sensitive to different leftover structure.
- Significance threshold — how strong a pattern counts as leakage; strict thresholds catch subtle leaks but raise false alarms on clean residuals.
- Lags and bands examined — how far out in lag or frequency to look; too narrow a window misses long-range leakage.
- Autocorrelation vs. target-correlation — whether to test the residual against itself or against the recovered signal; the latter catches leaked target energy specifically.
When it helps, and when it misleads¶
Its strength is that it is a cheap, sharp falsifier of "the output looks clean" — a failed whiteness test is hard evidence the separation is wrong, and it costs almost nothing to run. It misleads when over-read: passing whiteness is necessary but not sufficient, because a wrong model can still leave white residuals, and the check sees leakage but not the amplitude bias an injection test would catch.[1] The classic misuse is treating a passed check as proof that the recovered signal is real and unbiased. The discipline is to pair it with a Signal Injection–Recovery Test and to never rest the verdict on a single statistic.
How it implements the components¶
residual_diagnostic_record— it produces the record of residual tests run and the verdicts they returned.residual_pattern_target— it specifies the leftover structure — autocorrelation, target-correlation — whose presence signals leakage.evidence_threshold— it declares "leakage" versus "clean" against a significance threshold on the test statistic.
It separates nothing itself, so the operator components belong to the separators such as Deconvolution and Inverse Filtering and Regression Residualization; validating extraction by injecting a known signal is a different test — Signal Injection–Recovery Test.
Related¶
- Instantiates: Model-Guided Signal Separation — the leakage diagnostic applied to a separator's output.
- Consumes: the estimate and residual produced by any separation mechanism in the family.
- Sibling mechanisms: Signal Injection–Recovery Test · Kalman or Particle Filter · Regression Residualization · Deconvolution and Inverse Filtering · Signal/Noise Review · Held-Out Sample Test
Notes¶
Whiteness is necessary but not sufficient: white residuals rule out obvious leakage, but they do not confirm the target is present or unbiased. That is precisely why the check pairs with Signal Injection–Recovery Test, which measures whether a known signal returns intact — the two look at opposite sides of the same output, and a pipeline can pass one while failing the other.
References¶
[1] The Ljung–Box and Durbin–Watson tests are standard checks for autocorrelation in regression or time-series residuals: they ask whether the residuals are serially uncorrelated (white). A significant statistic indicates leftover structure the model failed to capture — the residual is not noise — which is direct evidence of leakage in an extraction setting. ↩