Sunday, January 28, 2007

Kelly staking

Mathematician John Kelly came up with a system for staking which maximises your expected return over the long term. This is going to be a load of maths, so look away now if you're not interested.

Assuming you bet a proportion k of your bankroll each time at odds o, after you win W and lose L bets, you have B' = B [(1 + k(o-1))W (1 - k)L]. We want to find the maximum of this, so we take the derivative and set it to 0:
dB'/dk = W(o-1)(1-k) - L(1 + k(o-1)) = 0.

Or, W(o-1)(1-k) = L(1 + k(o-1)). Since over the long term, W/L -> p/(1-p) (see earlier post on the Law of Large Numbers), we can substitute in to get:
p(o-1)(1-k) = (1-p)(1 + k(o-1)). A little algebra then gives us:
k = p - (p-1)/(o-1), the Kelly Staking formula.

That means, if you assess the probability of the outcome to be 50% and the odds are 2.10, you should stake 0.5 - 0.5 / (1.1) ~ 0.5 - 0.45 = 0.05: a twentieth of your balance.

That's a big gamble. After losing a few consecutive bets, your bankroll of GBP1000 would have dwindled like this:
1. Bankroll: 1000.00 Bet: 50.00
2. Bankroll: 950.00 Bet: 47.50
3. Bankroll: 902.50 Bet: 45.13
4. Bankroll: 857.37 Bet: 40.72
5. Bankroll: 816.65

In four bets, you've lost nearly a fifth of your bankroll! On the other hand, if you'd won, you'd be laughing:
1. Bankroll: 1000.00 Bet 50.00
2. Bankroll: 1055.00 Bet 52.75
3. Bankroll: 1103.03 Bet 55.65
4. Bankroll: 1174.24 Bet 58.71
5. Bankroll: 1238.82

And you're up almost 24%. Kelly staking is a wild ride. As long as your value calculations are right, you'll end up way ahead in the long run*. Occasionally you'll lag at the wrong end of the binomial distribution and look like you're way behind.

Some gamblers choose to use a slightly less volatile system called fractional Kelly, in which they split their bankroll into (say) five separate bankrolls and use only one for Kelly calculations. That dampens the volatility a bit, but does make for smaller gains when you're winning.

So long as your value estimation is correct and the law of large numbers takes hold quickly enough - and you can stand the wild fluctuations in your bankroll - Kelly staking is the most profitable system known to mathematics. Use it wisely.

* In the above situation, you'd need about 1800 bets to be 95% sure of breaking even or better.

2 comments:

puntermick said...

Hi Kensson

Not sure if you are still active and receiving anything from your blog?

I am more so trying to contact you to pick your brains rather than post a comment.

Bit of a mathematical puzzle ( to me at least )

Very rough jist is I have carried out some research into uk horse racing based on certain key factors.

Results I have broken down into a course by course basis.
For each course I have number of qualifiers, number of winners, net profit, strike rate and ROI.

I guess my question revolves around confidence levels.

eg which is the better bet.?

A qualifier at Course 1 with a long term ROI of 10% based on 200 past qualifiers
or
A qualifier at course 2 with a long term ROI of 15% but based on only 20 past runs?

My gut instinct says the former is bettter due to increased confidence levels as a result of the larger sample size.

Ideally what I am looking for is a formula I can plug into my spreadsheet so I can sort courses by confidence of long term positive expectation as opposed to a more simplistic ROI or past net profit.

From reading your blog you appear to be the sort who might already have thought about such questions :)

Cheers
Mick

kensson said...

Hi, Mick,

There's an excellent article on this at http://www.punters-paradise.com/betting-theory/winning-system.php - the site has now evolved into http://www.thinkbetprofit.com/ and is well worth signing up to.