Categories

Monday, April 6, 2015

Play-by-Play Simulator for College Basketball

All season I've been planning on writing a play-by-play simulator for college basketball, and finally have it done for the final game: the national championship. 

Using KenPom's team and player data, I wrote a simulator in Python that aims to reflect the actual flow of a game, including taking into account the following factors:

Factors Considered
Turnover rate (at the team level)
If turnover, whether the defending team had a steal (StealRate). If so, which defensive player stole the ball
If no turnover, which offensive player took the shot (% Shots), and what type (3PA/FGA)
If a foul was committed (FTRate), points scored off free throws (Free Throw %)
Regardless of foul, if shot was made (2PT FG % or 3PT FG %)
If made, whether the shot was assisted (AssistRate) and which offensive player had the assist
If miss, whether the defending team had a block (BlockRate). If so, which defensive player blocked the shot
If miss, whether the miss was rebounded by the offensive team (Off Reb %). Which offensive or defensive player rebounded the miss
If offensive rebound, possession resets

The opening tip is determined by a formula taking into account each team's effective height. An explanation of all of these stats can be found here, by KenPom.

There are still some complexities that I need to add to the simulator:

Qualifiers
If <= 6-point game with less than 90 seconds remaining, the defending team should foul
If 3-point game with less than 35 seconds left, the offensive team should shoot a three
If a player has 3+ fouls in the first half, they should sit until the start of the second
If a player has 4+ fouls, they should sit until <= 4 minutes left in regulation
If a player has 5 fouls, they're removed from the lineup

However, this rough draft should still represent the flow of an actual college basketball game fairly accurately.

Finally, after 10,000 simulations, here are the results for predicting tonight's game:

Final Score: Wisconsin 69.372, Duke 67.170
Wisconsin: 56.03%, Duke: 43.97%
Total: 136.542

Predicted Box Score:


WisconsinPointsReboundsAssists
Kaminsky19.6396.9613.144
Hayes11.9653.7762.053
Dekker14.0753.6511.400
Jackson0.57050.0920.176
Koenig9.23861.3592.636
Dukan4.24931.4870.542
Showalter2.09770.6590.427
Gasser7.53462.9652.071
DukePointsReboundsAssists
Okafor13.9864.9621.409
Winslow11.5945.1632.154
Allen2.58540.4870.218
Cook14.3912.9972.571
T Jones12.2413.2815.785
Jefferson3.73382.1860.507
M Jones7.0911.8201.230
Plumlee1.54550.5270.312

For what it's worth, KenPom's prediction is Wisconsin 70-69, 55%

No comments:

Post a Comment