Skip to content

Statistical Models

pyrf provides a hierarchy of statistical distributions for modelling football match outcomes.

Distribution Hierarchy

Distribution (abstract)
├── UnivariateDistribution
│   ├── Poisson          — single team goals
│   └── Skellam          — goal difference
└── BivariateDistribution
    ├── BivariatePoisson  — independent joint goals
    └── DixonColes        — correlated joint goals

Poisson Distribution

Models the number of goals scored by a single team.

from pyrf.models import Poisson

home = Poisson(lambda_=1.8)
home.plot()

The parameter \(\lambda\) is the expected number of goals. The PMF is:

\[P(X = k) = \frac{\lambda^k e^{-\lambda}}{k!}\]

Skellam Distribution

Models the goal difference (home goals minus away goals).

from pyrf.models import Skellam

skellam = Skellam(lambda_home=1.8, lambda_away=1.2)
skellam.plot()

Bivariate Poisson

The simplest joint model — assumes home and away goals are independent.

from pyrf.models import BivariatePoisson
from pyrf.core import GoalGrid

model = BivariatePoisson(lambda_home=1.8, lambda_away=1.2)
pmf = model.pmf(GoalGrid.default())
model.plot()

Dixon-Coles Model

The Dixon & Coles (1997) adjustment modifies low-scoring probabilities (0-0, 1-0, 0-1, 1-1) via a dependence parameter \(\rho\):

from pyrf.models import DixonColes

model = DixonColes(lambda_home=1.8, lambda_away=1.2, rho=-0.10)
model.plot()

A negative \(\rho\) increases the probability of draws and decreases 1-0 / 0-1 results, reflecting the empirical tendency for teams to play more cautiously at low scores.

RingfinityModelZero

A convenience preset with \(\rho = -0.10\):

from pyrf.models import RingfinityModelZero

model = RingfinityModelZero(lambda_home=1.8, lambda_away=1.2)

API Reference

See the full API Reference.