To create a metric for analyzing team defensive efficiency that takes into account the location of shots taken.
We’ll use a Generalized Additive Model (GAM):
Smooths over the variance seen in binning to provide a continuous surface of expected points per shot taken.
Less susceptible to noise, captures the broad spatial trends of a defense.
We can use GAMs to create a new metric, EPx, representing the Expected Points a defense allows per shot taken at a point x.
We use the mgcv package in R to fit our GAMs based on the score_value (0, 2, or 3) of any shot taken as a function of its x and y coordinates on the half court. We use play-by-play data accessed via hoopR:
Using this GAM, we can create a heatmap for the league-average EPx at any location on the court.
2023-24 League-Average EPx heatmap. Yellow: most efficient, Purple: least efficient
2023-24 Season
2001-02 Season
Were offenses worse or defenses better in 2001-02?
We can also create Comparison GAMs by running a model for each team defense in the NBA, and then subtracting the league average from each team’s map.
These heatmaps are useful for seeing at a glance where a team has weaker than league average defense.
(Red = Vulnerable Area, Blue = Strong Area.)
Let us define a number of specific zones on the court to compare defenses on:
Around the rim
Left/Right Corner 3s
Left/Right Wing 3s
Left/Right Midranges
The Parking Lot
Now let us take a look at the Team EPx - League EPx for our defined zones.
Note that Team EPx - League EPx being a negative value means a team allows that many fewer points on average per shot taken in the zone!
| Zone | League Avg EPx | Dallas EPx | Δ DAL | Houston EPx | Δ HOU | Milwaukee EPx | Δ MIL |
|---|---|---|---|---|---|---|---|
| Rim | 1.362 | 1.384 | 0.023 | 1.292 | -0.069 | 1.403 | 0.041 |
| L Corner 3 | 1.171 | 1.177 | 0.006 | 1.267 | 0.096 | 1.147 | -0.023 |
| R Corner 3 | 1.203 | 1.263 | 0.059 | 1.061 | -0.142 | 1.153 | -0.050 |
| L Wing 3 | 1.133 | 1.157 | 0.024 | 1.065 | -0.068 | 1.063 | -0.069 |
| R Wing 3 | 1.145 | 1.087 | -0.058 | 1.037 | -0.108 | 1.025 | -0.120 |
| L Midrange | 0.906 | 0.956 | 0.050 | 0.924 | 0.018 | 0.958 | 0.052 |
| R Midrange | 0.887 | 0.903 | 0.016 | 0.957 | 0.069 | 0.897 | 0.009 |
| Parking Lot | 0.262 | 0.606 | 0.344 | 0.843 | 0.581 | 0.339 | 0.077 |
(Red = Vulnerable Area, Blue = Strong Area.)
Comparison of 2023-24 Zonal EPx on Left vs. Right Corner 3s
Opponent Scouting
Self-Scouting
Player Evaluation
Defender Context
Game State
Foul/Possession Data