Notes#
With decimal odds d and true probability p, the full-Kelly fraction of the bankroll is
f* = (b·p − (1 − p)) / b, where b = d − 1
The stake is f* × kelly_percentage × bank_roll. When f* is negative (the bet has negative expected value) the stake is 0.0.
Examples#
import pandas as pd
import stakepd as spd
No edge:
bankroll = 100
odds = pd.Series([2.0, 3.0])
probabilities = pd.Series([0.4, 0.3])
wagers = spd.kelly_criterion(odds, probabilities, 'decimal', bankroll)
print(wagers)
Output:
result
0 0.0
1 0.0
dtype: float64
0.0 means that you shouldn’t make the bet.
Positive edge:
bankroll = 1000
odds = pd.Series([2.0, 3.0, 1.5])
probabilities = pd.Series([0.6, 0.4, 0.7])
wagers = spd.kelly_criterion(odds, probabilities, 'decimal', bankroll)
print(wagers)
Output:
0 200.0
1 100.0
2 100.0
dtype: float64