Skip to content

Stage 2 · Intermediate · M7

Predicting Tomorrow

In a forecasting contest of 5,507 teams, most could not beat the rule that tomorrow looks like today.

15 lessons · 116 minSteady

About this chapter

A forecast is a guess about a number you have not seen yet, made from the numbers you have. This chapter builds forecasting from pictures you already know: Riyadh's year, a grid that follows the heat, a shop that fills up on Thursday and before Eid. You meet the simple forecasts that are hard to beat, learn to test a forecast the way time runs, give a range instead of one number, and decide when a forecast should not be made at all.

What you will be able to do

  1. 1

    Yesterday Is a Clue

    Read a time series as values in order, and say what the order carries that a shuffled list loses.

    6 min
  2. 2

    Three Things in One Line

    Pull a series apart into trend, season and remainder, and say which of the three a forecast can use.

    7 min
  3. 3

    The Clocks Inside a Series

    Find a season's length by counting from peak to peak, and spot a second clock hiding in the same series.

    7 min
  4. 4

    Tomorrow Looks Like Today

    Make the last-value and last-season forecasts, and use them as the baseline any model has to beat.

    8 min
  5. 5

    Keeping Score

    Score a forecast by its average miss at a stated horizon, and turn that miss into skill against a baseline.

    7 min
  6. 6

    Average the Recent Past

    Forecast with a moving average, choose its window, and tell a line you could draw on the day from one that peeks ahead.

    8 min
  7. 7

    Let Old Days Fade

    Forecast with exponential smoothing, read its weight as how fast old days fade, and pick that weight from the errors.

    8 min
  8. 8

    The Series Predicts Itself

    Fit M1's straight line to a series' own past, choose which past steps it reads, and forecast several steps by feeding forecasts back in.

    9 min
  9. 9

    Two Calendars, One Shop

    Turn the calendar into features, and line up a Hijri season with the Hijri calendar instead of the Gregorian date.

    9 min
  10. 10

    No Peeking

    Split a series by time, and catch the three leaks that forecasting invites: shuffled splits, lags shorter than the horizon, and features built with the future.

    8 min
  11. 11

    Walk Forward

    Test a forecast at several cuts that move forward in time, and compare two models on the average over those folds.

    9 min
  12. 12

    A Range, Not a Number

    Draw a prediction interval, say why it widens with the horizon, and check its coverage on the future it claims to hold.

    8 min
  13. 13

    Big Models Against the Baseline

    Say what forecasting contests found about simple and learned models, and name the settings where a big model earns its place.

    8 min
  14. 14

    Surprises

    Flag an anomaly as a value far from its forecast, clean it before it echoes, and tell a real surprise from an expected holiday.

    8 min
  15. 15

    When Not to Forecast

    Judge whether a series can be forecast with four questions, and say what to offer instead when it cannot.

    6 min

Before you start

Keep going

All chapters