Predict Tomorrow
The robot looks at the last few days and learns a recipe for the next one. Can it beat the lazy guesses: same as yesterday, or same as last week?
Slide Days it remembers. With only 1 day it cannot see the weekly rhythm. With 7 or more, it can!
Visitors at the park
what we knewwhat really happenedrobot (AR)same as yesterdaysame as last week
These days are the hidden exam: the robot never saw them while learning.
Challenges
Beat yesterday: remember 7 or more days and have a smaller miss than 'same as yesterday' when predicting 1 day ahead.
Forgetful robot: remember only 1 or 2 days and watch 'same as last week' win when predicting 7 days ahead.
Look far ahead: predict 10 or more days ahead and see the robot miss by more than it did for 1 day.
Perfect memory size: choose the number of days that gives the lowest average miss across all 14 horizons (within 5%).
What just happened?
- The robot learned a recipe: tomorrow is a weighted mix of the last few days. It found the weights by trying to fit the old data as closely as possible.
- With a memory of 7 or more days it can see that Saturday is busy, so it beats the lazy guesses.
- To look further ahead it feeds its own guesses back in, so small mistakes pile up. The further ahead, the bigger the miss.
- 'Same as yesterday' ignores the weekly rhythm. 'Same as last week' uses it, and is surprisingly hard to beat. Always check a fancy model against simple guesses!
- The exam days were hidden while learning, so the scores are honest.
For grown-ups: what's really going on
This is an autoregressive model AR(k): yt = c + a1yt−1 + … + akyt−k + ε. The coefficients are fitted by ordinary least squares on the training part (first 154 days) by solving the normal equations (XᵀX + λI) a = Xᵀy with a tiny ridge term for stability.
- Multi-step forecasts are recursive: the prediction for day t+1 is fed back as an input for day t+2, so errors compound with the horizon.
- Baselines: naive (
ŷt+h = yt) and seasonal naive (ŷt+h = yt+h−7). A model that cannot beat them is not worth deploying. - Evaluation is a rolling-origin backtest: for every origin day in the hidden last 42 days, forecast up to 14 days ahead from the data before it and average the mean absolute error per horizon. Time series must be split by time, never shuffled, or the future leaks into training.
- The series has a weekly shape, a slow level that wanders, and correlated noise. A fixed AR recipe cannot track wandering levels perfectly, which is why seasonal naive can stay competitive; real tools add differencing (ARIMA), seasonal terms (SARIMA) or exponential smoothing (ETS).
Further reading: Hyndman and Athanasopoulos, Forecasting: Principles and Practice, ch. 5 and 9.