4 min read

Kelly fractions for independent simultaneous bets

INTRODUCTION

This post is about sizing independent simultaneous bets through methods related to the Kelly criterion. I’ll start by explaining what the Kelly criterion is and how to derive it. I’ll then discuss a simple way to extend it to simultaneous independent binary bets.

KELLY CRITERION

The Kelly criterion imagines a single bet made sequentially an infinite number of times. It aims to maximise the geometric mean of the returns in that scenario. For a binary bet, on each turn, either we win and our bankroll improves by \((1 + fb)\) – where \(0 \le f \le 1\) is the fraction of the bankroll to invest and \(b\) are the net odds – or we lose and our bankroll reduces by \((1-f)\). Since products are invariant to order of their terms, we can write \((1+fb)^w (1-f)^l\), where \(w,l\) are the number of wins and loses respectively. If we take the geometric mean to get an average growth rate, we get \((1+fb)^{w/n} (1-f)^{l/n}\), which as \(n \to \infty\) is \((1+fb)^{p} (1-f)^{1-p}\) where \(p\) is the true winning fraction. Finally, the Kelly criterion is arrived at by: \[f^* = \arg\max_f \left\{ (1+f b)^p (1-f)^{1-p} \right\}\] For the simple case above, since the formula is concave with respect to \(f\), to obtain the maximising \(f^*\), we can differentiate it, set it to zero then solve for \(f\). However, more generally, we can solve it through numeric optimisation. Here is a Python example comparing a closed form and a fitted solution for a bet with \(b=1.2, p=0.6\):

b, p = 1.2, 0.6

# Closed form.
print("closed", (b*p-(1-p))/b)

# Optimisation.
import numpy as np
from scipy.optimize import minimize_scalar
obj = lambda f: -(1 + f * b)**p * (1 - f)**(1 - p)
result = minimize_scalar(obj, bounds=(0,1), method='bounded')
print("fitted", result.x)

>> closed 0.26666666666666666
>> fitted 0.2666661629701403

MULTIPLE SIMULTANEOUS BETS

We can derive a simultaneous form of the above by imagining the geometric growth rate of the same set of \(m\) simultaneous bets made sequentially, infinite times: \[\prod_{i=1}^m (1 +f_ib_i)^{p_i}(1 - f_i)^{1-p_i}\] where \(f_i,b_i,p_i\) are the bet specific investment fractions, net odds and win fraction respectively, and \(\sum f_i \le 1\). Then, we can we can maximise the form numerically with respect to \(f_i\) as follows:

\[\{f_i^*\}_{i=1}^m = \arg\max_{\{f_i\}_{i=1}^m} \prod_{i=1}^m (1 + f_i b_i)^{p_i} (1 - f_i)^{1-p_i}\] which can be neatly summarised as a Python function:

import numpy as np
from scipy.optimize import minimize

def kelly(B, P, a=1):
  return minimize(
    fun = lambda F: -np.prod(((1+(F/a)*B)**P)*((1-(F/a))**(1-P))), 
    x0  = np.zeros(len(B)),
    bounds = [(0,1) for _ in B],
    constraints = {
      'type': 'ineq',
      'fun': lambda F: 1 - np.sum(F)
    }).x

where \(0 < a \le 1\). The function achieves at least two things:

  • It is constrained by \(\sum f_i \le 1\), and given enough viable bets, it may allocate the whole bankroll across them.

  • Since optimising the geometric mean \(X\) is equivalent to optimising for \(log(X)\), growth rate exponentially tapers as it approaches the Kelly optima. As a result, when many bets are considered together, it may be possible to produce a higher growth rate by spreading the bankroll across bets.

Note the \(a\) parameter. This is to address two problems:

  1. Many bets with an individually positive Kelly criterion may result in no allocation because the bankroll is spent elsewhere. This may be undesirable from a risk management perspective.

  2. Over-estimation of \(p_i\) can lead to ruin through over-betting.

A practical remedy for both is known as “fractional Kelly” wherein we bet a fixed fraction of the calculated optima. The \(a\) parameter integrates fractional Kelly directly into the objective function. Resultantly, bets reach their optima at lower values of \(f_i\) (if \(a<1\)) leading to lower allocations per bet, and therefore more likely allocations across viable bets. Meanwhile, since each bet is a fraction of what it would have otherwise been, the likelihood of over-betting is reduced, possibly at the cost of a sub-optimal growth rate.