# A Bayesian In-Play Prediction Model for Association Football Outcomes
## 3 Bayesian Inference
### The Prior Distributions  
For a specific match, from kick-off to time \(T\) (\(T\in\)90), if there are \(m(m>\)0) goals, the observed data is \(Z=\{(t_{l},J_{l}),1\leq l\leq m\}\), where the meaning of \((t_{l},J_{l})\) is in common with their meaning in Equation (5); if there are no goals, the observed data is \(Z=\{(\infty,0),(\infty,1)\}\). For simplicity, we denote \(X(T)\) and \(Y(T)\) as the number of goals of home team and away team. According to the likelihood  
Figure 1: Illustration of the outcome prediction procedure. We estimate the parameters by the pure birth process model with the historical data, and use the Bayesian method to update the teams’ strength parameters with the in-match information. Then the recursive algorithm is employed to calculate the outcome probability. function (5) and (6), the likelihood function is as follows: if the total goals are more than 0 from kick-off to time \(T\), then  
\[ \begin{split} f(Z,\theta)=& e^{-\int_{0}^{T/90}(\lambda(t )+\xi_{1}t)dt-\int_{0}^{T/90}(\mu(t)+\xi_{2}t)dt}\prod_{l=1}^{m}(\lambda(t_{l}) +\xi_{1}t_{l})^{1-l_{l}}(\mu(t_{l})+\xi_{2}t_{l})^{l_{l}}\\ \propto& e^{-\int_{0}^{T/90}\lambda(t)dt-\int_{0}^{T/9 0}\mu(t)dt}\prod_{l=1}^{m}(\lambda(t_{l})+\xi_{1}t_{l})^{1-l_{l}}(\mu(t_{l})+ \xi_{2}t_{l})^{l_{l}},\end{split}  \tag{7}\]  
if there are no goals from start to time \(T\), then  
\[ \begin{split} f(Z,\theta)=& e^{-\int_{0}^{T/90}( \lambda(t)+\xi_{1}t)dt-\int_{0}^{T/90}(\mu(t)+\xi_{2}t)dt}\\ \propto& e^{-\int_{0}^{T/90}\lambda(t)dt-\int_{0}^{T/9 0}\mu(t)dt}\end{split}  \tag{8}\]  
where \(\lambda(t)=a\theta_{1}\rho(t)\tau_{xy}(t)\), \(\mu(t)=\theta_{2}\rho(t)\kappa_{xy}(t)\). \(\theta=(\theta_{1},\theta_{2})\), \(\theta_{1}\) stands for the home team's scoring intensity parameter which is determined jointly by the attack and defence strength of the two team involved, \(\theta_{1}=\alpha_{H}\beta_{A}\). Similarly, \(\theta_{2}\) stands for the away team's scoring intensity parameter, \(\theta_{2}=\alpha_{A}\beta_{H}\). It is worth noting that in above likelihood function, \((a,\rho(t),\tau_{xy}(t),\kappa_{xy}(t),\xi_{1},\xi_{2})\) is a constant vector. Since the goal times are generally recorded to the integer part of the time of the goal, i.e., they are recorded in minutes, the integrals can be substituted with the closed form expressions:  
\[e^{-\int_{0}^{T/90}\lambda(t)dt-\int_{0}^{T/90}\mu(t)dt}=e^{-\frac{1}{90}\int \limits_{t=1/90}^{T/90}(\lambda(t)+\mu(t))} \tag{9}\]  
Note that for the situation of total goals more than 0, if \(\xi_{1}=\xi_{2}=0\), \(f(Z,\theta)\) is proportional to the probability mass function of Poisson distribution; if \(\xi_{1}\
eq 0\) or \(\xi_{2}\
eq 0\), \(f(Z,\theta)\) is proportional to the sum of multiple probability mass functions of Poisson distributions. It is widely acknowledged that Gamma distribution is the conjugate prior distribution for Poisson distribution. For convenience of calculation, the prior distribution \(\pi(\theta)\) is assumed to be formed by two independent Gamma distributions for home team and away team where the correlation between them is reflected by \(\tau_{xy}\) and \(\kappa_{xy}\). In addition, the copula is a common used method to examine the association or dependence between variables. For example, a copula very simple, and almost conjugated is provided in [26]. Ref. [12] used a Weibull inter-arrival-times- based count process and a copula to produce a bivariate distribution of the numbers of goals scored by the home and away teams in a match. Moreover, we assume the mean of prior distribution of \(\theta_{1}\) is \(\hat{\theta}_{01}\) and the mean of prior distribution of \(\theta_{2}\) is \(\hat{\theta}_{02}\), where \(\hat{\theta}_{01}\) and \(\hat{\theta}_{02}\) are maximum likelihood estimations of \(\theta_{1}\) and \(\theta_{2}\) based on the pure birth process model with all historical matches.