In my last post I showed how, when faced with limited data, you can use Empirical Bayes (EB) to better evaluate a players three-point shooting. We can apply this same technique to NCAA three-point shooting across top projects in the upcoming NBA draft.
James Wiseman, who missed his only three-point attempt has an EB estimate of 32.9%. His actual shooting percentage had very little impact on his EB estimate. Essentially his percentage was fully regressed to the empirical prior (i.e. league average).
We can see that Wiseman had an EB estimate higher than Anthony Edwards (31.2%), even though Edwards had a higher 3P% (29.4%) - but do we really think Wiseman is a better three-point shooter? What else do we know about these players?
As a Bayesian, we should define our priors about three-point shooting.
- Good shooters are good shooters1 (i.e. Higher FT% = Higher 3P%)
- You only get to shoot 3s if you can - there are always exceptions (i.e. Higher 3PAR = Higher 3P%)
While still small sample sizes, we can take advantage of having slightly more data on FT% and 3PAR - let's see how Wiseman and Edwards stack up in these other areas.
Edwards was a better free-throw shooter (77.2% vs. 70.4%). He also had a significantly higher 3PAR (0.485 vs. 0.039). Based on these additional data points, our assumption is that Edwards is probably a better three-point shooter.
Now how can we factor this additional information into our prior…Bayesian hierarchical modeling!
Bayesian hierarchical modeling is a statistical model written in multiple levels (hierarchical form) that estimates the parameters of the posterior distribution using the Bayesian method. The sub-models combine to form the hierarchical model, and Bayes' theorem is used to integrate them with the observed data and account for all the uncertainty that is present.
There are many different ways to approach hierarchical modeling. You could extend our previous empirical bayes approach as described here (which might include using the ebbr package). However, if you are anything like me, once you get a taste of Bayesian statistical modeling you will quickly find yourself deep down a rabbit hole - exploring all the different probabilistic programming frameworks out there, such as PyMC and Stan.
For a basic introduction, you can find sports related examples like analyzing NFL 4th down attempts or predicting rugby outcomes. For a more in-depth understanding, I recommend reading more about multilevel modeling, complex hierarchical modeling, or scaling your model via variational inference.
Now back to apply our problem! As I said, there is no single right way to setup a hierarchical model. It is also worth mentioning that I'm relatively new to Baysian modeling so I won't claim to know what is actually best (feedback please!). With that out of the way, one approach is to use a hierarchical prior based on a players FT% and 3PAR quartile. Using PyMC3 I am able to model three-point shooting as a beta binomial distribution (I'll repeat - feedback from any experts please!).
One benefit of using Bayesian modeling tooling, is that with a few lines of code you get pretty charts like this.
You can also calculate a credible interval to see how the expected distribution changes based on your different groups (in our case FT% and 3PAR quartiles).
In the chart above we can see how players with a high FT% and 3PAR (like Anthony Edwards) have a higher credible interval distribution than a player with above average FT% but low 3PAR (like James Wiseman).
|name||team||3p% (hierarchical)||3p% (eb)||3p% (actual)||3pm||3pa|
The hierarchical model pulls Wiseman's estimate toward a more informed prior, which makes his three-point shooting estimate now much lower than that of Edwards (25.6% vs. 30.2%).
Below we can see what the hierarchical model infers about 2020 college performances from the ESPN Top 60 in the upcoming draft.
|espn||name||team||3p% (hierarchical)||3p% (eb)||3p% (actual)||3pm||3pa||ft%||3par|
|41||Desmond Bane||Texas Christian||0.419||0.381||0.442||92||208||0.789||0.477|
|30||Cassius Winston||Michigan State||0.408||0.371||0.432||73||169||0.852||0.409|
|29||Jahmi'us Ramsey||Texas Tech||0.395||0.367||0.432||60||139||0.641||0.415|
|8||Tyrese Haliburton||Iowa State||0.394||0.36||0.419||52||124||0.822||0.508|
|57||Kaleb Wesson||Ohio State||0.38||0.358||0.425||45||106||0.731||0.346|
|16||Devin Vassell||Florida State||0.37||0.356||0.415||44||106||0.738||0.361|
|38||Malachi Flynn||San Diego State||0.366||0.349||0.373||76||204||0.857||0.489|
|26||Robert Woodard||Mississippi State||0.363||0.352||0.429||30||70||0.641||0.255|
|14||Cole Anthony||North Carolina||0.341||0.337||0.348||49||141||0.75||0.409|
|12||Patrick Williams||Florida State||0.327||0.329||0.32||16||50||0.838||0.242|
|49||Reggie Perry||Mississippi State||0.318||0.329||0.324||23||71||0.768||0.194|
|40||Xavier Tillman||Michigan State||0.282||0.319||0.26||13||50||0.667||0.167|
|27||Isaiah Stewart II||Washington||0.274||0.324||0.25||5||20||0.774||0.059|
|32||Vernon Carey, Jr.||Duke||0.264||0.334||0.381||8||21||0.67||0.061|
Below are some notable players that I thought stood out:
- Vernon Carey - He shot a good percentage for a big (38.1%) but he only had 21 attempts and his lower FT% and 3PAR might make us reconsider how much of his shooting was due to luck.
- Tyler Bey - Similar to Carey, Bey shot extremely well on the season (41.9%) but he only had 31 attempts and with a low 3PAR, the numbers say he might have been closer to a 30.9% shooter over a larger sample.
- Ashton Hagans - With such a high FT% (81%), the hierarchical model suggests that Hagans had some bad luck and is a better three-point shooter than his percentage (25.8%) would indicate.
In summary, a hierarchical model is more complex than basic empirical bayes - however the added complexity allows us make to more accurately adjust our prior by incorporating additional information.