The Expected Score Chapter 5 · Time

Chapter 5

Time



Players change. A 22-year-old gets better every season, a 35-year-old gets worse, and anyone can come back from an injury a step slower. Chapter 4 ended with the opposite problem: one season of data isn’t enough to tell Nikola Jokić from an average player with any confidence. These pull in opposite directions. More seasons of data mean better estimates of the player as they were, and worse estimates of the player as they are. This chapter resolves the tension the standard way, by weighting old games less, and then deals with a second thing that changes over time: the league itself.

5.1 Exponential decay

Definition 5.1 (Decay weights). On a fit day t, a segment played on day t_s < t has age a_s: the days from t_s to t, not counting the breaks between seasons. Its weight in Equation (4.1) is multiplied by

w_s = 2^{-a_s / h} ,(5.1)

where h is the half life, in days. Segments older than 8h, whose weights are below 1/256, are left out.

A break runs from a season’s last game, the end of the Finals, to the next season’s first, usually about 128 days. Leaving it out means the clock only runs while games are played, so a season, from opening night to the Finals, is about 237 days long.

So Equation (4.1) becomes \sum_s w_s n_s (r_s - x_s^\top\beta)^2 plus the penalty. yarapm uses h = 240 days, about one season: a game from a season ago counts half as much as one from last night, and one from two seasons ago a quarter. Figure 5.1 shows the weights.

0 1 2 3 4 5 6 7 8 0 0.25 0.5 0.75 1 age of the game, seasons (240 days) weight ½ after a season (a) ratings: half life 240 days 0 7 14 21 28 35 42 49 56 0 0.25 0.5 0.75 1 age of the game, days (b) league level: 7 days
Figure 5.1. (a) The weight of a game in the ratings, by its age: it halves every 240 days of the season, about a season, and games over eight seasons old are dropped. (b) The weight of a game in the league’s level (Section 5.2), which halves every week of calendar time.

Why exponential, and not, say, the last two seasons equally? Two reasons. The first is that it has no edge: a game doesn’t go from counting fully to not counting at all on one particular day, which would make ratings jump when a big game falls out of the window. The second is that it’s the only weighting that doesn’t depend on when you look.

Proposition 5.2. Moving the fit day forward by \Delta days multiplies every existing segment’s weight by the same factor, 2^{-\Delta/h}.

Proof. 2^{-(a + \Delta)/h} = 2^{-\Delta/h}\, 2^{-a/h}.∎

So between one day and the next, the relative weights of all old games are unchanged, and the only things that change are that the new day’s games arrive at full weight and everything older counts a little less compared with them, and with the penalty. That makes the day-to-day change in the ratings small and smooth, which is what makes the warm starts of Section 4.6 work.

How much data does a half life of a season amount to? Integrating the weights, \int_0^{8h} 2^{-a/h}\, da = \frac{h}{\ln 2}\left(1 - 2^{-8}\right) \approx 1.44\,h , so with h = 240 the fit has the weight of about 345 days of games at full strength: roughly a season and a half, spread over eight. For a regular who plays 5,000 possessions a season, that’s about 7,000 possessions of weight, against a penalty of 3,000 (Exercise 5.1).

Example 5.3. The half life was chosen like the penalty, by walk-forward testing. With \lambda = 3{,}000 and no box-score prior, predicting 2021–2024 with weekly refits, the margin RMSE was 13.776 points with a half life of 180 days, 13.717 with 365, 13.706 with 730 and 13.715 with 1,460. Again the minimum is broad. A half life of half a season is clearly too short, throwing away data the model needs, and anything from one to four years is about the same. With the box-score prior, 365 days did slightly better than 730.

Those half lives were in calendar days, and they had a side effect. The summer between seasons is four months long, so on opening night every game counted about 20% less than it had at the Finals, while the penalty pulling each player toward their prior stayed the same. Every rating was pulled toward its prior without a game being played, and most for players with little data: Day’Ron Sharpe’s rating fell by 0.4 to 0.5 points over each of the last two summers. Counting only days in the season, with a half life of 240 days to keep about the same memory, predicted 2021–2024 just as well (a daily margin RMSE of 13.570, against 13.568 with 365 calendar days), and the summer drop is gone. That’s the default.

