Hi - need a little maths help please!
I have built a database to help me take the donkey work out of finding selections and within that I have used a poison Expected Goals calculation for home and away teams. It seems to work well but I came across someone on twitter who has a better method than just using the usual goals scored & conceded. I did ask him for help but no joy.
In short, they say rather than just using goals data, use goals & shots on target & shots off target. He has tested it over many seasons & leagues and using all 3 variables it does indeed provide a better prediction of expected goals than just goal data alone. It varies from league to league but based on recent history the EPL is something like:-
Teams Expected Goals = (0.45 x (Their Average goals scored)) + (0.084 x (Their Av shots on target)) + (0.0281 x (Their Av shots off target))
So, thats 3 variables to a get a nice equation y = .45 X + .084 Y + .028 Z
Now, here is my question! To get excel to provide those 3 coefficients I have to provide it some data to model on. So lets say I use last seasons EPL data, I tell it there where 1072 goals, 3309 shots on target and 9606 shots off target. Excel, or any software for that matter, cant compute it because the y variable (goals) is also one of the x variables. It either returns an error or gives the coefficient 2.82 for x (average goals per game) and 0 for both shots / shots off target. y = 2.82X + 0Y + 0Z
So, if anyone can help me work out how to come up with the coefficients so I can adapt for each league Id be very grateful. Others might find this useful too. I suspect regression analysis is not the way forward but I cant find a way (other than absolute guessing) to efficiently solve those 3 factors.
Many Thanks
Tommy2Fingers
Own Expected Goals! Maths Coefficient Help Please!
- tommy2fingers
- Posts: 15
- Joined: Mon Jul 01, 2019 10:48 am
Last edited by tommy2fingers on Tue Oct 01, 2019 3:23 pm, edited 1 time in total.
-
- Posts: 3140
- Joined: Sun Jan 31, 2010 8:06 pm
That's confused the hell out of me as you seem to be using lower and upper case letters for your variables and can't see where lower case x comes into this equation.
- tommy2fingers
- Posts: 15
- Joined: Mon Jul 01, 2019 10:48 am
small x is multiply
Big X / Y / X are inputs you would make for Av Goals/ Av Shots on Target / Av Shots off target. Replace them with A/B/C if makes easier, Ta
Big X / Y / X are inputs you would make for Av Goals/ Av Shots on Target / Av Shots off target. Replace them with A/B/C if makes easier, Ta
-
- Posts: 3140
- Joined: Sun Jan 31, 2010 8:06 pm
Not sure where average goals per game is coming into the equationtommy2fingers wrote: ↑Tue Oct 01, 2019 1:31 pmcant compute it because the y variable (goals) is also one of the x variables.
.........
It either returns an error or gives the coefficient 2.82 for x (average goals per game) and 0 for both shots / shots off target. y = 2.82X + 0Y + 0Z
Teams Expected Goals = (0.45 x (Average goals scored)) + (0.084 x (Av shots on target)) + (0.0281 x (Av shots off target))
In related equations it's usually not too hard to replace variables but to be honest I'm not sure what equation or variable I'm suposed to be replacing. Maybe I'm just looking at it wrong.
-
- Posts: 3140
- Joined: Sun Jan 31, 2010 8:06 pm
I can't see where the problem is coming from using the data he's supplied it seems a simple equation to work out your expected goal all that's missing from the data he supplied is the number of games to work out your average expected goals
Teams Expected Goals = (0.45 x (Average goals scored)) + (0.084 x (Av shots on target)) + (0.0281 x (Av shots off target))
Teams Expected Goals/(Games played) = (0.45 x (1072)) + (0.084 x (3309)) + (0.0281 x (9606))
I've no idea why excel is having trouble with that or even where this 2.82 has appeared from
Teams Expected Goals = (0.45 x (Average goals scored)) + (0.084 x (Av shots on target)) + (0.0281 x (Av shots off target))
Teams Expected Goals/(Games played) = (0.45 x (1072)) + (0.084 x (3309)) + (0.0281 x (9606))
I've no idea why excel is having trouble with that or even where this 2.82 has appeared from
- tommy2fingers
- Posts: 15
- Joined: Mon Jul 01, 2019 10:48 am
Ok, so the stats i gave last year for EPL (1072 goals, 3309 shots on target and 9606 shots off target) Obviously 380 games played. from that, the guy gets a league model coefficient average for each variable the 0.45 / 0.8 / 0.2 etc
Thats the question im trying to work out. You need to pretend you dont know those 3 coefficients
Sorry, im not after alternative ideas like ExG
Thats the question im trying to work out. You need to pretend you dont know those 3 coefficients
Sorry, im not after alternative ideas like ExG
The guy must be using more than just the previous year set of data and a much more complex calculation separate to the prior year data to work out the co-efficient - remember he is calculating expected future goals not a co-efficient of the previous season as if this was so the coefficients would work out to equal the left side of the equation perfectly- which is why you are getting 2.82 and 0/0.
This is illustrated by playing the equation through-
Expected goals per team based on prior year data = 1072 goals divided by 380 games divided by 2 teams playing =1.41
Average goals per team is the same parameter = 1.41* 0.45 coefficent = 0.634
Average shots on target = 3309/380/2 = 4.35 * 0.084 = 0.365
Average shots off target = 9606/380/2 = 12.639*0.021 = 0.265
Sum of = 1.265 expected goals per game based on the league average data
To work out your separate leagues you will need to employ much more complex maths - wish I could help but Im not that talented

This is illustrated by playing the equation through-
Expected goals per team based on prior year data = 1072 goals divided by 380 games divided by 2 teams playing =1.41
Average goals per team is the same parameter = 1.41* 0.45 coefficent = 0.634
Average shots on target = 3309/380/2 = 4.35 * 0.084 = 0.365
Average shots off target = 9606/380/2 = 12.639*0.021 = 0.265
Sum of = 1.265 expected goals per game based on the league average data
To work out your separate leagues you will need to employ much more complex maths - wish I could help but Im not that talented

