Skip to content

runexp

Softball Run Expectancy using Markov Chains and Simulation

v0.2.1 · Mar 21, 2021 · LGPL

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.

Downloads

277

Last 30 days

15168th

683

Last 90 days

2.6K

Last year

Trend: +30.1% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 14, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 13, 2026
ERROR r-devel-linux-x86_64-debian-gcc

examples

Running examples in ‘runexp-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: scrape
> ### Title: Softball Webscraper
> ### Aliases: scrape
> 
> ### ** Examples
> 
> url <-"https://wmubroncos.com/sports/softball/stats/2019"
> test <- scrape(url)
Error in open.connection(x, "rb") : cannot open the connection
Calls: scrape -> <Anonymous> -> read_html.default
Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Dependency Network

Dependencies Reverse dependencies doParallel foreach runexp

Version History

new 0.2.1 Mar 10, 2026
updated 0.2.1 ← 0.2.0 diff Mar 21, 2021
updated 0.2.0 ← 0.1.0 diff Feb 28, 2021
new 0.1.0 Feb 14, 2021