Skip to contents

Computes the Kelly stake fraction for a bet: the share of bankroll that maximizes long-run log growth given your estimated win probability and the quoted odds. Negative Kelly fractions (no edge) are clamped to 0. Matches the semantics of ParlayAPI's keyless /v1/calc/kelly endpoint.

Usage

pa_kelly(
  prob,
  odds,
  odds_format = c("decimal", "american"),
  fraction = 1,
  bankroll = NULL
)

Arguments

prob

Numeric vector of estimated win probabilities in (0, 1).

odds

Numeric vector of quoted odds for the bet.

odds_format

"decimal" or "american".

fraction

Kelly multiplier, e.g. 1 for full Kelly, 0.5 for half Kelly.

bankroll

Optional bankroll amount. When supplied, the return value is the recommended stake instead of the fraction.

Value

Numeric vector: the applied Kelly fraction of bankroll, or the stake amount when bankroll is given.

Details

Full Kelly is aggressive and assumes your probability estimate is exactly right; fractional Kelly (for example fraction = 0.25) is the common practical choice for noisy model estimates.

Examples

# 55% win probability at +110
pa_kelly(0.55, +110, odds_format = "american")

# Quarter Kelly stake from a 1000 unit bankroll
pa_kelly(0.55, 2.1, fraction = 0.25, bankroll = 1000)

# No edge: clamped to zero
pa_kelly(0.40, 2.0)