Title: | Translate Odds and Probabilities |
---|---|
Description: | Calculates the Kelly criterion for bets given quoted prices, model predictions and commisions. Additionally it contains helper functions to calculate the probabilities in multi-leg games. |
Authors: | Arvid Kingl [aut, cre] |
Maintainer: | Arvid Kingl <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0 |
Built: | 2025-02-28 05:32:24 UTC |
Source: | https://github.com/hcelion/rkelly |
Calculates the chance to draw out of n matches
chance_to_draw_n_games(p, n)
chance_to_draw_n_games(p, n)
p |
probability of first (or second) player winning match |
n |
number of matches |
The decimal chance for a draw
chance_to_draw_n_games(0.4, 4) # Draw chance if one player has p=0.4 in four matches
chance_to_draw_n_games(0.4, 4) # Draw chance if one player has p=0.4 in four matches
Chance of a player winning the majority of n matches. Draws count not as a win
chance_to_win_n_games(p, n)
chance_to_win_n_games(p, n)
p |
probability for player to win a single match |
n |
number of total matches playes |
The decimal chance of winning a game
chance_to_win_n_games(0.55,5) # Chance for player with p=0.55 to win best of 5 matches
chance_to_win_n_games(0.55,5) # Chance for player with p=0.55 to win best of 5 matches
Kelly for back bet
kelly_back_dec(price, p, commision_rate)
kelly_back_dec(price, p, commision_rate)
price |
Price to back in decimal odds |
p |
Probability of event to to materialise |
commision_rate |
Rate of commision charged on WINNINGS |
Kelly optimised fraction of stake relative to bank
kelly_back_dec(2,0.5,0.05)
kelly_back_dec(2,0.5,0.05)
The Kelly criterion
kelly_criterion(p, alpha_w, alpha_l)
kelly_criterion(p, alpha_w, alpha_l)
p |
The objective probability of the event |
alpha_w |
The return multiplier in case of the event happening |
alpha_l |
The return multiplier in case of the even not happening |
The Kelly optimised fraction that should be bet
kelly_criterion(0.5,1,1)
kelly_criterion(0.5,1,1)
Kelly for lay bet
kelly_lay_dec(price, p, commision_rate)
kelly_lay_dec(price, p, commision_rate)
price |
Price at which to lay |
p |
Base probability of event that is being laid |
commision_rate |
Rate of commision charged on WINNINGS |
Kelly optimised fraction of stake relative to bank