### Iterative Simultaneous Kelly Solution

I like to use LaTeX, so this is mostly an excuse for me to practice my LaTeX skills. Whether one is familiar or unfamiliar with the Kelly Criterion, the concepts outlined below help to give insight to how one can make possible improvements when certain conditions are met. Generally, improvements from a sequential to simultaneous adjustment of the Kelly stakes are slight. However, as will be shown, slightness can turn considerable when extrapolated over longer time frames.  Feel free to just jump here.

## Why a Log-Utility

The Kelly Criterion generalizes a model that maximizes the growth of one’s bankroll using a logarithmic utility. Why does this work? Well, its due to the inherent properties of logarithms. For instance, log2 (8) tells you how many times to divide eight by two to get one. Keep dividing by two in perpetuity and the number never reaches zero. Thus, using the Kelly Criterion, one has infinite bankroll, assuming there is no minimum placed on wager sizes. With infinite bankroll, there is no maximum placed on how big the bankroll can grow to.

Using a log-utility, bankroll is now the sum of the probabilities of the log-returns for any wager. Concretely, the return is simply the payout times the percentage of bankroll wagered. For one wager, with p as the win probability, w as the payout, and x as the wager size, the rate of growth is:

$G(x) = p \log (1+wx) + (1-p) \log (1-x)$

The payout, w, on a win is the decimal odds – 1. Since a losing bet results in w = -1, the return on a losing bet is 1-x. And when x = 1, the logarithm is undefined, and ruin is guaranteed. (Financial conditions when x > 1 have yet to be of concern.)

The optimal wager size, or stakes, for any given bet is now the partial derivative of the function G with respect to x.

$\frac { \partial G}{ \partial x} = \frac { pw }{1 + wx} + \frac { 1-p } { 1-x }$

Conveniently, the function G is a concave function, and at some point on the interval $0 \le x \le 1$, function G converges to a maximum, the tangent slope of the curve equals zero. Setting the partial derivative to zero gives:

$x = \frac { pw - 1 + p }{ w } = \frac { dp - 1 } { w }$

(d = decimal odds)

This can also be expressed in terms of probabilities, since the win probability divided by the implied probability, 1/d, is roughly equal to the return on a winning wager:

$1 + wx \approx \frac { p }{ p_{imp}}$

And the optimal stakes can also be found with the formula:

$x = \frac { p - p_{imp} } { 1 - p_{imp} }$

## Simultaneity

For sequential stakes, the previous holds true. However, making wagers simultaneously results in a set of stakes that does not maximize log-utility. Since the bankroll isn’t re-adjusted every time a wager wins or loses, an adjustment has to be made. For example, with two independent simultaneous events (wagers placed at the same time), the function G equals:

$G(x _{1}, x_{2}) = p _{1}p _{2}log(1+w _{1}x _{1} + w _{2}x _{2}) + q _{1}p _{2}log(1 - x _{1} + w _{2}x _{2}) + p _{1}q _{2}log(1+w _{1}x _{1} - x _{2}) + q _{1}q _{2}log(1 - x _{1} - x _{2})$ $q _{1}, q _{2} = 1 - p _{1}, 1 - p _{2}$

The size of possible joint outcomes is mn, m being the single game outcomes (typically binary), and n the number of simultaneous events. In this case, there are four possible joint outcomes. When n becomes larger than two, the space of joint outcomes becomes too large to write down completely, so in more compact notation, the function G can be reduced to:

$G(x _{1}, x _{2}, \dots, x _{n}) = \sum _{i}^{m^n} \textbf{P} _{i} log(1+\sum _{j}^n w _{ij} x_{j})$

Where P is an mn x 1 vector, and $\prod _{j}^n p _{j} = P _{i}$

In Vectorized form:

$G = \textbf{P}^\intercal \log(1 + \textbf{WX})$

W is an mn x n matrix, $w \in \textbf{W} _{i}, x \in \textbf{X}$

## Iterative Solution

As mentioned before, there are implied constraints placed on x. The sum of all stakes can not exceed one, and negative stakes are yet unknown to commerce. With that in mind, if one is fortunate enough to have a rather size-able edge across multiple simultaneous bets, the stakes can be re-calculated with elementary math:

$x _{i} := \frac {x _{i}}{\sum _{i}^{n} x_{i}}$

Whether this is a necessary step or not will be obvious given a set of events. Regardless, the assumption here is the function G is not maximized using single game stakes, because after a result is final, the initial bankroll changes. Any number r <> ar if a <> 1. (When the stakes are zero, the number of simultaneous events simply becomes n – 1, and does not effect the current bankroll).

