Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
veerus

Analytics In Fmm: Introducing Expected Goals (xg)


Hey guys, I wanted to share a little side project I've been toying around with.

What is expected goals ("xG")?  It is a method for estimating the quality of chances that a football team creates or concedes in a match.  In real life football, there is plenty of historical data on the location of the shot, the type of a pass that assisted that shot, whether the attacker dribbled before trying the shot, etc.  By aggregating all of these factors, an estimate can be calculated of the likelihood of scoring from all the different shots.  For example, if your team takes 10 shots during a match, and each one of those shots has a historical goal rate of 0.2 (aka 20%), then on average, your team would expect to score 2 goals in that match.

In FMM, the data that we get is very limited however that doesn't mean we can't have fun and use the idea behind xG to create a model that suits the game.  There are a few uses for this but let me list the ones I like most:

  • Sometimes it feels like you got unlucky (or lucky) in a match.  A difference between actual goals scored and expected goals will answer that question (and by how much!)
  • Sometimes you will think "my team is creating chances but not scoring".  A simple calculation will quantify that in a single number which could help provide an explanation as to how much of that is perception and how much is fact.
  • xG is a good way to discuss and compare the effectiveness of a tactic, especially over time.  If you are inclined to keep track of your results for fun, or if you're testing something, or for a career narrative, xG can provide insight into how well a given tactic is working for you.

Arriving at xG in real life is an extremely complicated calculation that takes into account a dozen factors.  However, we don't have many of the same key data points in FMM so the math is much simpler.  All we can use is shots, shots on target ("SOT"), and clear-cut chances ("CCC"), plus a few secondary statistics.

After experimenting with the data, I decided to primarily focus on SOT and CCC.  I made this choice because it's simple while still getting the job done and because FMM is a simulation and real life analogies don't always apply.  While a high number of shots is nice, it doesn't force a save from the goalkeeper where an extra check need to be made to determine a goal.  By comparison, in real life xG calculations, all shots count because even the act of getting a shot off can be an indication of the potency of attack.  In FMM, the link between the two isn't always clear because players often fire off shots without any rhyme or reason.  As this is a simulation, the goal of any tactic should be to force a goalkeeper into making saves as frequently as possible.

This is also a good place to mention that penalty kicks and own goals do NOT count toward goals scored when using this metric.  Open play goals only (including free kicks).

The basic idea is then xG=(SOT*x)+(CCC*y) where x and y are constants of how often each action is expected to result in a goal.

Now let's take a brief look at the data.  It comes from three sources:

  • Season 1 from my career with El Ejido (49 matches)
  • Match screenshots from @BatiGoal's Villalibre career (138 matches)
  • Tests I've been running recently with MU & Leicester in the Community Shield (125 matches)

