Kelly Criterion

2024/10/26

The Kelly criterion is a formula used in portfolio management and gambling which tells you how much of your portfolio to bet on a game with a certain payoff and probability of winning. Let’s derive it!

We’ll set up the problem as:

The expected value of your bankroll after the bet resolves is:

$$\mathbb{E}[W_{new}] = p(W(1+bf)) + (1-p)(1-f)W$$ To make things easier for ourselves, we will ignore the constant factor $W$ and maximize the expected value of the log of the bankroll (we can do this because the log function is monotonic). Note that the expected value of the log is different from the log of the expected value!! To maximize the EV of the log, we can just do the usual tactic of multiplying probabilities by (log) values:

$$\begin{align} \mathbb{E}[\log W_{new}] &= p \log(W(1+bf)) + (1-p) \log(W(1-f) ) \\ &= p \log W + p \log (1+bf) + (1-p) \log W + (1-p) \log (1-f) \\ &= \log W + p \log (1+bf) + (1-p) \log (1-f) \end{align}$$

We want to maximize this expression with respect to $f$, so we’ll take the derivative:

$$\begin{align} 0 &= \dfrac{d}{df} \log W + p \log (1+bf) + (1-p) \log (1-f) \\ &= 0 + p \dfrac{b}{1+bf} + (1-p) \dfrac{-1}{1-f} \\ \end{align} $$ Solving for $f$:

$$\begin{align} 0 &= \dfrac{pb}{1+bf} - \dfrac{(1-p)}{1-f} \\ \dfrac{pb}{1+bf} &= \dfrac{(1-p)}{1-f} \\ pb(1-f) &= (1+bf)(1-p) \\ pb - pbf &= 1 - p + bf - pbf \\ -pbf + pbf -bf &= 1-p - pb \\ f &= \dfrac{1-p - pb}{-b} \\ &= p - \dfrac{1-p}{b} \end{align} $$

In this example, $f$ is the fraction of your bankroll you want to bet, so let’s do a quick example. I remember reading this story, which sounds like it comes from Money Stuff, but I can’t remember where it comes from:

A guy goes to interview as a quant at Jane Street and they offer to put up \$51 against his \$50 on a coin flip. He accepts and they tell him he shouldn’t have done that. “Why?” he asks, “it’s a positive-EV bet!” “Easy,” they tell him. “We have a guy on the trading floor who can flip heads 55% of the time.”

The point of the story is probably something about how you should always ask yourself why your counterparty is offering you an apparently good deal, but whatever, let’s say you can run this scam offering the same odds: $b = 101/51 = 1.98, p = 0.55$. Your Kelly-optimal bet is to put $0.55 - .45/1.98 = 32.3\%$ of your bankroll on this at each iteration.