Learn R Programming

runexp (version 0.2.1)

runexp-package: Package runexp

Description

Implements two methods of estimating runs scored in a softball scenario: (1) theoretical expectation using discrete Markov chains and (2) empirical distribution using multinomial random simulation. Scores are based on player-specific input probabilities (out, single, double, triple, walk, and homerun). Optional inputs include probability of attempting a steal, probability of succeeding in an attempted steal, and an indicator of whether a player is "fast" (e.g. the player could stretch home). These probabilities may be calculated from common player statistics that are publicly available on team's webpages. Scores are evaluated based on a nine-player lineup and may be used to compare lineups, evaluate base scenarios, and compare the offensive potential of individual players. Manuscript forthcoming. See Bukiet & Harold (1997) <doi:10.1287/opre.45.1.14> for implementation of discrete Markov chains.

Arguments

Important Functions

  • chain: calculates run expectancy using discrete Markov chains

  • sim: estimates run expectancy using multinomial simulation

  • plot.chain: S3 method for plotting chain output objects

  • prob_calc: calculates player probabilities from commonly available stats

  • scrape: scrapes player statistics from a given URL

Data Files

  • wku_stats: player statistics for the 2013 Western Kentucky University softball team

  • wku_probs: calculated player probabilities for the 2013 Western Kentucky University softball team

References

B. Bukiet, E. R. Harold, and J. L. Palacios, <U+201C>A Markov Chain Approach to Baseball,<U+201D> Operations Research 45, 14<U+2013>23 (1997).

Examples

Run this code
# NOT RUN {
# see "?scrape", "?prob_calc", "?chain" and "?sim" for relevant examples
# }

Run the code above in your browser using DataLab