random_betting: Random betting function

View source: R/functions.R

random_bettingR Documentation

Random betting function

Description

Places bets on players i and j randomly chosen, among all the matches selected by the following strategy: by default, the amount of $1 is placed on the best odds (that is, the highest odds available) for player i for all the matches where it holds that

\frac{\hat{p}_{i,j}(t)}{q_{i,j}(t)} > r,

where \hat{p}_{i,j}(t) is the estimated probability (coming from the WElo or Elo model) that player i wins the match t against player j and q_{i,j}(t) is its implied probability obtained as the reciprical of the Bet365 odds. The implied probability q_{i,j}(t) is assumed to be greater than q. If q=0, all the players are considered. If q increases, heavy longshot players are excluded. Once got the number of matches satisfying the previously described strategy, each player (i and j) on which place a bet is randomly selected. Then the Return-on-Investiment (ROI) of this strategy is stored. Finally, the mean of the ROI obtained from repeating this operation B times is reported.

Usage

random_betting(
  x,
  r,
  q,
  model,
  bets = "Best_odds",
  B = 10000,
  start_oos = NULL,
  end_oos = NULL
)

Arguments

x

an object of class 'welo', obtained from the welofit function

r

Vector or scalar identifying the threshold of the ratio between the estimated and the implied probability (see above)

q

Scalar parameter used to exclude the heavy underdogs signalled by B365 bookmaker. No bets will be placed on those matches where players have odds smaller than q

model

Valid choices are: "WELO" and "ELO"

bets

optional Parameter identifying on which type of odds the bet is placed. Default to "Best_odds". Valid choices are: "Best_odds", "Avg_odds" and "B365_odds". "Best_odds" are the highest odds available. "Avg_odds" are the average odds and "B365_odds" are the Bet365 odds

B

optional Number of replicates to calculate the overall mean ROI. Default to 10000

start_oos

optional Character parameter denoting the starting year for the bets. If included (default to NULL), then the bets will be placed on matches starting in that year. It has to be formatted as "YYYY"

end_oos

optional Character parameter denoting the ending year for the bets. If included (default to NULL), then the bets will be placed on matches included in the period "start_oos/end_oos". It has to be formatted as "YYYY"

Value

A matrix reporting the number of bets and the mean of the ROI (in percentage) across the B values for every threshold r used

Examples


data(atp_2019) 
db_clean<-clean(atp_2019)
db_est<-welofit(db_clean)
rand_bets<-random_betting(db_est,r=c(1.1,1.2,1.3),q=0.3,model="WELO",B=1000)
rand_bets


welo documentation built on May 29, 2024, 8:38 a.m.

Related to random_betting in welo...