# Introduction to the implied package

#### 2020-08-02

This package contain a single function, implied_probabilities(), that convert bookmaker odds into proper probabiltiies. Several methods are available, with different assumptions regarding the underlying mechanism the bookmakers convert their probabilities into odds.

A naive conversion of bookmaker odds into probabilities has two main problems. The first is that the probabilities are not proper probabilities, since they sum to more than 1. The excess probability is called the bookmakers margin. The second problem is that the probabilities, even if the margin is removed, will be biased in several ways, usually because of what is called the favorite-longshot bias. The methods in this package remove the bookmaker margin and some of them also adjust for favorite-longshot bias.

## The basic method

The default method used by the function implied_probabilities() is called the basic method. This is the simplest and most common method for converting bookmaker odds into probabilties, and is obtained by dividing the naive probabilities (the inverted odds) by the sum of the inverted odds. If pi is the true underlying probability for outcome i, and ri is the cooresponding inverted odds, then the probabilities are computed as

pi = ri / sum(r)

This method tend to be the least accurate of the methods in this package. I have also seen this normalization method been referred to as the multiplicative method.

The implied_probabilities() function return a list with the proper probabilities (as a matrix) and the bookmaker margins.

In the examples below are three sets of bookmaker odds from three football matches.


library(implied)
#> If you find this package useful, please consider supporting the development at
#> https://ko-fi.com/opisthokonta

# One column for each outcome, one row for each race or match.
my_odds <- rbind(c(4.20, 3.70, 1.95),
c(2.45, 3.70, 2.90),
c(2.05, 3.20, 3.80))
colnames(my_odds) <- c('Home', 'Draw', 'Away')

res1 <- implied_probabilities(my_odds)

res1$probabilities #> Home Draw Away #> [1,] 0.2331556 0.2646631 0.5021813 #> [2,] 0.3988848 0.2641264 0.3369888 #> [3,] 0.4586948 0.2938514 0.2474538 res1$margin
#>  0.02118602 0.02326112 0.06346277

## Margin Weights Proportional to the Odds

This method is from Joseph Buchdahl’s Wisom of the Crowds document, and assumes that the margin applied by the bookmaker for each of the outcome is proprtional to the probabilitiy of the outcome. In other words, the excessive probabilties are unevenly applied in a way that is reflects the favorite-longshot bias.

The probabilities are calculated from the bookmaker odds O using the following formula

pi = n * Oi / (n - M * Oi)

where n is the number of outcomes, and M is the bookmaker margin.

res2 <- implied_probabilities(my_odds, method = 'wpo')

res2$probabilities #> Home Draw Away #> [1,] 0.2310332 0.2632083 0.5057585 #> [2,] 0.4004096 0.2625166 0.3370739 #> [3,] 0.4666506 0.2913457 0.2420036 # The margins applied to each outcome. res2$specific_margins
#>            Home       Draw       Away
#> [1,] 0.03056706 0.02683049 0.01396320
#> [2,] 0.01936444 0.02953607 0.02300299
#> [3,] 0.04533211 0.07260878 0.08741297

## The odds ratio method

The odds ratio method is also from the Wisdom of the Crowds document, but is originally from an article by Keith Cheung. This method models the relationship between the proper probabilities and the improper bookmaker probabilties using the odds ratio (OR) function:

OR = pi (1 - ri) / ri (1 - pi)

This gives the probabilities

pi = ri / OR + ri - (OR * ri)

where the odds ratio OR is selected so that sum(pi) = 1.

res3 <- implied_probabilities(my_odds, method = 'or')

res3$probabilities #> Home Draw Away #> [1,] 0.2320048 0.2636415 0.5043537 #> [2,] 0.3996912 0.2633869 0.3369219 #> [3,] 0.4634406 0.2919032 0.2446562 # The odds ratios converting the proper probablities to bookmaker probabilities. res3$odds_ratios
#>  1.034449 1.035805 1.102606

## The power method

The power method models the bookmaker probabilties as a power function of the proper probabilties. This method is also described in the Wisdom of the Crowds document, where it is referred to as the logarithmic method.

pi = ri(1/k)

where k is selected so that sum(pi) = 1.

res4 <- implied_probabilities(my_odds, method = 'power')

res4$probabilities #> Home Draw Away #> [1,] 0.2311414 0.2630644 0.5057942 #> [2,] 0.4003156 0.2627189 0.3369655 #> [3,] 0.4667139 0.2908985 0.2423876 # The inverse exponents (n) used to convert the proper probablities to bookmaker probabilities. res4$exponents
#>  0.9797664 0.9788115 0.9419744

The additive method removes the margin from the naive probabilites by subtracting an equal amount of of the margin from each outcome. The formula used is

pi = ri - ((sum(r) - 1) / n)

If there are only two outcomes, the additive method and Shin’s method are equivalent.


res5 <- implied_probabilities(my_odds, method = 'additive')

res5$probabilities #> Home Draw Away #> [1,] 0.2310332 0.2632083 0.5057585 #> [2,] 0.4004096 0.2625166 0.3370739 #> [3,] 0.4666506 0.2913457 0.2420036 One problem with the additive method is that it can produce negative probabilities, escpecially for outcomes with low probabilties. This can often be the case when there are many outcomes, for example in racing sports. If this happens, you will be given a warning. Here is an example taken from Clarke et al (2017):  my_odds2 <- t(matrix(1/c(0.870, 0.2, 0.1, 0.05, 0.02, 0.01))) colnames(my_odds2) <- paste('X', 1:6, sep='') res6 <- implied_probabilities(my_odds2, method = 'additive') #> Warning in implied_probabilities(my_odds2, method = "additive"): Probabilities outside the 0-1 range produced at 1 instances. res6$probabilities
#>             X1        X2         X3          X4          X5          X6
#> [1,] 0.8283333 0.1583333 0.05833333 0.008333333 -0.02166667 -0.03166667

## Balanced books and Shin’s method

The two methods referred to as “balanced book” and Shin’s method are based on the assumption that there is a small proportion of bettors that actually knows the outcome (called inside traders), and the rest of the bettors reflect the otherwise “true” uncertainty about the outcome. The proportion of inside traders is denoted Z.

The two methods differ in what assumptions they make about how the bookmakers react to the pressence of inside traders. Shin’s method is derived from the assumption that the bookmakers tries to maximize their profits when there are inside traders. The balanced books method assumes the bookmakers tries to minimize their losses in the worst case scenario if the least likely outcome were to acctually occur.

We can not know what the insiders know, but both methods gives an estimate of the proportion of insiders.

res7 <- implied_probabilities(my_odds, method = 'shin')

res7$probabilities #> Home Draw Away #> [1,] 0.2315811 0.2635808 0.5048382 #> [2,] 0.4000160 0.2629336 0.3370505 #> [3,] 0.4645977 0.2919757 0.2434266 # The estimated proportion of inside traders. res7$zvalues
#>  0.01054734 0.01157314 0.03187455
# Balanced books
res8 <- implied_probabilities(my_odds, method = 'bb')

res8$probabilities #> Home Draw Away #> [1,] 0.2299380 0.2624575 0.5076046 #> [2,] 0.4011989 0.2616832 0.3371179 #> [3,] 0.4710196 0.2899698 0.2390106 # The estimated proportion of inside traders. res8$zvalues
#>  0.01059301 0.01163056 0.03173139

## Other packages

The odds.converter package can convert between different odds formats, including to decimal odds, that this package requires.

## Literature

Here are some relevant references and links:

• Joseph Buchdahl - USING THE WISDOM OF THE CROWD TO FIND VALUE IN A FOOTBALL MATCH BETTING MARKET Link