maksimhorowitz / nflscrapR

R Package for Scraping and Aggregating NFL Data
522 stars 139 forks source link

EPA problem on QB kneels before halftime #140

Open TheMathNinja opened 4 years ago

TheMathNinja commented 4 years ago

It looks like QB kneels are frequently being credited with +/- 0.815 EPA before halftime when the next play is a kickoff and touchback. My understanding is that the EPA model is supposed to be self-contained within a half, and therefore the EPA of a kneel should be 0, rather than crediting the kneel with the positive or negative EPA starting the second half. It appears as though this is just one of the strange symptoms of last-play-of-first-half EPA carrying over into the second half.

sventura commented 4 years ago

If you have a couple of specific examples of this that we can reproduce, that might help.

TheMathNinja commented 4 years ago

You got it. For the 2018 season, for example, plays: 2187 of game 2018090600 2203 of game 2018090906 2255 of game 2018090905, 1869 of game 2018090903 were all QB kneels with 0.815 EPA.

Plays 2053of game 2018090910, 2047 of game 2018091000, 2249 of game 2018091608, 2225 of game 2018091606, were all -0.815 EPA.

But this specific result (+/- 0.815 EPA on a QB kneel) is just when the next kickoff results in a touchback. Many other plays before the half are still affected (QB kneels or not). For example on play 2440 of game 2018090900, there's an 8 yard completion at the end of the half at midfield, which is totally inconsequential. But because the EP of the play was 1.41 and the EP of the second half kickoff is 0.815, the play is credited -0.596 EPA rather than -1.41 EPA. (Though I found the FG and TD probabilities quite high for 5 seconds left at the 45 yard line, and 1.41 seemed high for EP as it was).