runexp
0.2.1Softball Run Expectancy using Markov Chains and Simulation
Overview
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.
Install
Health
- OK2026-07-0413 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- ERROR2026-07-0112 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
- OK2026-03-1514 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- ERROR2026-03-1413 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
- OK2026-03-1014 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
Documentation
- Examples that run
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- References docs
- 29%
Downloads
Dependencies
Nothing depends on this yet.
Code & Tests
- Cyclomatic complexity
- 8.5 median / 38 max
Test coverage
Line coverage
–
Expression
–
Tests / Examples
–
Functions
14 4 exported
Complexity
11.9 avg / 38 max
Call network
14 nodes / 13 edges
Call graph
Open call graph →Lowest coverage
Per-function coverage is not measured for this package yet.
Datasets
People & History
3 releases. Pick two to compare their code metrics. R releases are shown for context.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.2.1Latest
- 0.2.02021-03-01 · diff ↗
- 0.1.02021-02-15
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-02-15
- Total releases
- 3 / 5 yrs
- License
- LGPL
- Minimum R
- ≥ 3.6
- Bundled data
- 1.9 KB / 2 files
- Download size
- 34 KB
- Installed size
- not tracked yet
- With dependencies
- not tracked yet