Posts Tagged Betting
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:
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.
Conveniently, the function G is a concave function, and at some point on the interval , function G converges to a maximum, the tangent slope of the curve equals zero. Setting the partial derivative to zero gives:
(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:
And the optimal stakes can also be found with the formula:
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:
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:
Where P is an mn x 1 vector, and
In Vectorized form:
W is an mn x n matrix,
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:
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 the new lower bound.
I’ve created an example with random probabilities and payouts, to visualize the algorithm.
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:
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.
The iterative solution has the advantage of maintaining proportionality. This can be restated as using some scalar, s, to optimize stakes, X:
Now the function, G, becomes:
And the derivative of G:
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 )
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.
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.
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).
|Ohio St||10.54||Ohio St||3.55|
Mr. Pomeroy “likes” the Big Ten, Pinnacle doesn’t.
|S Dakota St.||0.8||0.03||0.41||0.29||0.39||-0.26|
*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.
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.