Expected Goals Model
Description of the Expected Goals model developed by KoraStats based on historical match data and statistical modeling.
Expected Goals (xG)
Section titled “Expected Goals (xG)”Introduction
Section titled “Introduction”Expected Goals (xG) is a statistical model designed to estimate the probability that a given goal-scoring opportunity will result in a goal.
Instead of evaluating match outcomes only through the number of goals scored, the Expected Goals model evaluates the quality of scoring opportunities created during a match. Each shot is assigned a probability value between 0 and 1, representing the likelihood that the attempt results in a goal.
For example, a shot taken from a long distance with several defenders in front of the goal typically has a very low probability of resulting in a goal. Conversely, a shot taken close to the goal with a clear view of the goal mouth usually has a much higher probability of success.
By assigning probabilities to individual shot events, the Expected Goals model provides a more reliable way to evaluate attacking performance. It allows analysts to distinguish between teams that consistently create high-quality opportunities and teams that rely on low-probability shots.
At KoraStats, the Expected Goals model was developed using historical match data and statistical modeling techniques to estimate the probability that a shot results in a goal. The model is based on the analysis of several characteristics describing the shot event and the situation in which it occurs.
Data and Dataset
Section titled “Data and Dataset”The Expected Goals model was developed using match data collected from the Egyptian Premier League.
The dataset contains goal-scoring opportunities recorded across four seasons of competition. Each observation in the dataset represents a single shot event taken during a match.
The dataset contains a total of 25,716 shot events.
| Season | Number of Events |
|---|---|
| 2015 / 2016 | 6,668 |
| 2016 / 2017 | 7,026 |
| 2017 / 2018 | 7,109 |
| 2018 / 2019 | 4,913 |
The final season contains data collected until April 2, 2019.
Each shot event contains a set of attributes describing the characteristics of the opportunity. These attributes allow the model to analyze how different variables influence the probability of scoring.
The dataset includes information such as:
- shot location on the pitch
- type of scoring opportunity
- contextual match information
- outcome of the shot (goal or no goal)
Because goals are relatively rare compared to the total number of shot attempts, the dataset exhibits a strong class imbalance. Most shots do not result in goals, meaning that the number of non-goal observations significantly exceeds the number of goal observations.
To address this issue during model development, the dataset was balanced using down-sampling techniques, where the number of non-goal observations used during training was reduced. This helps the logistic regression model learn meaningful relationships between the variables and the scoring outcome.
Methodology
Section titled “Methodology”The Expected Goals model was implemented using logistic regression, which is commonly used for binary classification problems.
In the context of Expected Goals modeling, each shot event can produce one of two possible outcomes:
| Outcome | Description |
|---|---|
| Goal | The shot resulted in a goal |
| No Goal | The shot did not result in a goal |
Logistic regression estimates the probability that the outcome of a shot event belongs to the Goal class.
The probability is calculated using the logistic function:
Where:
| Symbol | Meaning |
|---|---|
| P(goal) | probability that the shot results in a goal |
| β0 | intercept |
| β1 … βn | regression coefficients |
| X1 … Xn | model variables |
These variables describe the characteristics of the scoring opportunity.
Distance to Goal Mouth
Section titled “Distance to Goal Mouth”One of the most important variables used in the model is the distance between the shot location and the goal mouth.
The center of the goal is defined as the coordinate:
(50, 0)If a shot is taken from location (x, y), the distance to the goal mouth is calculated using the Euclidean distance formula:
Distance has a strong influence on the probability of scoring. As the distance between the shooter and the goal increases, the probability of scoring decreases.
Instead of using the raw distance directly, the model uses the logarithm of the distance, which provides better statistical behavior for the regression model.
Shooting Angle
Section titled “Shooting Angle”Another important variable is the shooting angle, which represents how much of the goal mouth is visible from the position of the shot.
The shooting angle is defined as the angle between the lines connecting the shot location to the two goal posts.
The coordinates of the goal posts are defined as:
Left Post = (50, 4)Right Post = (50, -4)The width of the goal used in the model is:
GoalWidth = 8The angle is calculated using the distances between the shot location and each of the goal posts.
Where:
| Variable | Description |
|---|---|
| dL | distance from shot location to the left post |
| dR | distance from shot location to the right post |
A larger shooting angle means that a greater portion of the goal is visible to the player, which increases the probability of scoring.
Angles Buckets
Section titled “Angles Buckets”The diagram should show:
- the shot location
(x,y) - the left goal post
(50,4) - the right goal post
(50,-4) - the two lines connecting the shot to each post
- the angle between those lines

Angle Buckets
Section titled “Angle Buckets”To better capture the relationship between shooting angle and scoring probability, the model groups angles into discrete ranges known as angle buckets.
| Bucket | Angle Range |
|---|---|
| 0 | 0° – 10° |
| 1 | 10° – 20° |
| 2 | 20° – 30° |
| 3 | 30° – 40° |
| 4 | 40° – 50° |
| 4+ | ≥ 50° |
These categories allow the model to capture non-linear relationships between angle and scoring probability.
Chance Type Variables
Section titled “Chance Type Variables”The model also incorporates several binary variables describing the type of scoring opportunity.
Each variable takes the value:
1 = true0 = false| Variable | Description |
|---|---|
| isHeader | shot was taken with the head |
| isPenalty | shot resulted from a penalty kick |
| isOneOnOne | player was in a one-on-one situation with the goalkeeper |
| isFreeKick | shot resulted from a direct free kick |
These variables allow the model to capture systematic differences between types of chances.
Summary
Section titled “Summary”The KoraStats Expected Goals model was developed using historical match data from several seasons of the Egyptian Premier League.
The model estimates the probability that a shot results in a goal using logistic regression and a set of variables describing the characteristics of the scoring opportunity.
Key variables used by the model include:
- distance to the goal
- logarithm of the distance
- shooting angle
- angle bucket classification
- type of scoring opportunity
By combining these variables within a probabilistic framework, the model assigns a probability value to each shot attempt.
These probability values represent the Expected Goals value of the opportunity, allowing KoraStats analysts to evaluate attacking performance based on the quality of chances created rather than solely on the number of goals scored.