Skip to contents

Fit a Ridge-Regression RAPM Model from WNBA Possession Data

Fit a Ridge-Regression RAPM Model from WNBA Possession Data

Usage

wnba_rapm(possessions, ...)

Arguments

possessions

A possession-level stint matrix as produced by wnba_possession_lineups(), with columns off_player_1 through off_player_5, def_player_1 through def_player_5 (integer WNBA Stats person IDs), and points (numeric, points scored on that possession).

...

Reserved for future keyword arguments (currently ignored).

Value

Returns a data.frame with one row per player:

col_nametypesdescription
player_idintegerWNBA Stats person ID. Rows are sorted ascending by player_id.
o_rapmnumericOffensive RAPM (per-100-possession points added on offense). Positive = better offensive player.
d_rapmnumericDefensive RAPM (per-100-possession points saved on defense). Positive = better defensive player (sign is flipped so good defense is positive).
rapmnumericTotal RAPM = o_rapm + d_rapm. Positive = net positive impact.
off_possintegerNumber of possessions the player appeared on offense.
def_possintegerNumber of possessions the player appeared on defense.

Returns a 0-row frame with the same schema when input is empty or all possessions have NA lineup cells (never-raise).

Note: RAPM is expressed in per-100-possession units. A full season of possessions (~3,000-5,000) is needed for statistically meaningful estimates. Results from a single game (~120-200 possessions) are highly unstable and are provided here for pipeline illustration only.

Values are relative to average: an unpenalized intercept absorbs the mean points per possession, and every player's coefficient gets the same ridge penalty (glmnet standardize = FALSE), so o_rapm and d_rapm each sum to 0 across players. Possession-weighted means are usually near 0 but are not guaranteed to be. Every possession has five offensive and five defensive players, so the data do not pin down the absolute level of o_rapm, d_rapm or rapm; that level is a convention of the ridge fit. What the data identify are differences between players, to the extent the lineups separate them.

Results are deterministic: the cross-validation uses fixed, construction-based folds (not random), so repeated calls on the same possessions return identical output with no need to set a seed.

Author

Saiem Gilani