After evaluating all the data sources, I've settled on the following constants:

  • SOT = 0.15
  • CCC = 0.73 (note: this may be slightly higher than actual goal rate from CCC's in-game)
  • I also thought that shot attempts, while minimal, should have a small contribution to the formula as a proxy for successful possession, therefore Shots = .005.

What this basically means is that you should, on average, over time, expect to see a goal from CCC about 73% of the time.  Same logic applies to SOT - a goal can be expected from about 15% of shots on target.  So our final formula becomes xG = (Shots*0.005)+(SOT*0.15)+(CCC*0.73).  And remember, open play goals only!

This formula seems to scale well across saves and formations.  Here are the results for the three data sources mentioned above:

  • El Ejido - goals scored 82 (xG = 80.110) / goals allowed 50 (xG = 46.325)
  • BG save - goals scored 527 (xG = 531.255) / goals allowed 207 (xG = 269.895) (I've noticed that with good GK's, actual usually underperforms xG, especially in AI's case)
  • Test - goals scored 297 (xG = 311.860) / goals allowed 48 (xG = 75.330)  

A fun observation - in BG's save, I show 70 home games in which he had 288.925 xG (4.123 xG per game) while in the 68 games on the road he had 242.330 xG (3.564 xG per game).  Field advantage is real in this game!  And it's worth about a goal every two games!

I plan on using xG in my career thread for El Ejido when it suits the narrative as well as a key comparison metric for some tests I've been running for a future article.  I welcome your comments to help refine these numbers.

Link to comment
Share on other sites

Recommended Posts

Really interesting findings and thanks a lot for taking the time and effort to put this into writing and sharing with us.

I like numbers especially if they provide us with explanations as well as answers in this case.

 

1 hour ago, veerus said:

I plan on using xG in my career thread for El Ejido when it suits the narrative as well as a key comparison metric for some tests I've been running for a future article.

This, of course, is the most important bit for most people I think. How best to apply this xG and can we use this to our advantage getting more goals longterm. One would think so after reading your article but looking forward to your (any) confirmation from your El Ejido career.

Link to comment
Share on other sites

I think it is an interesting concept but not sure it could be in the game though pre-match would be interesting to see. However you have to think of quality of shot and striker. 10 long shots isn't going to wield the same success rate as 10 one on ones.

Link to comment
Share on other sites
3 hours ago, Dec said:

I think it is an interesting concept but not sure it could be in the game though pre-match would be interesting to see. However you have to think of quality of shot and striker. 10 long shots isn't going to wield the same success rate as 10 one on ones.

I agree it's far from scientific but, on average, it's a decent approximation as all variables more or less cancel out. Quality of striker will scale with quality of GK and for every 10 long shots on target you're probably generating plenty of closer ones too. What we're left with is an average of success about 1 out of 6 shots. Given the two fairly simple variables available in the game, the formula above fits it well without having to do complicated math.

6 hours ago, BatiGoal said:

This, of course, is the most important bit for most people I think. How best to apply this xG and can we use this to our advantage getting more goals longterm. One would think so after reading your article but looking forward to your (any) confirmation from your El Ejido career.

That's the plan. xG is really just a convenient way to use a single number to give a simple and quick summary of a game. Is it comprehensive? No, far from it. But if a game ends 1-1 but xG is 4.8-0.4, you can imagine that the game was very one sided as compared to a boring game where xG is 0.4-0.4.

And again, this is not for everybody as most people fly through games very quickly. But if you're testing formations, it's a useful tool to compare them at a glance by the sum of xG generated. 

Link to comment
Share on other sites
2 hours ago, veerus said:

I agree it's far from scientific but, on average, it's a decent approximation as all variables more or less cancel out. Quality of striker will scale with quality of GK and for every 10 long shots on target you're probably generating plenty of closer ones too. What we're left with is an average of success about 1 out of 6 shots. Given the two fairly simple variables available in the game, the formula above fits it well without having to do complicated math.

I agree it is a nice baseline but sadly there's too many variables such as player quality, player role, tactics for you and opposition, luck. A team that play with 2 INFs and a BBM would have a wildly different average to one that players a  poacher as primary source of goals.

Link to comment
Share on other sites
58 minutes ago, Dec said:

I agree it is a nice baseline but sadly there's too many variables such as player quality, player role, tactics for you and opposition, luck. A team that play with 2 INFs and a BBM would have a wildly different average to one that players a  poacher as primary source of goals.

That's exactly what xG is designed for - to be able to compare various things such as formations or player quality. Players may be different but results remain the same. Each formation is designed to maximize goal scoring which comes from creating chances and getting shots on target. Your 2x INF+BBM formation may generate different xG than the P formation. I would argue the one that generates higher xG is more effective. 

As for luck, you could get lucky or unlucky in a single match (to use my earlier example, 1 goal from 4.8 xG is unlucky) but it all evens out over the course of a season. If you keep generating 4+ xG per game, goals will come. 

Link to comment
Share on other sites
20 minutes ago, veerus said:

That's exactly what xG is designed for - to be able to compare various things such as formations or player quality. Players may be different but results remain the same. Each formation is designed to maximize goal scoring which comes from creating chances and getting shots on target. Your 2x INF+BBM formation may generate different xG than the P formation. I would argue the one that generates higher xG is more effective. 

As for luck, you could get lucky or unlucky in a single match (to use my earlier example, 1 goal from 4.8 xG is unlucky) but it all evens out over the course of a season. If you keep generating 4+ xG per game, goals will come. 

I think we're getting our wires crossed. I understand you are using it as a baseline figure to compare things, however I am talking more about in the game in the pre-match report.

Link to comment
Share on other sites
23 minutes ago, Dec said:

I think we're getting our wires crossed. I understand you are using it as a baseline figure to compare things, however I am talking more about in the game in the pre-match report.

Ah, yes. The game doesn't simulate the AI games fully so these stats would be hard to keep track of for the AI. Alari has previously commented on memory concerns when asked about tracking more data. Hopefully one day though, but until then, it's a side project that requires some manual input but is kind of fun to play with.

20 minutes ago, Fish18ish said:

Wow football is far too stats orientated these days.

It is the way of the future. Every club nowadays has an analytics department. Wenger has mentioned expected goals by name in interviews before. And I know Zlatan pays close attention to it based on some of his comments earlier this season when he had that 11 game goal drought. 

Link to comment
Share on other sites
3 hours ago, veerus said:

Ah, yes. The game doesn't simulate the AI games fully so these stats would be hard to keep track of for the AI. Alari has previously commented on memory concerns when asked about tracking more data. Hopefully one day though, but until then, it's a side project that requires some manual input but is kind of fun to play with.

It is the way of the future. Every club nowadays has an analytics department. Wenger has mentioned expected goals by name in interviews before. And I know Zlatan pays close attention to it based on some of his comments earlier this season when he had that 11 game goal drought. 

I get it but football is a very simple game really, it's unnecessary to delve into it as deeply as is often the case. Unfortunately, due to the nature of FM, we often forget that.

Link to comment
Share on other sites
17 hours ago, veerus said:

Ah, yes. The game doesn't simulate the AI games fully so these stats would be hard to keep track of for the AI. Alari has previously commented on memory concerns when asked about tracking more data. Hopefully one day though, but until then, it's a side project that requires some manual input but is kind of fun to play with

      

That's why I safe in a different folder after every season so I can still go back and look at things if needs be

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...