Skip to contents

Computes rolling career value ratings for each player from per-match WPA and ERA values. Uses exponential time decay and Bayesian shrinkage toward a role-specific replacement-level prior.

Usage

calculate_epr(
  format = c("t20", "odi", "test"),
  player_game_data = NULL,
  ref_date = NULL,
  decay_batting = NULL,
  decay_bowling = NULL,
  prior_matches = EPR_PRIOR_MATCHES,
  prior_rate = EPR_PRIOR_RATE
)

Arguments

format

Character. "t20", "odi", or "test".

player_game_data

data.table from load_player_game_data. If NULL, loads automatically.

ref_date

Date. Compute EPR as of this date (NULL = latest + 1 day).

decay_batting

Numeric. Decay constant in days for batting component.

decay_bowling

Numeric. Decay constant in days for bowling component.

prior_matches

Numeric. Prior pseudo-matches for shrinkage.

prior_rate

Numeric. Prior rate (typically 0 = replacement level).

Value

data.table with one row per player:

player_id

Player identifier

role_group

BATTER, BOWLER, ALL_ROUNDER

batting_epr

Career batting value rating

bowling_epr

Career bowling value rating

total_epr

batting_epr + bowling_epr

n_matches, wt_matches

Match count and weighted count