# Predicting Football Match Results Using a Poisson Regression Model
## 3 Theoretical Framework  
The Poisson distribution is a discrete probability distribution, which expresses the probability of a given number of events occurring in a fixed interval of time, provided that these events occur independently with a known constant rate. The probability of \(k\) events, whose expectation is \(\lambda\) in a given time interval, is:  
\[P(k)=\frac{e^{-\lambda}\lambda^{k}}{k!},\]  
where \(k\) is the number of occurrences, \(\lambda\) is the expected number of occurrences, \(e\) is Euler's number, and \(k!\) is the \(k\) factorial. The positive real number \(\lambda\) is equal to both the expected value of \(x\) and its variance. \[\lambda=\mathbb{E}(X)=\text{Var}(X).\]  
The number of events \(k\) in our setting is the number of goals a particular team in a particular match scores. Poisson regression is a generalized linear model (GLM) form of regression, which assumes that the response (or dependent) variable follows a Poisson distribution and also assumes that the logarithm of its expected value can be modeled by a linear combination of a number of unknown parameters, which play the role of the predictors. It is sometimes known as a log-linear model, as it uses the logarithm as the (canonical) link function, since logarithmic transformation can linearize the underlying distribution of the response, which in our case is the Poisson distribution. Poisson regression is a statistical method used to model count data, and it is particularly useful when the dependent variable represents the number of times an event occurs within a specific interval. The Poisson distribution, the basis of this model, assumes that the mean and variance of the count data are equal. The Poisson regression model is defined as follows:  
\[Y_{i} \sim Poisson(\lambda_{i}) \tag{1}\] \[\log(\lambda_{i}) =\beta_{0}+\beta_{1}X_{i1}+\beta_{2}X_{i2}+\ldots+\beta_{p}X_{ip}, \tag{2}\]  
where \(Y_{i}\) is the count of events for the \(i\)-th observation, \(\lambda_{i}\) is the expected count for the \(i\)-th observation, \(X_{i}1,X_{i}2,\ldots,X_{i}p\) are the predictor variables for the \(i\)-th observation, and \(\beta_{0},\beta_{1},\ldots,\beta_{i}p\) are the model parameters. The dependent variable is a count representing the number of occurrences of an event within a specific interval. The mean and variance of the count data are equal (Poisson assumption). The events occur independently. Poisson regression parameters are typically estimated using maximum likelihood estimation (MLE). Furthermore, following the above principles, in a given match between team A, which is the home team, and team B, which is the away team, the probability of the final score is given as the product of the probability that the home team scores \(k\) goals and the away team scores \(h\) goals, which obey a double Poisson distribution as follows:  
\[\frac{\lambda_{Home}^{k}e^{-\lambda_{Home}}}{k!}\ \times\frac{\lambda_{Away}^{h}e^{- \lambda_{Away}}}{h!} \tag{3}\]  
To calculate the probability that the home team wins, we will have to sum all the probabilities of all combinations of scores \((k,h)\) where \(k>h\). To calculate the probability that the away team wins, we have to sum all the probabilities of all combinations of scores, where \(k<h\). For a draw, we sum the probabilities of combinations where \(k=h\). We need to calculate \(\lambda_{Home}\) and \(\lambda_{Away}\), which are the expected number of goals scored for the home and away team, respectively. Thus, we reflect the strength of the team, the defensive quality of the opposing team, as well as the home advantage where it should be applied. The calculation of the above parameters can be modeled by fitting a statistical regression model that incorporates an intercept, a home team effect, and the attacking/defensive abilities of the teams [1; 2; 3].