Look-ahead Bias

Also known as: lookahead bias, look-ahead.

A study error where information that was not yet available at the time of a decision is used to evaluate that decision.

Synthetic dataExamples on this page use synthetic data created for illustration.

Not adviceThis is educational material. It is not investment, business or other professional advice.

Definition

Look-ahead bias occurs when an analysis uses information that was not yet available at the time being simulated. The method is then judged on facts its real-time user could not have known, so the test result looks better than any real use could achieve.

In plain terms

Imagine grading last year’s weather forecast while holding tomorrow’s newspaper. The forecast would look brilliant, and the grade would mean nothing.

Historical tests make this mistake easily because the whole past is sitting in the dataset at once. Common sources are:

  • using final, revised numbers where only preliminary ones existed at the time;
  • stamping a record with the date of the event instead of the date it was published;
  • computing a statistic, such as an average used for scaling, over the full sample instead of only the data before each decision;
  • using today’s list of items (for example, today’s members of a group) to study the past.

Example

The timeline below is synthetic.

StepDate
Quarter endsMar 31
Company publishes the quarter’s earningsMay 12
Test enters a position “after the earnings beat”Mar 31 (as recorded in the dataset)

The dataset stamps the figure with the quarter-end date. The test therefore acts six weeks before the information was public. Re-running it with the publication date as the earliest usable moment (see Point-in-Time) usually shrinks or erases the apparent edge.

Common misunderstandings

  • “I only used rows from the past.” Past rows can still have been corrected later. Using the corrected version is look-ahead.
  • “A train/test split protects me.” Only if every step, including feature scaling and parameter choices, respects the split.
  • “It is the same as overfitting.” They are different errors that often occur together. Overfitting inflates results by fitting noise; look-ahead inflates them by importing the future.

References

  1. Marcos López de Prado. Advances in Financial Machine Learning . Wiley, 2018. ISBN 978-1119482086.
  2. David H. Bailey, Jonathan M. Borwein, Marcos López de Prado, Qiji Jim Zhu. The Probability of Backtest Overfitting . The Journal of Computational Finance, 2016. DOI: 10.21314/jcf.2016.322