create_epa: Create EPA Adds Expected Points calculations to Play-by-Play...

Description Usage Arguments Details

View source: R/create_epa.R

Description

Create EPA Adds Expected Points calculations to Play-by-Play data.frame

Usage

1
2
3
4
5
create_epa(
  play_df,
  ep_model = cfbscrapR:::ep_model,
  fg_model = cfbscrapR:::fg_model
)

Arguments

ep_model

(model default cfbscrapR:::ep_model): Expected Points (EP) Model

fg_model

(model default cfbscrapR:::fg_model): Field Goal (FG) Model

clean_pbp_dat

(data.frame required): Clean PBP as input from cfb_pbp_data())

Details

Code Description

1. pred_df

Use select before play model variables -> Make predictions.

2. epa_fg_probs

Update expected points predictions from before variables with FG make/miss probability weighted adjustment.

3. pred_df_after

Use select after play model variables -> Make predictions .

4. join_ep

Join ep_before calcs pred_df with ep_after calcs pred_df_after on c("game_id","drive_id","new_id").

5. kickoffs

Calculate ep_before for kickoffs as if the pre-play assumption is a touchback.

6. wpa_prep

Prep variables for WPA.


saiemgilani/cfbscrapR documentation built on April 11, 2021, 4:57 p.m.