Skip to content

Leakage through interpolation

Question

A missing feature value is interpolated using the nearest previous and next observation before a backtest. When is this invalid?

Short answer

It is invalid when the next observation was not yet available at the historical prediction time. Use a causal imputation rule fitted or updated from available information, and include missingness indicators when useful. Forward filling can also be invalid if release timestamps are wrong, and can create stale values. Validate the imputation policy as part of the complete pipeline.

Original question and answer written by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question