LikeLike

]]>LikeLike

]]>You’ve probably already read it, but on the offchance that you haven’t, the seminal paper on Kelly betting has to be Thorp’s: http://www.eecs.harvard.edu/cs286r/courses/fall12/papers/Thorpe_KellyCriterion2007.pdf

There’s a lot of gold in there on the risk of ruin and the relative merits of each Kelly fraction. Anyone out there betting football will also want to read up on simultaneous betting, since a busy Saturday will so often see you tasked with staking more than 100% of your bankroll. Andrew Grant has a fantastic chapter (#19) on the topic in the Oxford Handbook of the Economics of Gambling: bit.ly/2lIFuHn

That should be enough armor to soldier through a few vicious downswings (which, with full Kelly, are so nasty that I can’t imagine ever using it in sports betting: the rest of overstaking is intolerably high). The pro bettors aren’t kidding when they call Kelly a rough ride. Advantage or not, you will have 75% downswings and 400% upswings – just look at that coin flipper in your post! The guy is drawing dead, yet still manages to win unabated from bet #5500 to bet #7000.

LikeLike

]]>Yeah, I get what you say about being on the ‘wrong’ side of the business but all I can say is that there are situations in life when you have to be really risk averse, and not for purely financial reasons. Stability is key for me and those around me right now. But as a matter of fact, I’m looking to bet more this year than I did the last, when I mostly coded and wrote. And now as a bonus, with a paycheck the swings will be so much easier to deal with.

Funny how you should mention Kelly, I was just putting a follow-up piece together in my head on how to visualise the risk of ruin for different staking plans like full and different fractions of Kelly.

LikeLike

]]>seasonFlip <- function(x, p, z){

y = sum(flipCoins(x, p))

print((1 + .01*fkez(p, z)*z)^y * (1 – .01*fkez(p, z))^(x – y))

}

with a lower case f in the camelback flipCoins! (Not sure how that uppercase F snuck in.)

LikeLike

]]>First, kudos on your new gig! (Though I’m bemused to hear you’re working for the books: you’re leaving money on the table, but I understand choosing stability.) I haunted your blog all year and had a great time reading it: there are so few numerate blogs on sports betting, and having a new Allsvenskan model of my own to pace against yours was a bonus. Looking forward to taking you on next year across the counter.

I wanted to leave your readers a few R functions I wrote that do much the same job as your code above, for the sake of diversity. (I have some other variance simulators too, but I’ve used the ones below for a while to keep myself sane during hellacious downswings.) Some of these depend on the others, as you can see in the code, so I keep them all in the same working environment.

This one simulates the flip of an unfair coin, where p is the probability of heads.

flipCoin <- function(p){

coin <- runif(1, min=0, max=1)

ifelse(coin < p, 1, 0)

}

If you want to simulate x unfair coins, then of course we use replicate.

flipCoins <- function(x, p){replicate(x, flipCoin(p))}

We're going to want to be able to bet these, so we need a function that gives us the Kelly stake for each edge. Here b is our bankroll, p is our probability of winning, z is Hong Kong odds, or (decimal odds – 1), and k is our desired Kelly fraction.

fk <- function(b,p,z,k){b * ((1 – (p*z/(1-p))^(-k)) / (1 + z*(p*z / (1-p))^(-k)))}

So if we have a bankroll of $1000, a bet that will win 55% of the time, decimal odds of 1.88, and enough confidence in our p value to bet 2/3 of Kelly, our function is fk(1000, .55, .88, 2/3), and returns the amount of money we should stake on our bet, ≈ 25.78$.

I use half Kelly so often that I wrote a shortcut function for that. It also takes out the bankroll value and simply returns the percentage of your roll that you should stake. (z is still Hong Kong, not Euro.)

fkez <- function(p, z){fk(100, p, z, .5)}

So if we have our 55% bet and decimal odds of 1.88, we run fkez(.55, .88), and are returned the percentage we should stake, ≈ 1.93%.

Now we can do something fun. Let's say that we're given x opportunities to flip our unfair coin that comes up heads with probability p, and we're always offered a line of z, where z = (decimal odds – 1). Betting our edge half Kelly, our results for the season can be found as follows:

seasonFlip <- function(x, p, z){

y = sum(FlipCoins(x, p))

print((1 + .01*fkez(p, z)*z)^y * (1 – .01*fkez(p, z))^(x – y))

}

Say I know I'll be able to bet 100 lines in Allsvenskan this year, each with p = .55 of winning and decimal odds of 1.88, I can run seasonFlip(100, .55, .88) to find some fractions by which my initial bankroll will be multiplied. When I ran this five times just now, I got ≈ 1.26, 1.51, 1.01, 1.05, and 0.88, respectively: my nets for the five simulated years were gains of 26%, 51%, 1%, and 5%, and -12%. It's not at all unreasonable to have a losing season (or a stressful breakeven) even with a nice edge over 100 bets! (If I had the fifth season, I might apply for a job with the bookies myself! ^_^)

LikeLike

]]>LikeLike

]]>LikeLike

]]>LikeLike

]]>LikeLike

]]>