# Predicting Football Match Results Using a Poisson Regression Model
## 3 Theoretical Framework
Therefore, Equations (4) and (5) can be used in order to reflect the playing performance of the teams as discussed previously:  
\[\log(\lambda_{Home})=\mu+\mu_{Home}+att_{Home}+def_{Away} \tag{4}\]  
\[\log(\lambda_{Away})=\mu+att_{Away}+def_{Home} \tag{5}\]  
where \(\mu\) is the log average of the away goals and can be interpreted as the expected number of goals an away team is likely to score. Constant \(\mu_{Home}\), which is fixed for all teams, expresses the home team advantage that can be attributed to, e.g., the crowd, the pitch, the distance the away team has to cover, etc., expressed as the difference between the log mean of the number of goals of home and away matches. \(\text{att}_{\text{Home}}/\text{att}_{\text{Away}}\) and \(\text{def}_{\text{Home}}/\text{def}_{\text{Away}}\) reflect the attacking and defensive quality, respectively, of the home and away teams, expressed as deviations from \(\mu\). We note that \(\mu_{Home}\), which is the potential home team advantage, is considered constant across all teams, as well as the attacking and defensive abilities of a team, which remain the same whether playing at home or away. Therefore, the attacking/defensive abilities do not distinguish home attacking/defensive ability and away attacking/defensive ability for each team. The above assumptions were made in order to have a simpler model structure, also considering the fact that those assumptions are backed up by previous studies [1; 2; 3], which follow a similar modeling approach. Lastly, it is obvious that the better the offensive parameter of a team, the higher the attacking quality of the team, and the better the defensive parameter of a team, the higher the defensive quality of the corresponding team. Equations (4) and (5), which are used to calculate the expected number of goals for the home and away team, are Poisson regression models and are considered generalized linear models (GLMs), and thus, we have achieved the modeling of the expected goals for a team using its playing performance. Figure 1 illustrates the steps of our proposed algorithm. Specifically, these steps are summarized below:  
1. Calculate the log averages of the number of goals scored by the home and away teams for all matches. 2. For each team, calculate the log averages of the number of goals scored and concedceded for all the matches (not distinguishing between home and away matches). 3. The log average of the away teams is \(\mu\), while \(\mu_{home}\) is the log difference of home and away averages. 4. Calculate att and def for each team by subtracting \(\mu\) from both log averages. 5. Use the calculated parameters in Equations (4) and (5). The running time of our algorithm is \(\mathcal{O}(n)\) in the number \(n\) of the participating teams. We have developed our prototype using the Python programming language version 3.10. An important aspect of our methodology is the assumption of independence between the goals scored in a match, that is the number of goals scored by the home team does not affect the distribution of the away team's scores. We discuss this assumption in more detail in the next section. Figure 1: The steps of our proposed algorithm.