## From Counts to Regression
Poisson regression models the expected count outcome (goals) as a function of input features. It is the most appropriate regression framework for modelling goals — which are non-negative integers.
## The Model Structure
log(λ_home) = β₀ + β₁ × home_xG_att + β₂ × away_xG_def + β₃ × home_advantage
log(λ_away) = β₀ + β₁ × away_xG_att + β₂ × home_xG_def
Where:
- λ_home, λ_away = expected goals for home and away team
- β coefficients are estimated from historical data
- log link ensures predictions are always positive
## Fitting the Model
In Python:
```
import statsmodels.api as sm
from statsmodels.genmod.families import Poisson
model = sm.GLM(goals_scored, features, family=Poisson())
result = model.fit()
```
In R:
```
model <- glm(goals_scored ~ home_xg_att + away_xg_def + home_adv,
data = match_data, family = poisson())
```
## Interpreting Coefficients
Coefficients are on the log scale. exp(β) gives the multiplicative effect on expected goals.
If β₁ = 0.45 for home_xG_att: exp(0.45) = 1.57, meaning a 1-unit increase in home xG attack rate multiplies expected goals by 1.57.
## Generating Predictions
For a new match: calculate λ_home and λ_away from the fitted model. Apply Poisson distribution to generate the full scoreline probability matrix. Aggregate into 1X2, Asian handicap, and over/under probabilities.
Create a free account to track your progress and save bookmarks.