Granthara03.03.05Look-ahead bias: the mistake you cannot see

03.03.05 · Look-ahead bias: the mistake you cannot see

PreviouslyA list of today's companies was selected by history for having survived.

Knowing on Tuesday what was filed in May.

The quarter ended on the thirtieth. The numbers reached the exchange forty-one days later. A test that used them on the thirtieth did not cheat, and nobody wrote a line of dishonest code — it simply read a figure off a row dated the thirtieth, because that is the date the row carries.

Survivorship leaves things out. This puts things in — on days they did not exist.

Updated

45 days
The gap a results row hides between its date and its filing
Part 03 · Data Literacy: Trusting What You See
  1. 03.03.01 Adjusted vs unadjusted prices
  2. 03.03.02 Split, bonus, and dividend adjustment errors
  3. 03.03.03 Continuous vs contract data (futures)
  4. 03.03.04 Survivorship bias in historical screens
  5. 03.03.05 Look-ahead bias: the mistake you cannot see
  6. 03.03.06 Where to source clean data, and how to verify it
0 of 6 read
Learn

The date on the row is not the date you knew

01.08.02 established the clock: a listed company files its quarterly results within 45 days of the quarter ending, and its annual results within 60. Until that filing appears, the numbers are unpublished price-sensitive information, and 01.08.03 established what may not be done with those.

Now look at how the data arrives. A financial database stores that quarter's revenue and profit against the period — the quarter that ended on the thirtieth — because that is what the figures describe. The date it was actually knowable is a different field, and it is often missing.

Join that table to a price series by date and the test now reads the quarter's profit on the quarter's last day. It has become an investor who reads results up to six weeks before they are filed. Every position it takes on that knowledge is one nobody could have taken.

See it

Five things a test can know too early

Each one is ordinary data used on an ordinary date. Tap each to see when it was really available.

None of these requires a mistake in the code. Each is the natural result of joining two tables on a date.

Learn

Why it is the mistake you cannot see

A survivorship problem can be found by asking what is missing. Look-ahead cannot, because nothing is missing and nothing is wrong. Every number is correct, correctly attributed to the period it describes, sitting on the date that period ended.

It also improves results rather than breaking them, and a result that looks good invites far less inspection than one that looks broken. The test runs, the numbers are excellent, and the excellence is the symptom.

The reliable tell is behavioural: the result degrades sharply when you add the lag. If shifting fundamental data to its filing date, or acting one bar later, turns a strong result into an ordinary one, the strength was in the timing, not the idea.

The clocks a test is allowed to read
Quarterly results
available at filing, within 45 days of the quarter end
Annual results
within 60 days of the year end
Shareholding pattern
within 21 days of the quarter
A board decision
30 minutes after the meeting ends
A session's close
after that session has closed
0of these dates is the date on the row
lagthe whole of the fix
Try it

A test buys companies whose quarterly profit grew, using profit dated to the quarter end, and returns an exceptional result. You re-run it with each figure lagged to its filing date and the result becomes ordinary. What have you learned?

Try it

Could a test have known this, on the date it used it?

A quarter's profit, on the last day of that quarter
Yesterday's closing price, this morning
That a company would be added to an index next month
A board's dividend decision, an hour after the meeting
A revenue figure as later restated, on the original publication date
A company's shareholding pattern, 30 days after the quarter

One field fixes most of it

For every fundamental figure, store the date it became public beside the period it describes, and join on that date rather than the period. It is one extra column and it removes the largest source of look-ahead in ordinary work. For prices, the equivalent is one rule: decide on a completed bar, act on the next one. Neither is clever. Both are the difference between a test of an idea and a test of hindsight.

Five lessons of ways data misleads. The last one is the practical answer: where the numbers come from in the first place, and the checks that tell you whether yours survived the journey.

Remember

Look-ahead bias is data used on a date it was not yet public — most often a results figure read on its period end rather than its filing date up to 45 days later — and because every number is correct and the result improves, the only reliable tell is that the result collapses once the lag is added.

Everything this chapter has told you, in order

  1. 03.03.01A bonus leaves two true histories — the prices that traded and the prices restated into today's units — and neither announces itself.
  2. 03.03.02A fall of exactly one half on a quiet day is arithmetic, not news: the ex-date is the only boundary an adjustment may use.
  3. 03.03.03Every price on a continuous futures chart is real; the line joining them is not, and its old levels never traded.
  4. 03.03.04Today's list was selected by history for surviving, so a test on it cannot fail on a company that no longer has a name.
  5. 03.03.05Every number is correct and the result improves, so the only tell is that it collapses once the lag is added.
Next
03.03.06 — Where to source clean data, and how to verify it

Next: where clean data comes from, and the checks that prove yours is.