This function takes in the output of the game level play by play function and returns the same dataframe with six new columns representing the win probability for the home and away team pre and post snap and win probability added. The model used to calculate win probability is a generalized additive model using the expected score differential, time remaining in game, also accounting for the timeouts remaining for both teams. Overtime win probability is calculated separately using the scoring event probabilities.
win_probability(dataset)
(data.frame object) A data.frame as exported from the game_play_by_play function
The input dataframe with the addition of six win probability columns giving the win probability for the possession team, the WPA for each play, the pre and post win probability for both the home and away teams.