5.2 The league’s level

Players aren’t the only things that change. Figure 1.1 showed the league’s efficiency rising by nine points per 100 possessions over a decade, and Figure 5.2 shows that it moves within a season too, by as much as the gap between a good team and an average one.

104 107 110 113 116 points per 100 possessions Oct Nov Dec Jan Feb Mar Apr 2022 2024 2026
Figure 5.2. The league’s points per 100 possessions in each month of the regular season, in three seasons. In 2022 it rose almost ten points from October to April; in 2024 it peaked in December and fell four points by April; 2026 was nearly flat.

In 2022, scoring rose from 105.6 points per 100 possessions in October to 115.3 in April. In 2024 it went the other way after the new year, from 116.7 in December to 112.7 in April. A model whose sense of the league’s average lags by a few months will be off by several points a game in total, even if every player is rated perfectly.

The regression of Chapter 4 has a season offset for each season, but it can’t follow this. An offset is one number for a whole season, and it’s penalized, so early in a season it barely moves. yarapm instead estimates the level separately, after the ratings, with a much shorter memory.

Definition 5.4 (The league’s level). Given the fitted ratings and covariates, let \rho_s be segment s’s predicted rate with the intercept and season offsets left out: its players’ ratings, home court and the playoff term. The level on day t is the points per 100 possessions those don’t explain, averaged with weights v_s = 2^{-a_s/7} that halve every week:

\ell = 100\, \frac{\sum_s v_s\, (y_s - n_s\, \rho_s / 100)}{\sum_s v_s\, n_s} .(5.2)

Predictions use \ell in place of the intercept and season offset. Since the ratings and the level are fit separately, the ratings still learn from eight years of games, while the level follows the last few weeks. This mattered for totals, not margins: the level is the same for both teams in a game, so it cancels out of the margin. Tuning its half life on total points (Chapter 8), the total RMSE was 18.66 with a 60-day half life, 18.58 with 30, 18.51 with 14 and 18.50 with 7, and before this estimate existed, totals after the trade deadline were off by 3 to 8 points a game in some seasons.

There’s a subtlety at the start of a season. In late October, the newest games are last spring’s playoffs, months old, and with a seven-day half life the weights of all of them are tiny. But Equation (5.2) is a ratio, so only their relative weights matter, and the level on opening night is essentially the level of the last few weeks of the previous season, with the playoff term taken out.

In the code. decay() is one line. The ages, without the breaks between seasons, come from History.age(). The cutoff at eight half lives is applied in SQL, before any rows are read (lineups()), so a fit reads only the segments that still matter: eight seasons of them, about 570,000 rows. The level is computed right after the ratings, in PlayerRatings.fit, from the same rows reweighted with the seven-day half life. Because Proposition 5.2 makes a day’s change in the weights a single factor, yesterday’s ratings are a good starting point for today’s solve, which is why each day’s fit is warm-started from the last.

Exercises

Exercise 5.1. A player has played 5,000 offensive possessions in each of the last eight seasons, spread evenly through each one. Approximately what is the total decayed weight of their possessions with h = 240, if a season is 240 days long? By Theorem 4.2, what share of their rating comes from the data rather than the prior? What if they’re in their second season?

Exercise 5.2. Show that if a weight function w(a), with w(0) = 1, has the property of Proposition 5.2 for every a and \Delta, then w(a) = c^a for some constant c. (Hint: w(a + \Delta) = w(a)\, w(\Delta).)

Exercise 5.3. Show that the level \ell cancels out of a game’s predicted margin when both teams have the same number of possessions. Why does a seven-day half life hurt the ratings if it’s used for them too?

Exercise 5.4. Using nba.team_game_logs, compute the league’s points per 100 possessions by month for the 2027 season so far. Is it above or below the level of April 2026, 116.8?