Skip to contents

Calculate Per-Game PSV Components: PSV + BatV + BowlV

Usage

calculate_psv_components(
  player_game_data,
  coef_df,
  batv_coef_df,
  bowlv_coef_df,
  exposure_adjust = TRUE,
  center = TRUE
)

Arguments

player_game_data

data.table from load_player_game_data.

coef_df

data.frame with columns stat_name and beta.

batv_coef_df

Coefficient data.frame for the batting model.

bowlv_coef_df

Coefficient data.frame for the bowling model.

exposure_adjust

Logical. If TRUE (default), divide raw counts by balls to get per-ball rates matching the scale coefficients were trained on.

center

Logical. If TRUE (default), subtract per-match mean so PSV represents value above average player in that match.

Value

data.table with psv, batv, bowlv columns.