Inconsistency when applying the Kelly Criterion

gamblingprobability

Context

So I'm doing some research regarding the Kelly Criterion. By considering a coin tossing game in which you have even money odds where there is a probability $p > 1/2$ of winning, a probability $q < 1/2$ of losing and you bet the fraction $\ell$ of your capital in each bet. Then, your capital at time $k$ will be $W_k = W_0(1 + \ell)^S(1-\ell)^F$, where $W_0$ is the initial capital and $S$ is the number of successes and $F$ the number of failures. From what I understand this means that,
\begin{align}
\frac{W_k}{W_0} = \exp\{Bk\}, \quad \text{where: } B = \frac{1}{k}\log\left(\frac{W_k}{W_0}\right).
\end{align}

The expected value of the random variable which dictates the rate of growth of our capital will be $E[B] = p \log(1 + \ell) + q \log(1 – \ell)$, which is maxed by taking $\ell^* = p -q$.

In practice

I tried running a simulation in R to show that by playing a large number of games, the gamblers capital indeed increase by an exponential rate of $p \log(1 + \ell) + q \log(1 – \ell)$ per trial, however my results show that the capital increases by double the expected rate. For example, taking $p = .55$, $k = 20$ and by performing a million simulations I get that the growth rate per trial $B = 0.0099834$. However, the expected value of $B$ under the context stated equals:
\begin{align}
E[B] = .55\log(1+.1) +.45\log(1-.1) = 0.005008367
\end{align}

which is approximately half of what I observe in my simulation.

So the question is: why is this happening?

Code

#Function which computes the wealth process under a Kelly strategy
kelly <- function(odds, p, k, w_0){
#coin toss
  l_optima <<- (p*odds - (1-p))/odds
  toss <<-  sample(c(1 + odds*l_optima,1 - l_optima), k, replace = T, prob = 
  c(p, 1-p))
  wealth <- vector("integer", k)
  wealth[1] <- w_0

  for (i in 1:k) {
    wealth[i + 1] <- wealth[i]*toss[i]
  }

 return(wealth)
}


#One million simulations for our example
X = matrix(ncol = 1000000,nrow = 21)

for(i in 1:1000000){
  X[,i] <- kelly(1, .55, 20, 10)
}

test <- rowMeans(X)

#Growth rate

g_1 <- log(test[2]/test[1])
g_2 <- log(test[4]/test[1])/3
g_3 <- log(test[15]/test[1])/14

Best Answer

You have an error in your code.

The logarithmic growth rate for $k$ bets with optimal fraction $\ell^*$ is

$$B=\frac{1}{k}\log\left(\frac{W_k}{W_0}\right) = \frac{1}{k} \sum_{j=1}^k\log(1+ \ell^*X_j),$$

where $X_1,X_2, \ldots$ are independent and identically distributed Bernoulli random variables with $P(X_j = 1) = p = 0.55$ and $P(X_j = -1) = q=1-p = 0.45$.

The expected growth rate is

$$E(B) = \frac{1}{k} \sum_{j=1}^k E[ \log(1+\ell^* X_j)] = E[\log(1+ \ell^*X_1)] = p\log(1 + \ell^*) + q\log(1 - \ell^*)$$

Note that the expected growth rate does not depend on $k$.

The variance of the growth rate is

$$var(B) = E(B^2) - [E(B)]^2 = p[\log(1+\ell^*)]^2+ q[\log(1-\ell^*)]^2 - [p\log(1+\ell^*) + q\log(1- \ell^*)]^2$$

For the given parameters we have

$$E(B) \approx0.005008,\,\,\,\, \sqrt{var(B)} \approx0.099832 $$

Your simulation generates a sequence of $k$ bets, computes the growth rate for the sequence and then repeats the process $n$ times. In the end, you compute the average of the growth rates for each sequence. Since the expected growth rate is independent of the length of the sequence you are effectively sampling the random variable $\log(1+\ell^*X_1)$ a total of $n \cdot k = 20,000,000$ times and computing the mean. The standard error of the estimate should be

$$SE = \frac{\sqrt{var(B)}}{\sqrt{nk}} \approx 0.000022$$

In fact, as $k$ is increased the distribution of $k$-bet growth rates approaches a normal distribution asymptotically by the central limit theorem.

This suggests that in many repetitions of the simulation the estimate of the expected value should be roughly $0.005008 \pm 2.32 * 0.000022 = 0.005008 \pm 0.000052$ with $99 \%$ confidence.

I ran the simulation myself and obtained estimates consistently close to $0.005$ using different random number seeds with only $100000$ simulation paths.

Related Question