In soccer there is a part of the game called penalty kick. There are two reason this may occur. The first is that the attacking player was fouled close to goal, in fact in what is called the "penalty box". Any foul to the attacking player in this area results in a penalty. The second reason is as a way to break ties, this is used particularly in tournaments where it is necessary to have a winner and loser.
The game has two players, a Kicker and a Goal Keeper. The Kicker must place the ball in a particular location which is 11 meters from the goal line. The ball must be stationary when it is kicked by the designated kicker. The Goal Keeper can stand anywhere as long as it is behind the goal line. All other players must be back behind the Kicker.
We can simplify the game to be one in which the Kicker and the Goal Keeper have three choices, LEFT, CENTER and RIGHT. For the Kicker this means the direction the ball is kicks while for the Goal Keeper it means the direction the Goal Keeper jumps.
There is very little time for the goal keeper to react to the kicker's decision so we will model the problem as one of simultaneous choice. We have a complete information static game with two players and three strategies.
What is the equilibrium of the game?
What do you think is the best strategy for the Goal Keeper? Have a look at the video of saves above does that help? What do you think is the best strategy for the Kicker?
Can you find the Nash equilibrium of the game? Remember for a Nash equilibrium it must be that the Kicker's strategy is optimal given the Goal Keeper's strategy AND the Goal Keeper's strategy is optimal given the Kicker's strategy.
The table above summarizes the game. The Kicker's choices are the rows and the Goal Keeper's choices are the columns. In each cell is the probability that there is a score given the choices of the two players. We only need one number because the payoff for the Goal Keeper is just 1 - Pr(Score). If the Kicker cares about the probability of scoring the Goal Keeper cares about the probability of not scoring.
There is no Nash equilibrium of the game in "pure strategies". We need to allow players to choose "mixed strategies." These are strategies where the player puts a probability weight on each action. For example 20 percent on LEFT, 40 percent on CENTER and 40 percent on RIGHT. This is not necessarily a good mixed strategy but is a mixed strategy.
To find the mixed strategy Nash equilibrium we can use the following algorithm. To find the weights for the Goal Keeper we choose them such that the Kicker is indifferent between the three options, LEFT, CENTER and RIGHT. Similarly to find the weights for the Kicker we pick them such that the Goal Keeper is indifferent between the three choices. Does this give you a Nash equilibrium? Remember if the Kicker is indifferent betwen the three choices then they are also indifferent between any weight of the choices. If they are indifferent then there is no choice that makes them better off.
The data is from the English Premier League for the 2016/2017 season. Go here: https://www.kaggle.com/datasets/mauryashubham/english-premier-league-penalty-dataset-201617
file = paste0(dir, "penalty_data.csv")
data = fread(file) |>
filter(
Kick_Direction != ""
)
Bring in the data from "dir" pathway and then drop the observations with missing kick direction.
q_k = table(data$Kick_Direction)
q_k = q_k/sum(q_k)
q_k = q_k[c(2, 1, 3)]
q_g = table(data$Kick_Direction)
q_g = q_g/sum(q_g)
q_g = q_g[c(2, 1, 3)]
action = c("L", "C", "R")
res_mat = matrix(NA, 3, 3)
for(i in 1:3) {
for(j in 1:3) {
dt_ij = data[data$Kick_Direction == action[i] &
data$Keeper_Direction == action[j]]
res_mat[i, j] = mean(dt_ij$Scored == "Scored")
}
}
res_mat = cbind(q_k, res_mat)
res_mat = rbind(c(NA, q_g), res_mat)
Create a table of the observed behavior in the data.
The table below presents the probabilities that each player chooses a particular direction and then the cells are the probability that a goal is scored given the actions of the two players.
What do you think the table should look like? Does it make sense that there is a 0 in the middle? Where would you expect the highest probabilities along the diagonal where both players choose the same direction or in the opposite corners of the where one player chooses LEFT and the other chooses RIGHT? Why do kicks to the CENTER have such high probabilities? Why don't Kickers kick CENTER with higher weights?
The footedness of the kicker likely has some effect on the equilibrium. A right footed kicker may do better kicking to the LEFT. A right footed kicker can get the ball to spin counter clockwise and move from right to left in the air. This means the ball will move away from the Goal Keeper.
The issue with testing this is that we don't actually observe that many times where there is a left footed kicker. To deal with the missing data we can lean on the game theory.
The game theory tells us a number of things that must be true in the data. In equilibrium the weighting of strategies by the Kicker must give the same probability of a score for each direction chosen by the Goal Keeper. Similarly the weighting of strategies by the Goal Keeper must give the same probability of a score for each direction chosen the the Kicker.
f_mixed = function(q_k, q_g, p) {
p = matrix(unlist(p), nrow=3)
pi_1 = t(q_k)%*%p[,1]
pi_2 = t(q_k)%*%p[,2]
pi_3 = t(q_k)%*%p[,3]
pi_4 = t(q_g)%*%p[1,]
pi_5 = t(q_g)%*%p[2,]
pi_6 = t(q_g)%*%p[3,]
return((pi_1 - pi_2)^2 + (pi_1 - pi_3)^2 +
(pi_4 - pi_5)^2 + (pi_4 - pi_6)^2)
}
f_mixed_int = function(par, p) {
q_k = exp(par[1:3])/sum(exp(par[1:3]))
q_g = exp(par[4:6])/sum(exp(par[4:6]))
return(f_mixed(q_k, q_g, p))
}
This code takes in data which is p a matrix of the actual probabilities of a score given the choices of the two players (3 X 3 matrix).
From this matrix it backs what the equilibrium strategies were that created the observed probabilities.
It minimizes sum of squares to determine the equilibrium strategies for the two players.
We can use the observed probabilities of scoring conditional on each of the outcomes in the game to back out what the equilibrium strategies must be. But we actually have more information. We do actually see the probability weights that the two players choose in the data. Now these are a bit shaky because we don't observe much data, but we can throw them into our pot.
By combining observed weights by the two players, observed scoring probabilities and equilibrium requirements we can back out the most likely weights used by the players.
The table shows the weights on the choices for the Kicker and the Goal Keeper, these are in rows. The two main columns to look at are labeled "Right" and "Left" these refer to the footedness of the kicker. Are the two columns different?
The table above uses the method described above (a generalized method of moments estimator) to determine whether the Kicker and the Goal Keepers behave differently based on the footedness of the Kicker. We see that Left-footed kickers are much more likely to choose RIGHT than right-footed kickers. But Goal Keepers are also much more likely to choose RIGHT when facing a left-footed kicker than a right-footed kicker. Interestingly there is not much difference in the weight on LEFT for right and left footed kickers. That said, the Goal Keepers are much more likely to choose LEFT when facing a right footed kicker.