An open API service indexing awesome lists of open source software.

https://github.com/torvaney/regista

An R package for soccer modelling
https://github.com/torvaney/regista

football r rstats soccer sports-analytics

Last synced: 5 months ago
JSON representation

An R package for soccer modelling

Awesome Lists containing this project

README

          

---
output:
github_document:
html_preview: false
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# regista

[![Build Status](https://travis-ci.org/Torvaney/regista.svg?branch=master)](https://travis-ci.org/Torvaney/regista)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/Torvaney/regista?branch=master&svg=true)](https://ci.appveyor.com/project/Torvaney/regista)
[![Coverage status](https://codecov.io/gh/Torvaney/regista/branch/master/graph/badge.svg)](https://codecov.io/github/Torvaney/regista?branch=master)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)

## Overview

regista is a package for performing some of the common modelling tasks in soccer
analytics.

## Installation

regista is not currently available on CRAN but can be downloaded from github like so:

```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("torvaney/regista")
```

## Examples

### Dixon-Coles

The ["Dixon-Coles model"](http://web.math.ku.dk/~rolf/teaching/thesis/DixonColes.pdf) is a modified poisson model, specifically designed for estimating teams' strengths and for predicting football matches.

Regista provides an implementation of this model:

```{r, message = FALSE, warning = FALSE}
library(regista)

fit <- dixoncoles(hgoal, agoal, home, away, data = premier_league_2010)

print(fit)
```

A more flexible api is provided with `dixoncoles_ext`, which allows the base Dixon-Coles model to be extended arbitrarily.

`vignette("using-dixon-coles")` gives some simple examples for using the model.
Additionally, there are more extensive examples and analyses using regista
available at the following links:

* [Modelling the World Cup with regista](http://www.statsandsnakeoil.com/2018/06/05/modelling-the-world-cup-with-regista/)
* [Dixon Coles and xG: together at last](http://www.statsandsnakeoil.com/2018/06/22/dixon-coles-and-xg-together-at-last/)
* [What a diff'rence xG makes](http://www.statsandsnakeoil.com/2018/07/15/what-a-diff-rence-xg-makes/)

Other options
---

* The [mezzala](https://github.com/Torvaney/mezzala) package provides similar functionality for Python.
* The [goalmodel](https://github.com/opisthokonta/goalmodel) R package contains an
implementation of the Dixon-Coles model, along with some additional method for
modelling the number of goals scored in sports games.