Skip to main content

Python implementation of Shin's method for calculating implied probabilities from bookmaker odds

Project description

shin

A Python implementation of Shin's method [1, 2] for calculating implied probabilities from bookmaker odds.

Probabilities calculated in this way have been shown to be more accurate than those obtained by the standard approach of dividing the inverse odds by the booksum [3].

Installation

Requires Python 3.5 or above.

pip install shin

Usage

Three or more outcomes

import shin

shin.calculate_implied_probabilities([2.6, 2.4, 4.3])
{'implied_probabilities': [0.37299406033208965,
  0.4047794109200184,
  0.2222265287474275],
 'iterations': 425,
 'delta': 9.667822098435863e-13,
 'z': 0.01694251276407055}

The returned dict contains the following fields:

  • implied_probablities
  • iterations - with three or more outcomes, Shin's method uses an iterative procedure. Compare this value to the max_iterations argument (default = 1000) to check for failed convergence
  • delta - the final change in z (see below) for the final iteration. Compare with the convergence_threshold argument (default = 1e-12) to assess convergence
  • z - the estimated proportion of theoretical betting volume coming from insider traders

Two outcomes

import shin

shin.calculate_implied_probabilities([1.5, 2.74])
{'implied_probabilities': [0.6508515815085157, 0.3491484184914841],
 'iterations': 0,
 'delta': 0,
 'z': 0.03172728540646625}

When there are only two outcomes, z can be calculated analytically [3]. In this case, the iterations and delta fields of the returned dict are 0 to reflect this.

Note that with two outcomes, Shin's method is equivalent to the Additive Method of [4].

References

[1] H. S. Shin, “Prices of State Contingent Claims with Insider traders, and the Favorite-Longshot Bias”. The Economic Journal, 1992, 102, pp. 426-435.

[2] H. S. Shin, “Measuring the Incidence of Insider Trading in a Market for State-Contingent Claims”. The Economic Journal, 1993, 103(420), pp. 1141-1153.

[3] E. Štrumbelj, "On determining probability forecasts from betting odds". International Journal of Forecasting, 2014, Volume 30, Issue 4, pp. 934-943.

[4] S. Clarke, S. Kovalchik, M. Ingram, "Adjusting bookmaker’s odds to allow for overround". American Journal of Sports Science, 2017, Volume 5, Issue 6, pp. 45-49.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shin-0.0.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

shin-0.0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file shin-0.0.2.tar.gz.

File metadata

  • Download URL: shin-0.0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for shin-0.0.2.tar.gz
Algorithm Hash digest
SHA256 986db17fbe6cedb75b4f6da0fcd28c127fc5eb6677b28bfd31aac569248a1ddf
MD5 46365aa49995f55d4797841cef4a6296
BLAKE2b-256 de7761c64af2eba8840274feab1cc433901415d2b3df3613a83b404a610d5c76

See more details on using hashes here.

File details

Details for the file shin-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: shin-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for shin-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a64b0583f4a55a31bfb5de4f467d4cc3a1b1cf06472916846aeae14af7d63ee7
MD5 62dc9533fea06109f4b38f4eeccffabe
BLAKE2b-256 b839d0cb8bd1a2c197476cdc1cc17bd48af9041c4543600e5f9a8c12cd376cbe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page