Through a derivative-free, iterative solution, the goal is to move up a curve until the point reaches an apex, so arbitrary steps are suitable enough to reach the desired goal. The result will be the optimal kelly fraction across all stakes, which has the benefit of maintaining proportionality. Conveniently, the time-complexity of such an algorithm has a lower bound of 1 and an upper bound of N, number of iterations, which should terminate, at the most, when the kelly fraction = 0.

Assuming the matrices P, W, and X have been populated (pseudocode):

alpha = 1
N = 100
G_temp = -1
for i = 1 to N
X := X * alpha  ##alpha = fraction
G = P_transpose * log(1+W*X)
if G < G_temp
break
else
G_temp = G
alpha = alpha - .01  ##Sufficient step size, alpha terminates at zero
end
end

This should guarantee a solution. Two things to mention, the statement “Assuming the matrices P, W, and X have been populated” is of major importance, and should not be reduced to assumptions. However one chooses to populate an array, matrix, etc…, this adds considerably to the time-complexity of the algorithm. The size is enormous, and assigns $\Theta (c*m^n)$ the new lower bound.

I’ve created an example with random probabilities and payouts, to visualize the algorithm.

$\begin{tabular}{|l|l|l|} \hline \textbf{implied p}&\textbf{p}&\textbf{stake}\\\hline 0.5776&0.6250&0.1122\\ 0.5560&0.5988&0.0965\\ 0.5994&0.6427&0.1080\\ 0.5273&0.5682&0.0866\\ 0.5235&0.5719&0.1015\\ 0.4070&0.4375&0.0514\\ 0.4964&0.5431&0.0927\\ 0.4738&0.5323&0.1112\\ 0.4175&0.4691&0.0886\\ 0.4150&0.4676&0.0899\\\hline \end{tabular}$

In Octave, the entire process took 0.03 seconds. That was worth a .07% increase in bankroll.  The more events there are the more one will benefit.

As mentioned before, the improvements may be slight. But setting G as the rate of growth in the equation, Y = ert, can translate into drastic increases in bankroll. A brief example of the time it takes to triple bankroll given r:

$3 = e^{rt}$

$r = .030, \ t = \frac {\ln(3)}{.030} \approx 36.62$

$r = .025, \ t = \frac {\ln(3)}{.025} \approx 43.94$

A 0.5% increase in bankroll in this case means if one makes a series of wagers simultaneously, each meeting similar conditions, approximately seven such wagers are unnecessary to reach three times initial bankroll. If n = 10, that’s 70 different bets. Performed weekly and that’s over two months worth of extra money ever year. Over ten years and a bettor can secure over 18 months of additional bankroll had one considered simultaneous outcomes.

## Direct Calculation

The iterative solution has the advantage of maintaining proportionality. This can be restated as using some scalar, s, to optimize stakes, X:

$s \begin{pmatrix}x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix} \Rightarrow \textbf{max}(G)$

Now the function, G, becomes:

$G(s) = \textbf{P}^\intercal \log (1 + \textbf{W} \times s \textbf{X})$

And the derivative of G:

$\frac { dG}{ ds} = \textbf{P}^\intercal (\textbf{WX} \div (1+\textbf{W} \times s \textbf{X}))$

Here, division is element-by-element division. In most programming languages, this is syntactically equivalent to “(W*X)./(1+W*X).”

I’ve reduced G to a one variable equation, so there should be a direct solution without having to iterate by setting the derivative of G to zero and solving for s, the kelly fraction.  (N = mn )

$s = \frac { \sum _i^{N} P_i \sum _j^{n} w_{ij} x_j}{ \sum _i^{N} P_i ( \sum _j^{n} w_{ij} x_j)^2 } = \frac { \textbf{P}^\intercal (WX)}{ \textbf{P}^\intercal (WX \circ WX) }$

## Mutual Exclusivity

Much work has been done on simultaneous events whose outcomes are dependent on each other (i.e. horse racing, futures). A general algorithm for kelly stakes across mutual exclusive events is outlined at wikipedia.

### Comparing Rating Systems For NCAA Tournament

The images represent how each rating system projects the NCAAB Tournament. The higher rated team was selected for each matchup. For the bracket labeled “PINNY”, the future odds from Pinnacle were used to assess team-by-team comparison. Click on the image for full-size view.

### NCAA Tourney KP vs Pinny

Same thing as conference tournaments. SEC Field hit at 3/1 odds, the other four lost. A brief survey of a hypothetical bankroll outcome demonstrated the prodigious and frightening force of the Kelly Criterion and all the emotional turmoil likely to beget its constituency. Flat bettors would have come away in the negative, but with an air of optimism and satisfaction having lingered for hitting a future.

KenPom’s LOG5 predictions are here. If you don’t know what that means, to wit:

LOG5 = (a – a * b)/(a + b – 2 * a * b)

