https://github.com/torvaney/soccerstan
Reproduction of football models in Stan
https://github.com/torvaney/soccerstan
Last synced: about 1 year ago
JSON representation
Reproduction of football models in Stan
- Host: GitHub
- URL: https://github.com/torvaney/soccerstan
- Owner: Torvaney
- Created: 2017-06-10T11:11:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-06-14T14:08:44.000Z (about 5 years ago)
- Last Synced: 2025-04-06T17:06:39.964Z (about 1 year ago)
- Language: Python
- Size: 41 KB
- Stars: 36
- Watchers: 7
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Soccerstan
Reproductions of models for football (soccer) matches in Stan/PyStan.
## How do I run the models?
It's pretty simple. You can just run `src/soccerstan.py` from the command line.
This requires the file containing match data
(from [football-data.co.uk](football-data.co.uk)) and which model you want to
use as arguments.
For instance:
```bash
> python soccerstan.py 'data/example.csv' 'karlis-ntzoufras'
```
## Models
So far, the following models have been implemented:
* Maher (1982) - Modelling Association Football Scores - `maher`
* Dixon and Coles (1997) - Modelling Association Football Scores and Inefficiencies in the Football Betting Market - `dixon-coles`
* Karlis and Ntzoufras (2008) - Bayesian modelling of football outcomes (using the Skellam's distribution) - `karlis-ntzoufras`
## Data
The main `soccerstan` script has been written to work with data from [football-data.co.uk](football-data.co.uk). The 2015/16 English Premier League season has been added as an example data file.
However, it will also work with any csv with columns labelled `home_team`, `away_team`, `home_goals`, `away_goals`.