I’m running simulations to get a feel for what “betting Kelly” would mean in specific contexts. See code here: https://jsfiddle.net/se56Luva/ . I observe, that given a uniform distribution of probabilities 0-1, if the maximum odds ratio is less than 40/1, this algo has a high chance of going bankrupt within 50-100 bets. Any thoughts on why that should be?
Nitpick: Kelly betting does not ever go bankrupt, at all. Unless the probability is exactly 1 or 0 (which is bad) the Kelly bet will always be less than the total amount of money you have right now—meaning that you can never lose all of your money on a Kelly bet.
That said, the code you linked is systematically losing money over time (though never actually hitting zero) because this line is backwards:
When dice < pwin, that should be a win (assuming that pwin is supposed to be the probability of winning), so the bet resolution should be positive in that case, not negative. With that fixed, wealth shoots up at a pretty quick exponential clip, eventually passes max double (~10^308) and becomes infinity, and then becomes NaN.
I’m running simulations to get a feel for what “betting Kelly” would mean in specific contexts. See code here: https://jsfiddle.net/se56Luva/ . I observe, that given a uniform distribution of probabilities 0-1, if the maximum odds ratio is less than 40/1, this algo has a high chance of going bankrupt within 50-100 bets. Any thoughts on why that should be?
Nitpick: Kelly betting does not ever go bankrupt, at all. Unless the probability is exactly 1 or 0 (which is bad) the Kelly bet will always be less than the total amount of money you have right now—meaning that you can never lose all of your money on a Kelly bet.
That said, the code you linked is systematically losing money over time (though never actually hitting zero) because this line is backwards:
When dice < pwin, that should be a win (assuming that pwin is supposed to be the probability of winning), so the bet resolution should be positive in that case, not negative. With that fixed, wealth shoots up at a pretty quick exponential clip, eventually passes max double (~10^308) and becomes infinity, and then becomes NaN.
Oh darn, you’re right. Thank you!