Description Usage Arguments Details Value Examples
Model for a team's winning percentage
1 | exWPct(rs, ra, exponent = 2)
|
rs |
A numeric representing Runs Scored |
ra |
A numeric representing Runs Allowed |
exponent |
A numeric representing the desired exponent |
An implementation of Bill James's Pythagorean formula for a team's expected winning percentage as a function of their runs scored and runs allowed.
A value of expected winning percentage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # For a .500 team
exWPct(750, 750)
# Find the partial derivatives
library(mosaic)
slope.rs = D(exWPct(rs, ra, exponent = 1.83) ~ rs)
slope.ra = D(exWPct(rs, ra, exponent = 1.83) ~ ra)
# How many wins is one run in a 700 run environment?
runsPerWin = makeFun(1 / (162 * slope.rs(r, r)) ~ r)
runsPerWin(700)
# In what run environment is 10 runs equal to 1 win?
runsPerWin(742)
# Plot Runs per Win
plotFun(runsPerWin(r) ~ r, r.lim = c(300, 1200)
, xlab = 'Runs Environment per 162 games'
, ylab = 'Runs per Win')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.