Skip to contents

Applies three sets of glmnet coefficients to decompose PSR into batting value (BatV) and bowling value (BowlV).

Usage

calculate_psr_components(
  ratings,
  coef_df,
  batv_coef_df,
  bowlv_coef_df,
  center = TRUE
)

Arguments

ratings

data.table with {stat}_rating columns from estimate_player_stat_ratings.

coef_df

data.frame with columns stat_name and beta. Optionally sd for standardization.

batv_coef_df

Coefficient data.frame for the batting model.

bowlv_coef_df

Coefficient data.frame for the bowling model.

center

Logical. If TRUE (default), subtract league mean so PSR represents value above average.

Value

data.table with psr, batv, bowlv columns. BatV + BowlV = PSR (enforced via additive shift).