“a” and “b” here are winning percentages. KenPom uses his pythagorean winning percentages calculated by PPP and tempo rather than just points scored for and against, with an exponent of around 12.

(Numbers in each cell represent percentages sans the non-obligatory “%” symbol).

 TOP 5 REGION CHAMP Ohio St 10.54 Ohio St 3.55 Mich St 7.64 Wisconsin 2.24 Wisconsin 6.97 Mich St 1.98 Kansas 6.8 Kansas 1.74 Indiana 3.38 Indiana 0.67

Mr. Pomeroy “likes” the Big Ten, Pinnacle doesn’t.

 SOUTH KP PINNY KP-P TEAM REGION CHAMP REGION CHAMP REGION CHAMP Kentucky 47.9 19.7 47.4 27.78 0.5 -8.08 Wichita St 11.8 2.6 8.43 2.32 3.37 0.28 Indiana 9.2 1.7 5.82 1.03 3.38 0.67 Baylor 10.9 1.7 12.08 2.82 -1.18 -1.12 Duke 9.5 1.7 12.08 4.8 -2.58 -3.1 UNLV 3 0.2 3.51 0.73 -0.51 -0.53 Iowa St. 1.7 0.1 1.31 0.42 0.39 -0.32 Notre Dame 1.9 0.1 1.96 0.44 -0.06 -0.34 Uconn 0.9 0.06 2.58 1.07 -1.68 -1.01 Xavier 0.09 0.04 1.32 0.43 -1.23 -0.39 S Dakota St. 0.8 0.03 0.41 0.29 0.39 -0.26 VCU 0.5 0.02 0.79 0.29 -0.29 -0.27 Colorado 0.4 0.01 0.67 0.29 -0.27 -0.28 NMSU 0.3 0.01 0.41 0.35 -0.11 -0.34 Lehigh 0.3 0.007 0.4 0.21 -0.1 -0.203 WKY 0.001 0.82 0.32 -0.819 -0.32 MIDWEST KP PINNY KP-P TEAM REGION CHAMP REGION CHAMP REGION CHAMP UNC 28.5 6.6 32.95 13.64 -4.45 -7.04 Kansas 33.7 9.1 26.9 7.36 6.8 1.74 Gtown 9.7 1.4 7.31 1.45 2.39 -0.05 Michigan 5.7 0.5 4.57 0.88 1.13 -0.38 Temple 2.3 0.1 3.92 0.64 -1.62 -0.54 SDSU 0.9 0.03 2.65 0.52 -1.75 -0.49 St. Mary’s 1.2 0.05 2.65 0.59 -1.45 -0.54 Creighton 2 0.1 1.61 0.43 0.39 -0.33 Alabama 3.1 0.2 2.04 0.57 1.06 -0.37 Purdue 3.9 0.3 3.92 0.73 -0.02 -0.43 NC State 1.5 0.07 4.57 0.73 -3.07 -0.66 USF 0.3 0.008 0.81 0.66 -0.51 -0.652 Ohio 0.5 0.01 0.81 0.29 -0.31 -0.28 Belmont 4 0.03 3.92 0.85 0.08 -0.82 Detroit 0.07 0.54 0.21 -0.47 -0.21 Vermont 0.03 0.84 0.39 -0.81 -0.39 WEST KP PINNY KP-P TEAM REGION CHAMP REGION CHAMP REGION CHAMP Mich St 35.2 12.4 27.56 10.42 7.64 1.98 Missouri 23.1 5.3 22.63 8.31 0.47 -3.01 Memphis 8.2 1.7 5.67 1.61 2.53 0.09 New Mexico 7.1 1 7.84 1.33 -0.74 -0.33 Marquette 7.5 0.9 9 2.34 -1.5 -1.44 Loserville 4.7 0.5 9.08 2.61 -4.38 -2.11 Florida 4.4 0.5 3.97 0.8 0.43 -0.3 St. Louis 3.4 0.5 2.2 0.57 1.2 -0.07 Virginia 2.5 0.2 1.78 0.43 0.72 -0.23 Murray St. 1.4 0.07 3.05 0.73 -1.65 -0.66 LBSU 1 0.06 1.3 0.29 -0.3 -0.23 BYU 0.5 0.02 3.91 0.97 -3.41 -0.95 Davidson 0.3 0.009 0.71 0.29 -0.41 -0.281 Colorado St. 0.4 0.008 0.52 0.29 -0.12 -0.282 LIU 0.003 0.39 0.17 -0.387 -0.17 Norfolk St 0.0001 0.39 0.21 -0.3899 -0.21 EAST KP PINNY KP-P TEAM REGION CHAMP REGION CHAMP REGION CHAMP Syracuse 17.5 4.4 18.22 5.72 -0.72 -1.32 Ohio St 45.9 19.3 35.36 15.75 10.54 3.55 FSU 3.9 0.5 9.29 4.08 -5.39 -3.58 Wisconsin 16.2 4.2 9.23 1.96 6.97 2.24 Vanderbilt 4.9 0.8 7.92 2.81 -3.02 -2.01 Cincinnati 1.8 0.2 4.39 1.03 -2.59 -0.83 Gonzaga 1.7 0.1 2.4 0.59 -0.7 -0.49 Kansas St 3.4 0.4 4.39 0.98 -0.99 -0.58 S. Miss 0.2 0.006 0.98 0.34 -0.78 -0.334 WVU 0.8 0.05 2.4 0.59 -1.6 -0.54 Texas 2.3 0.2 2.2 0.52 0.1 -0.32 Harvard 0.7 0.04 1.11 0.29 -0.41 -0.25 Montana 0.09 0.002 0.79 0.29 -0.7 -0.288 St. Bona 0.6 0.03 0.53 0.29 0.07 -0.26 Loyola 0.02 0.4 0.17 -0.38 -0.17 UNC-Ashe 0.03 0.4 0.17 -0.37 -0.17

