You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add pa_hold(): bookmaker margin from quoted odds #2
The package converts odds (pa_american_to_decimal, pa_implied_prob in R/odds-utils.R) and removes the margin (pa_devig() in R/devig.R, which exposes the overround as an attribute), but there is no direct way to ask the everyday question: how much margin is in this market's prices? Add pa_hold().
Semantics: takes the quoted odds for ALL outcomes of one market (both sides of a total, three outcomes of a soccer match) and returns a single number, the bookmaker hold, e.g. pa_hold(c(-110, -110), odds_format = "american") is about 0.0476.
Validation mirrors pa_devig(): exactly one of odds or probs, at least 2 outcomes, probabilities strictly in (0, 1). Reuse pa_implied_prob() for the conversion rather than duplicating it.
Full roxygen block in the style of the neighboring functions, with @examples covering a 2-way and a 3-way market, plus a NEWS.md entry. Regenerate NAMESPACE with roxygen so the export lands.
Acceptance criteria
pa_hold(c(-110, -110), odds_format = "american") returns approximately 0.0476.
Activity