prob_calc {runexp}R Documentation

Calculates player probabilities given players' game statistics.

Description

Uses player statistics to calculate the probability of six possible at bat outcomes (walk, single, double, triple, homerun, or out). Also estimates the probability of a player attempting a steal (SBA) and succeeding in an attempted steal (SB). Player game statistics are commonly available on team's public webpages.

Usage

prob_calc(playerData)

Arguments

playerData

data frame of the players statistics (details below)

Details

The playerData data frame must contain the following columns of player statistics:

Plate appearances (PA) are calculated as AB + BB + HBP. The player probabilities are calculated as:

Probabilities calculated from limited at bats will not be very useful. Note, this function does not assign TRUE/FALSE values for fast players. These may be manually assigned or will be assigned based on SBA probability when chain or sim functions are called.

SBA (Stolen Base Attempt) is the probability a player will attempt to steal given they are on first base and there is no runner on second. As a default, we estimate a player's SBA probability using a rough thresholding rule based on the team's overall SB probability and the player's SB probability. Essentially, we group the players into three categories:

We recommend reviewing these default probabilities before proceeding with run expectancy calculations.

Value

a dataframe of the players' probabilities for W, S, D, TR, HR, O, SBA, and SB

Examples

probs <- prob_calc(wku_stats)   # probs corresponds to wku_probs


[Package runexp version 0.2.1 Index]