### Coin Toss Flat v Kelly Simulation

*Repost from too long ago.

I created a coin toss simulator (at the bottom) to compare two different wagering methodologies.  But first I’m going to ramble.

Statistics, streaks, can be deceiving, and frequently this feature of statistics is abused.  Services and handicappers that sell picks often either just plain lie about their betting performance, or use statistics over a small subset of games that only act as data in a larger sample size.

You can take any record of picks over a certain time frame, and do a linear extrapolation into future expectation and growth, serving to highlight excellence in picking games.  I went 0-7 in college football two weeks ago, if I use that and do a linear extrapolation through the next 50 years I’ll be losing money at the speed of light expanding infinitely up into the outer regions of space.

Rarely does anybody have constant growth in bankroll, as the only thing absolute is that there will be variation and fluctuation in winners and losers.  But calculating expected growth is a practical application imposing upon a system of random performance.  If a bettor is betting 25% of her bankroll on every play, all it takes is one 0-4 sequence of wagers to lose everything.

Expected Value, to wit:

An example would be a standard -110 wager betting $100. Expected growth is typically demonstrated in terms of bankroll growth and bankroll shrinkage. Therefore X (Money wagered) would be expressed as percentage of bankroll. For the above example, a bankroll of$10,000 at 1% per game equates to $100. The formula for expected growth: D = Decimal Odds p = Win Probability The Kelly Criterion accounts for such scenarios, and finds the most optimal distribution of bankroll to apply for each wager, given some designated edge. Kelly is a formula to maximize expected growth, while minimizing risk. Conversely, flat betting (betting the same amount on each game) defines the edge as immaterial, and embraces randomness and humility. With either style of managing bankroll, allowing one to stick around long enough to hit a long shot is eminently assumed, in my opinion of course. Again, Kelly essentially finds the optimal wager for an event that maximizes E(G), from above. Given an edge, however measured, the “Kelly Stake” can now be calculated as a percentage of bankroll (of course if there is no edge there is no wager). Conveniently at even odds the stake is equal to the edge. One thing to keep in mind, Kelly intended each particular stake to relate to each particular moment of current bankroll. Meaning a$1 winner with a bankroll of $100 now increases the bankroll to$101 and therefore changes the value of the next wager given similar parameters of the wager previous.

Kelly is very aggressive, there is no doubting that, which is why fractional Kelly is more common, in my experience anyways.  I don’t use the Kelly criterion because there is seldom a time where a calculated edge has any actual meaning, and I’m not arrogant enough to think I am smarter than Vegas.  Therefore I bet frivolously and arbitrarily.

The simulator is below, and uses “static” Kelly Criterion, if you will, to compare to flat unit stakes.  Enter numbers in the blue boxes then click simulate.   Its a zip file.  Two excel macro files inside, 0ne is a side by side comparison, the other just allows for the simulation of the specified methodology.

FlatvKelly_Sim

### To win World Series and MVP

Pinnacle isn’t offering MVP props, so I used 5Dimes as the market setter.  The book that takes the highest limits is on the left and used as the base to compare with other books.  Similar to what I did before playoffs started, where the Rangers to win the ALCS prop had the best overall market value.

Doesn’t look like either side has any immediate value. Personally I like the Rangers but what do I know.

The players in bold appear to have over 1% market value.  Conveniently they play for different teams in different capacities.  If the Cardinals do win I find it hard to believe they out hit the Rangers, and conversely the Rangers are built around a tremendous lineup and a deep bullpen.  A bet both on Carpenter and Hamilton brings together the winning attributes of their respective teams.