# The Kelly Criterion -- Where Did I Go Wrong?

Suppose the following simple/basic investment scenario:

• I have $100$USD in my bank account as a starting point (will increase/decrease as I invest).
• There are $1,000$ different investments that I'm planning to invest my money in.
• The investments are buy-sell fashioned. So I buy something low, and sell it higher.
• All my planned $1,000$ investments are executed in series (not in parallel). For example, I move to another investment only after I have sold the previous investment (hopefully sold with profit).
• All of the $1,000$ investments are independent (e.g. probability of winning/losing, or ratio of profit, are independent of how I perform with other investments).
• Probability that I will win in any of the $1,000$ investments is $0.54$ (i.e. I'm slightly more likely to win than to lose). I selected $0.54$ arbitrarily as an example, so we will stick to it for now.
• The profit rate for each of the $1,000$ is $0.3$. E.g. if I invest $5$ in any investment among the $1,000$, and I happen to win, then my revenue will be $5 + 5 \times 0.3 = 5 + 1.5 = 6.5$.

Then, the ultimate question is: how much of the total money in my bank account (at the time of investing) should I invest in an investment among the $1,000$ that I described above?

As per Wikipedia, the Kelly Criterion seems to suggest the following equation: $$f^* = \frac{bp-q}{b}$$ where:

• $f^*$ is the optimal ratio of my total money that I should invest in an investment,
• $b = 0.3$ is the profit rate if I win an investment,
• $p=0.54$ is the probability of me winning an investment,
• and $q=1-p=0.46$ is the probability of me losing an investment.

Now, if I understand the Kelly Criteron correctly, and I plug the numbers in, I get: $$f^* = \frac{0.3 \times 0.54 - 0.46}{0.3} = -0.99333$$

E.g. if I'm about to invest for the first investment (i.e. when my total money is $100$ USD), I should invest with $100 \times -0.99333 = -99.333$ USD! This makes no sense to me at all.

My attempt using a simulation code in Python, that simulates investment rates exhaustively from $0$ up to $1$ in increments of $0.05$, strongly disagrees with the $-0.99333$ above, by suggesting that $0.15$ is the optimal investment rate.

INPUT (assumptions):
* total money in bank: 100 USD.
* total number of investment projects: 1000.
* each investment has a probability 0.54 that it will be profitable.
* each investment has a profit rate of 0.3 (if successful).
* investments will be in series one by one (not parallel).

SIMULATION:
when investmenting 0% of total money, total money changed from 100  to 100.00 by the end of the journey.
when investmenting 5% of total money, total money changed from 100  to 534109.86 by the end of the journey.
when investmenting 10% of total money, total money changed from 100  to 107780173.52 by the end of the journey.
when investmenting 15% of total money, total money changed from 100  to 879409208.49 by the end of the journey.
when investmenting 20% of total money, total money changed from 100  to 291742331.78 by the end of the journey.
when investmenting 25% of total money, total money changed from 100  to 3717762.05 by the end of the journey.
when investmenting 30% of total money, total money changed from 100  to 1608.50 by the end of the journey.
when investmenting 35% of total money, total money changed from 100  to 0.02 by the end of the journey.
when investmenting 40% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 45% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 50% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 55% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 60% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 65% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 70% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 75% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 80% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 85% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 90% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 95% of total money, total money changed from 100  to 0.00 by the end of the journey.
when investmenting 100% of total money, total money changed from 100  to 0.00 by the end of the journey.

RESULT: best investment ratio is 0.15.


My question: Where did I go wrong?

If your net win is only $0.3$ times the bet, this is a terrible investment (even the expected value, let alone logarithmic utility that Kelly maximizes at each step is negative). This should be intuitive - you win only a bit over half of the times while the potential win is a small fraction of the potential loss. Or, the expected net win when betting $x$: \begin{equation} p\,b\,x + q\,(-x) = -0.298\,x. \end{equation}

Looking at the Python code, it seems that you actually add $1.3$ times the bet to the bankroll when one wins (so if you invest $100$, you get the $100$ back and an additional $30$ rather than $100$ and additional $130$).

When entering $b=1.3$ into the Kelly formula quoted in the question, I get $0.19$ which is somewhat consistent with the simulation result.

(However, note that the Kelly formula is based on either assuming logarithmic subjective utility or asymptotic results, it is unclear (to me) how probable it should be is that the Kelly bet produces the best result in an experiment with $N=1000$ bets).

• Weird. Wiki says that $b$ USD is what I get as a profit, on top of my $1$ USD investment. But what you say essentially defines the profit as "everything I get back, including profit and investment". Does this mean that the wiki page is wrong? Or am I misunderstanding something again? Jun 29, 2017 at 18:00
• You might be misunderstanding my answer (maybe because the part in parenthesis in the second paragraph had a slight mistake / confusing wording) . If you get 0.3 as a profit on top of your 1 USD investment, your bankroll increases overall by 0.3 as a result of the bet. Jun 29, 2017 at 18:45
• Oh sorry, just realized the bug in my Python code. Here is a diff addressing this bug for reference: github.com/Al-Caveman/pastebin/commit/… Jun 30, 2017 at 4:26

You used what the Wikipedia calls the "gambler's formula": f* = p - q/b They have another formula called the "investment formula: f* = p/a - q/b, where "p" and "q" are the probabilities of winning and losing, respectively, and "b" and "a" are the amounts the player stands to win and lose, respectively. The gambler's formula dictates that if the player loses, they lose everything whereas the investment formula allows the player to lose partially as well as completely. As long as it is possible to cut your losses quickly by exiting your position, the investment formula is the one to apply to your situation. In general "a" is probably the most controllable variable of a, b, p, and q. "b" is something you might have a feel for based on your experience, and "p" and "q" is something that can be studied to where you can assign values to them after seeing enough results for the setups you have. "a" is your loss tolerance, so when "a" exceeds a certain loss tolerance, say 10%, your job is to get out now.

The Kelly Criterion was introduced to the trading world by mathematician Edward Thorp, who first used it for card counting in blackjack, then moved on to the stock market to become one of the original quants on Wall Street. He also derived a version applicable to trends, where f* = (m)/(s^2), where m is the "drift rate", or the rate at which the trend (i.e., mean of the data points) is moving, and "s^2" is the rate at with the variance is changing over time (variance is standard deviation squared). Applying this to trend data allows us to know our optimal position size for any trend by dividing the slope of the trend by the slope of the change in variance. That's as far as I've gotten, but the math checks out. Even knowing nothing about the math, it's intuitively an excellent idea to base your position size on something that involves the slope of the trend because it seems so intuitively obvious that that would be the best time to "lean" on the market - when the stocks are steady going up. The steeper the slope, the more you want in on the action.

Interestingly enough, in all of what I've encountered on the internet regarding the Kelly criterion, at least 90% of the people, gurus, etc. get it wrong regarding which formula to use. The best learning materials for the Kelly Criterion I know of are Edward Thorp's paper "The Kelly Criterion in Gambling, Sports Betting, and the Stock Market" where he derives it for an even money "coin toss with a biased coin" as well as the continuous approximation, and page 29 from "Max Dama on Automated Trading" where he derives the Kelly Criterion for the continuous approximation as well. Stack Exchange also has some good discussions on the subject. Thanks for reading this!

• What happens if the (log)returns are Cauchy distributed, in which the average is undefined? Feb 27, 2022 at 1:12