Logistic regression for football results - Estimating coefficient through maximum likelihood

212 Views Asked by At

Consider two football teams $V$ and $L$ with strengths $W_V$ and $W_L$, respectively. Let's assume that the draw probability $\mathbb{P}(Draw)$ is known.

Then this model is supposed to give estimates for the winning probability of the two teams:

$\mathbb{P}(V_{wins}) = \displaystyle\frac{1-\mathbb{P}(Draw)}{1+e^{K_W(W_V-W_L)}}$

$\mathbb{P}(L_{wins}) = \displaystyle\frac{1-\mathbb{P}(Draw)}{1+e^{K_W(W_L-W_V)}}$

Assume that there exists $n$ historic games, all of which team $V$ won, that can be considered in the process of estimating $K_W$.

The likelihood function would be:

$L=\prod_{i=1}^n\displaystyle\frac{1-\mathbb{P}_i(Draw)}{1+e^{K_W(Wi_V-Wi_L)}}$

$\ln L=\sum_{i=1}^n(\ln(1-\mathbb{P}_i(Draw))-ln(1+e^{K_W(Wi_V-Wi_L)}))$

$\displaystyle\frac{\partial \ln L}{\partial k_W}=-\sum_{i=1}^n(\frac{(Wi_V-Wi_L)e^{k_W(Wi_V-Wi_L)}}{e^{k_W(Wi_V-Wi_L)} + 1})$

There seems to be no analytic solution to $\displaystyle\frac{\partial \ln L}{\partial k_W}=0$.

My question is then: How can $k_W$ be estimated through a method such as Newton-Raphson or something else?

2

There are 2 best solutions below

2
On

I would first transform the variables. $1-P(\texttt{Draw})=a$ and $W_V-W_L=b$

$PV=\frac{a}{1+e^{b\cdot K_w}}$

$\frac{1}{PV}=\frac{1+e^{b\cdot K_w}}{a}$

$\frac{a}{PV}=1+e^{b\cdot K_w}$

$\frac{a}{PV}-1=e^{b\cdot K_w}$

$\ln\left( \frac{a}{PV}-1\right)=b\cdot K_w$

Let $\ln\left( \frac{a}{PV}-1\right)=y$ we get

$y=b\cdot K_w$

Now you can apply linear regression.

$$\min \sum_{i=1}^n (y_i- b\cdot (K_w)_i)^2$$

0
On

I would couch this in the form:

We have a number of matches between two teams (not the same teams in each match) of known strength with result $r=1$ if the first team won, $r=-1$ if the second team won and $r=0$ for a draw and we have a probability model that the first team wins with probability $f(\Theta,F,S)$, where $F$ is the strength of team 1 and $S$ is the strength of team 2 and $\Theta$ is some parameter of the model you want to fit, and a draw occurs with probability $g(F,S)$.

Then given a set of results $(r_i,F_i,S_i), \ i=1, \dots N$ the likelihood of this set of results is: $$ L_{\Theta}=\prod_{i=1}^N \left[ \frac{r_i(r_i+1)}{2} f(\Theta,F_i,S_i) +\frac{r_i(r_i-1)}{2}f(\Theta,S_i,F_i)+(1-r_i^2)g(F_i,S_i) \right] $$ Now use a non-linear least squares method to find the value of $\Theta$ that minimises this. Last time I tried this I used the Nelder-Mead algorithm for the minimisation.