1 T T H HE E S S O O C C C C E E R R W WO O R R L L D D C C U U P P A A M Ma a t t h h e e m ma a t t i i c c a a l l A A p p p p r r o o a a c c h h By: Andrei C. Grecu April 17, 2006 ORFE Advisor: John Mulvey Submitted in partial fulfillment Of the requirements for the degree of Bachelor of Science in Engineering Department of Operational Research and Financial Engineering Princeton University
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
TTHHEE SSOOCCCCEERR WWOORRLLDD CCUUPP
AA MMaatthheemmaattiiccaall AApppprrooaacchh
By: Andrei C. Grecu
April 17, 2006
ORFE Advisor: John Mulvey
Submitted in partial fulfillmentOf the requirements for the degree ofBachelor of Science in Engineering
Department of Operational Research and Financial EngineeringPrinceton University
2
I hereby declare that I am the sole author of this thesis.
I authorize Princeton University to lend this thesis to other institutions or individuals for
the purpose of scholarly research.
Andrei C. Grecu
I further authorize Princeton University to reproduce this thesis by photocopying or by
other means, in total or in part, at the request of other institutions or individuals for the
purpose of scholarly research.
Andrei C. Grecu
3
To my grandfather, Nicolae Dumitrescu
4
ACKNOWLEDGEMENTS
I am especially grateful to Professor Mulvey for his guidance in writing this
thesis, his advice and his unyielding support. I would also want to thank Professor
Vanderbei, Professor Powell, and Professor Lord for teaching me a lot of the material
used in this thesis. In addition, I am indebt to the whole Princeton community for
challenging my mind over the last four years.
Dear family, thank you for your incredible support from thousands of miles away,
in Romania. I would have been lost without you in this process.
5
TABLE OF CONTENTS
CHAPTER 1: INTRODUCTION……………………… 6 – 11
CHAPTER 2: RANKING ALGORITHMS………… 12 – 41
2.1 EIGENVECTOR RANKINGS……………. (16-24)
2.2 RANDOM WALKERS RANKINGS……… (25-30)
2.3 NEURAL NETWORK RANKINGS……… (31-41)
CHAPTER 3: A POISSON MODEL FOR WORLD CUP GAMES………….………………42 – 57
CHAPTER 4: SIMULATING THE WORLD CUP…58 – 65
CHAPTER 5: CONCLUSION…………………………66 – 69
APPENDIX A: NEURAL NETWORK C++ CODE…70 –75
APPENDIX B: NEURAL NETWORK EVOLUTION 76
BIBLIOGRAPHY……………………………………… 77 – 78
Chapter 1: Introduction Andrei C. Grecu
6
Chapter1: Introduction
“ Some people believe soccer is a matter of life and death.
I am very disappointed with that attitude.
I can assure you it is much, much more than that. “
Bill Shankly, President of F.C. Liverpool
The Soccer World Cup tournament, held every four years, is the most watched
sports event in the world, surpassing even the Olympic Games. Moreover, enthusiasm for
soccer is relatively uniformly spread across the world, both in term of spectators and
actual participants. For example, 194 national teams, essentially a team for every country
in the world, competed in qualifying games for a place in the next World Cup final
tournament, which will take place in Germany, in June-July 2006. Given the international
appeal of soccer and of the World Cup in particular, there is a huge interest in assessing
the relative strengths of the teams that take part in the tournament and implicitly
predicting the overall winner.
The intrinsic complexity of the World Cup tournament makes the job of ranking
participating teams both challenging and mathematically stirring. In the first phase of the
tournament, over a period of about two years, approximately 200 national teams compete
in qualifying games on five continents, with the highest ranked teams in each
Chapter 1: Introduction Andrei C. Grecu
7
geographical region advancing to the final tournament. Subsequently, the 32 qualified
teams travel to the country that organizes the World Cup and embark upon a marathon of
games. Initially, the 32 teams are divided into eight groups of four, with each group
playing six round robin matches. Following the initial games, the top two teams from
each group advance to the second round of the final tournament, which consists of a
simple 16-team knockout tournament. Thus, after approximately one month and 64
matches played, the final of the World Cup determines the World Cup Champion, “the
best” national team in the world for the next four years.
While the World Cup effectively compares teams by having them play against
one another on the soccer field, any attempt to rank the teams before the start of the
competition faces a number of challenges. First, by its very nature soccer is a highly
unpredictable game- only a few goals are scored during the ninety minutes of a normal
game, and as opposed to baseball or football, few statistics are recorded for each game.
Second, participating teams come from various regions of the world, in which soccer is
played at different levels- even though the winner of a geographic region might be much
weaker than the winner of another region, the format of the World Cup guarantees that
teams from all regions take part in the final tournament. Third, the relative rarity of
games between national teams makes it difficult to find sources for comparison- a soccer
national team only plays an average of ten games every year, so there are still national
teams that have never played one another. Despite the challenges discussed here, a
number of papers have tried to model soccer scores and simulate the World Cup
tournament.
Chapter 1: Introduction Andrei C. Grecu
8
Literature Review
Kuonen (1997) fits a logistic regression for the probability of winning a soccer
game, based on seeding coefficients computed from the outcome of previous games
played by the two teams. Karlis and Ntzoufras (1998) examine the choice of a Poisson
distribution for modeling goals in soccer games and build a Poisson log-linear model for
scores in the Greek national league. Dyte and Clarke (2000) also assume a Poisson
distribution of goals and model the 2002 World Cup based on the (controversial) national
team rankings provided by the Federation of International Football Association (FIFA).
The Palomino, Rigotti, and Rustichini (1998) model, inspired from game theory, looks at
a soccer game in continuous time and examines the effect of three factors- team’s ability
(performance record), passion (home-field advantage), and strategy (reaction to current
score), in determining the outcome of a soccer game. Finally, Koning (2001) simulates
soccer championships using a Poisson fit to predict game outcomes based on historical
scoring intensities of the two teams involved in the game.
Simulating the soccer World Cup final tournament is even more challenging
than simulating the games in a national league. Teams that compete in the World Cup
final tournament come from different qualifying tournaments, in which the soccer played
can have different characteristics. For example, national teams in South America tend to
score on average more goals when they play each other than teams in Europe do.
Therefore, the average number of goals scored per game might not be the best variable to
predict the result of an encounter between a team in South America and a team in Europe.
In all the models mentioned in the previous paragraph, the variables used in fitting the
regressions are derived from aggregate statistics of the previous performance of the two
Chapter 1: Introduction Andrei C. Grecu
9
teams. This approach might be reasonable for teams competing against the same
opponents in a league, but in the case of the World Cup we need to adjust the variables to
account for the different backgrounds from which participating teams come from.
Regarding the soccer World Cup as a competition between teams coming from
different regional tournaments brings to mind the problem faced every year by the Bowl
Championship Series (BCS) in ranking American college football teams. The two
problems- ranking college football teams and ranking World Cup soccer teams, are
similar in that: i) the number of games played by every team is relatively small, ii) teams
play many more games within their regional league than against teams in other leagues,
and iii) crucially, the quality of the opponents of different teams varies from region to
region. Thus, the techniques used to rank college football teams can be tailored to rank
the teams that participate in the soccer World Cup.
The theory behind ranking teams in uneven paired competitions has strong and
diverse mathematical foundations. Keener (1993) formulates the ranking problem as a
linear eigenvalue problem and solves it by using the result of the Perron-Frobenius
theorem. Goddard (1983), Stob (1985) and Ali, Cook, and Kress (1986) develop
algorithms for rankings that satisfy the so-called minimum violations ranking (MVR)
criterion, which minimizes the instances in which lower ranked teams defeat higher
ranked teams. Wilson (1995) builds a neural network based on previous interactions
between teams and looks for the equilibrium values of the network. Finally, Thomson
(1975) and Reid (2003) design least squares and maximum likelihood methods for
ranking teams. Even though some these rankings have strong mathematical foundations,
Chapter 1: Introduction Andrei C. Grecu
10
all ranking methods are intrinsically subjective by means of the variables chosen to
explain outcomes, the parameters of the model, and the final interpretation of the results.
Overview
This thesis looks at the soccer World Cup and uses mathematical tools to
determine the relative strengths of the participating teams and simulate the structure of
games within the tournament. Given the various backgrounds of the qualified teams, and
the complexity of the World Cup tournament, I use a three-step approach to assessing the
relative strengths of the national soccer teams that participate in the soccer World Cup.
First, in Chapter 2 I implement three algorithms to rank the participating teams,
before the start of the tournament: i) a matrix-based method takes as input previous
interactions among teams and returns an eigenvector with the relative value assigned to
each team. ii) a random walker algorithm looks at the steady-state macroscopic solution
of a setting in which a number of vacillating voters perpetually change their mind
regarding their favorite team, thus executing random walks on a network defined by the
participating teams (nodes) and their previous interactions (edges). iii) a neural network
algorithm looks at a neural network whose nodes are the participating teams and whose
connections are determined by previous interactions among the teams, and uses a soccer-
intuitive transfer function to update the value of each node (team) until a steady state
solution is reached.
Second, in Chapter 3 I use the rankings presented above to make predictions
regarding the outcome of separate games in the World Cup. I start by assuming a Poisson
distribution of goals scored in a soccer game and I fit a nonlinear regression using the
Chapter 1: Introduction Andrei C. Grecu
11
number of goals scored by each team in the games from the 2002 World Cup. Using the
regression results, I compute the probability of winning assigned to both teams
competing in a World Cup game. However, given the complex structure of the soccer
World Cup, it is difficult to explicitly calculate the conditional probabilities for each team
to win the tournament, so I decide to simulate the games instead.
Third, the simulation of the World Cup games performed in Chapter 4 allows me
to determine the probability of winning the World Cup assigned to each team. In order to
determine the manner in which teams are favored or disadvantaged by the World Cup
draw, I also simulate a round robin competition between all the teams qualified for the
World Cup. Even though such full competition is not possible in practice because of the
great number of games involved, it is considered intuitively the fairest way of
determining the best team. Therefore, by comparing the winning probabilities from the
World Cup simulation with the winning probabilities from the round robin simulation, I
am able to determine which teams had a “lucky draw” for the World Cup games.
Finally, I conclude in Chapter 5 by examining the accuracy of my predictions for
the 2002 World Cup, making predictions for the up-coming 2006 World Cup, and
drawing an analogy between sports betting and the financial markets.
Chapter 2: Ranking Algorithms Andrei C. Grecu
12
Chapter 2: Ranking Algorithms
Overview
This chapter presents three algorithms used for ranking the 32 soccer national
teams that qualified for the 2006 Soccer World Cup. By looking at historical games
played between soccer national teams around the world, each algorithm returns the
relative values of the teams prior to the start of the tournament. Whilst past performance
is not always a good indicator of the present value of a team, I will focus on those
historical games that are most relevant to the real value of the teams.
First, I look at games that took place in conditions somehow similar to the World
Cup, namely games played on neutral field as part of a relevant, competitive
championship. Luckily, independent of the World Cup, national soccer teams also
compete for regional supremacy on each continent. Thus, every two years, African
countries compete in the African Nations Cup. Every four years, national teams in Asia
compete for the Asian Cup. Held every two years, the CONCACAF Gold Cup reunites
teams in North America. Every three years, teams in South America take part in Copa
America. Finally, every four years the best teams in Europe participate in the European
Championship. This plethora of regional tournaments generates a significant number of
interactions between teams on the same continent. Conveniently, the World Cup, which
takes place every four years, reunites teams from all over the world, thus allowing
comparisons between teams on different continents.
Chapter 2: Ranking Algorithms Andrei C. Grecu
13
Second, I am interested in historical games played between two teams of
comparable strength. For ranking purposes, the fact that Australia beat Cook Islands 16-0
is far less relevant than a tight game between two teams of comparable strengths, such as
Germany and Argentina. Therefore, I will focus my analysis only on games in which both
teams qualified for at least one of the previous three World Cups. This totals 55
competitive teams, with 26 teams from Europe, 9 from Africa, 8 from South America, 7
from Asia, and 5 from North America:
Figure 1: The five qualifying regional tournaments with the number of
teams that qualified to at least one World Cup since 1994 in parentheses
Even though only 32 soccer teams qualified for the 2006 World Cup, I choose to
look at games played among 55 teams of comparable strength. By looking at more games
and ranking 55 instead of only 32 teams, I increase the precision of the algorithms in
determining the values of the 32 teams that did qualify for the World Cup. For example,
even though Cameroon did not qualify for the World Cup this year, its previous games
SouthAmerica
(8)
Europe(29)
Asia(7)
Africa(8)
NorthAmerica
(5)
Chapter 2: Ranking Algorithms Andrei C. Grecu
14
against competitive teams around the world allows us to better rank other African teams.
For instance, Togo qualified for the first time to the World Cup this year, so it does not
have direct previous interactions with teams on other continents. However, its games
against Cameroon and other African countries allow us to better determine Togo’s overall
strength.
Finally, I consider games played between soccer national teams over the last 12
years. Although this is a long period of time, each game is also assigned a weight that
decreases with the number of years since the game took place. Thus, a game that took
place ten years ago is approximately ten times less significant in determining the current
value of the team than a game that took place this year is. In addition, a lot of skilled
soccer players start playing for their national teams when they are very young and they
do play for ten or twelve years before they retire. Also, it is not unusual for a national
team to form around a nucleus of talented players who will play for their country for
approximately a decade. Consequently, putting heavy weights on recent games, but also
decreasing weights on past encounters, effectively captures the relative strengths of the
teams over time. By comparison, the Federation of International Football Association
(FIFA) also uses results from the previous eight years in computing its coefficients for
each country.
To sum up, I look at historical games between competitive teams as part of a
competitive tournament, in which the teams play their best players at full potential. In
particular, I look at 477 games among 55 teams at the following competitions:
Chapter 2: Ranking Algorithms Andrei C. Grecu
15
1. World Cup: South Korea/Japan 2002, France 1998, USA 1994
Burkina Faso 1998, South Africa 1996, Tunisia 1994
3. Asian Cup: China 2004, Lebanon 2000, United Arab Emirates 1996
4. CONCACAF Gold Cup: USA 2005, Mexico 2003, USA 2002, USA 2000,
USA 1998, USA 1996
5. Copa America: Peru 2004, Colombia 2001, Paraguay 1999, Bolivia 1997,
Uruguay 1995
6. European Championship: Portugal 2004, Belgium/Netherlands 2000, England
1996
Acknowledgements
The first algorithm is inspired from the matrix-based algorithms for ranking
American college football teams, as discussed in Keener (1993), Boginski, Butenko, and
Pardalos (2004), and Martinich (2003). The second algorithm is a variation of the random
walker algorithm discussed in Callaghan, Mucha, and Porter (2005). The third algorithm
is a neural network method somehow similar to the approach presented in Wilson (1995).
However, I modify each of these algorithms in at least two important ways. First,
I implement soccer-intuitive functions and parameters in each algorithm, so that they deal
with results of soccer rather than football games. Second, since I look at games that took
place over a longer period of time, I discount the importance assigned to each game, so
that recent games have a much greater impact on the rankings than older games do.
Chapter 2: Ranking Algorithms Andrei C. Grecu
16
2.1 Eigenvector Rankings
The Intuition
“Spain beat Italy, and Italy beat Brazil, therefore Spain should win against
Brazil” or more intricate “Brazil tied against Germany, Germany beat Japan, and Brazil
lost against Italy, therefore Italy should definitely win against Japan”- sport fans often
make such kinds of conjectures regarding the outcome of future games based on previous
results. Even though such predictions often turn out to be wrong, the deduction process is
not entirely speculative, as previous games do contain information regarding the relative
strengths of the teams. For example, consider the following history of games between
soccer national teams represented by a directed graph- an arrow from BRA to GER
indicates that team BRA beat team GER:
BRA GER
TUNITA
SPA
JAP
Figure 2: Directed graph showing a hypothetical history of games
In this scenario, JAP clearly looks like the weakest of the six teams depicted, but
it is less intuitive how the other teams are ranked, especially since different teams have
Chapter 2: Ranking Algorithms Andrei C. Grecu
17
played a different number of games. A starting point for comparison might be the
winning percentage of each team, winning% = number of games won
total number of games:
BRA GER ITA SPA TUN JAP
0.500 0.667 0.500 0.667 0.500 0.000
Using winning percentage as the ranking criterion, GER and SPA are tied for first
place. However, such a ranking does not take into account the quality of teams defeated
by each team Should GER and SPA get the same credit for defeating ITA and TUN,
respectively? In order to account for the strength of schedule of each team, we calculate
updated winning percentages using the defeated team’s winning percentage instead of a
1, to account for a victory, (winning% of defeated teams)
total number of games . For example, the updated
winning percentage for GER is 0.500 0.667
0.3893
, since GER played a total of three
games and beat ITA and SPA, whose winning percentages were 0.50, and 0.67,
respectively. Similarly, the updated winning percentage for SPA, which used to be tied
with GER, is now (0.500 0.500)
0.3333
. With the updated winning percentages, GER
is ranked ahead of everybody else since it beat better opponents:
BRA GER ITA SPA TUN JAP
0.333 0.389 0.125 0.333 0.000 0.000
Chapter 2: Ranking Algorithms Andrei C. Grecu
18
However, if we update the winning percentages once again, we obtain an even
better ranking, based upon already updated winning percentages for each team. With the
new percentages, BRA is now ranked in first place! However, if we keep updating the
winning percentages following the process described above, the rankings eventually
stabilize to the following:
BRA GER ITA SPA TUN JAP
0.344 0.290 0.204 0.162 0.000 0.000
In other words, BRA gets the first place because its victory came against a very
strong GER, while GER’s two victories came against relatively weaker ITA and SPA.
Also, even though ITA and SPA have the same number of victories as GER, half their
victories came against the weak teams TUN and JAP, which in turn lowered their own
ranking. Thus, using a reasonably intuitive algorithm, we were able to rank the teams
according to their winning percentages adjusted for the relative strength of their
schedules.
The Mathematical Model
Consider a competition in which N participants play an uneven paired schedule,
meaning that not all teams play each other. Let ni be the number of games played by
participant i, and let aij be some nonnegative number assigned to each team, depending on
the outcome of the game between participant i and participant j. Now, if we assume that r
Chapter 2: Ranking Algorithms Andrei C. Grecu
19
is a vector of ranking values, with positive component rj indicating the strength of the jth
participant, then we define the overall score for participant i as:
i1
1s * *
N
ij jji
a rn
The division by ni prevents teams from accumulating a large score just by playing
extra games. Also, the matrix A with entries aij is often called a preference or dominance
matrix, since it contains the scores assigned to each team based on its previous
interactions with other teams. If we further assume that the rank of a team is proportional
to its score, then the ranking vector r has to be a positive eigenvector of the positive
matrix A:
*r *rA
An example of a scheme that assigns scores aij as a function of the outcome of a
separate game between team i and team j, is the following:
aij =
1, if team i beat team j
0.5, if team i and team j tied
0, if team i lost against team j
With the choice of aij described above and letting r0 be the column vector with j
entries, it is easy to check that A*r0 is the column vector corresponding to the winning
percentages of each team, A2*r0 gives the average winning percentage of all defeated
teams, and so on. The solution that we are looking for is the limit, limn
(An*r0). However,
the product An*r0 gets very small as n tends to infinity, so we use the power method to
Chapter 2: Ranking Algorithms Andrei C. Grecu
20
find the ranking vector r, which is the eigenvector corresponding to the largest
eigenvalue of A:
0
0
*rr lim
| *r |
n
nn
A
A
The Perron-Frobenius theorem tells us when this limit exists and gives a unique,
positive solution for the ranking vector r:
Theorem: If matrix A has nonnegative entries, then there exists an eigenvector r
with nonnegative entries, corresponding to a positive eigenvalue λ. Furthermore, if the
matrix A is irreducible, the eigenvector r has strictly positive entries, is unique and
simple, and the corresponding eigenvalue if the largest eigenvalue of A in absolute value.
For paired competitions, the matrix A is irreducible if there is no partition of the
teams into two sets S and T such that no team in S has played any team in T, or every
game between a team from S and a team from T resulted in a victory for the team in S. In
other words, we need all teams to be connected by previous games, and we need a cycle
in the directed graph- we need a sequence of distinct teams t1, t2, t3, …, tk such that t1 beat
t2, t2 beat t3, …, and tk beat t1. In particular, for the preference matrix to be irreducible,
there can be no winless teams. When these conditions are satisfied, the limit
0
0
*r lim
| * |
n
nn
A r
A r converges to the unique positive eigenvector of A, which gives a
positive ranking of teams.
Chapter 2: Ranking Algorithms Andrei C. Grecu
21
Using the preference matrix A to find the ranking vector of teams has sound
mathematical foundations and effectively takes into account the strength of schedule of
each team when rankings the teams. However, the weakness of this method comes from
the subjective choice of the score aij for team i, following a game between team i and
team j. A scheme that assigns a score of 1 for a victory, 0.5 for a tie, and 0 for a loss, is
the natural choice, since in this case A*r0 gives the winning percentages of the teams, and
A2*r0 gives the average winning percentage of all defeated teams, thus containing
information regarding the strength of schedule. In particular, this scheme works well
when teams play each other frequently, thus making aij a better indicator of the
comparative strength of the two teams. However, when interactions between teams are
relatively rare or even reduced to one game- as is often the case with soccer national
teams, this simple scheme ineffectually gives all of the credit for the win to the winner,
while the loser gets a score of zero, regardless of the degree of its defeat.
In order to avoid lopsided splits of the merit for a victory between the two teams,
I implement a formula that assigns both teams a score of 0.5 before the start of the game,
and then updates the scores, as a function of the number of goals scored by each team:
2*cf ij
ijcf ij ji
Y Ga
Y G G
Where:
cf
is the number of goals scored by team i against team j
Y is a year coefficient equal to number of year since the game took place
ijG
Chapter 2: Ranking Algorithms Andrei C. Grecu
22
In case of a tie, Gij= Gji, this scheme assigns each team a score of 0.5. Then, the
more convincing the victory, the closer the winner’s score gets to 1 and the loser’s score
gets to 0, without actually equaling 1 or 0, respectively. Furthermore, by means of the
year coefficient Ycf, this scheme puts a lot of emphasis on games played in recent years
and decreasing weights on games played a long time ago. For example, a 3-1 victory of
team i over team j brings team i aij= 1 3
0.6672 3 1
points for a game played in 2006,
but only aij= 12 3
0.5362*12 3 1
points for a games back in 1994. By assigning the
winning team two thirds of the one point per game in 2006, but only slightly more than
the initial half-half split in 1994, this scheme clearly rewards current success more than
past results.
Application to the 2006 Soccer World Cup
In order to rank the teams that qualified to the 2006 soccer World Cup, I applied
the algorithm described above to 477 games among the 55 national teams that took part
in at least one World Cup between 1994 and 2006. Importantly, all 477 games took place
during a major tournament, under conditions somehow similar to the World Cup. First,
teams had a great incentive to win the game and advance to the next phase of the
tournament, thus playing its best available players at full capacity. Second, games took
place on neutral territory, so that no teams (other than the nation organizing the
competition) enjoyed the home-field advantage.
Plugging the 477 games in Excel, and manipulating the data to assign a score to
all previous interactions using the scheme discussed in the previous section, I formed the
Chapter 2: Ranking Algorithms Andrei C. Grecu
23
dominance matrix A. Using MATLAB to find the eigenvector 0
0
*r lim
| * |
n
nn
A r
A r , I
obtained the ranking of the 55 teams considered. Within the ranking of the 55 teams, I
identify the teams that qualified for the 2006 World Cup in Germany, and I scale the
results on a 100-point scale for the following final rankings1:
1 Australia and Ukraine did not participate in any of the 27 major tournaments considered, so they were not among the 55 teams ranked. Consequently, I arbitrarily assumed that Australia and Ukraine take the value of the last competitive team that they defeated: Australia defeated Uruguay in the playoffs for the 2006 World Cup, and Ukraine defeated Turkey in the 2nd European qualifying group. Therefore, I assigned Australia the value of Uruguay, and Ukraine the value of Turkey.
Chapter 2: Ranking Algorithms Andrei C. Grecu
24
2006 EIGENVECTOR RANKING
1 BRAZIL 100.002 ITALY 87.523 GERMANY 84.654 MEXICO 81.895 NETHERLAND 77.876 ARGENTINA 73.337 FRANCE 72.428 ENGLAND 68.299 SPAIN 65.4610 PARAGUAY 64.5511 SWEDEN 60.9612 CROATIA 60.7813 PORTUGAL 58.5314 USA 57.1515 SOUTH KOREA 52.2116 AUSTRALIA 48.1517 UKRAINE 43.7618 SAUDI ARABIA 42.0919 COSTA RICA 40.8920 ECUADOR 39.4421 TUNISIA 36.7922 CZECH REPUBLIC 35.8123 JAPAN 35.6324 SWITZERLAND 33.4925 SERBIA AND MONTENEGRO 23.1126 IRAN 20.9727 GHANA 17.7828 IVORY COAST 15.2029 TRINIDAD AND TOBAGO 13.6830 POLAND 10.0931 ANGOLA 8.1632 TOGO 7.33
Chapter 2: Ranking Algorithms Andrei C. Grecu
25
2.2 Random Walkers Rankings
The Intuition
Soccer fans are renowned for the fanatic love and loyalty to their team. However,
for the sake of this algorithm, we need to consider a set of N perpetually vacillating
soccer supporters. Each of these N supporters gets a single vote to designate his or her
favorite team out of the 32 teams qualified for the soccer World Cup. However, over time
each supporter changes her favorite team according to the following rule:
1. She recalls the win-loss outcome of a single game played by her favorite team
2. She flips a weighted coin that is more likely to come up Heads
3. Completely ignoring her current favorite, she goes with the winner of the
game if Heads, and with the loser if Tails
4. Returns to step 1
By constantly looking at historical games between teams and flipping weighted
coins to decide which team to vote for, supporters will perpetually change their mind
regarding their favorite team. Indeed, at the microscopic level voters act as perpetual
random walkers on a network whose nodes are defined by soccer teams, and whose
connections are defined by previous games between the teams. However, even though
each individual voter is a random walker, at a macroscopic level the total number of votes
cast for each team stabilizes over time. Thereafter, we are able to rank the teams
according to fraction of soccer supporters who vote for each team.
The main appeal of this ranking scheme is its simplicity. The only subjective
input for the algorithm is the weight of the coin flipped by the soccer fans- the probability
Chapter 2: Ranking Algorithms Andrei C. Grecu
26
with which they go with the winner of the game they consider. In order to make the
algorithm reasonable, this probability must lie within the interval (0.5, 1), so that the
supporter’s vote goes for the winner, rather than with the loser of the game she consider.
In particular, a coin weight close to the p= 0.5 limit does not guarantee a vote in case of a
victory, but rather rewards the strength of schedule of each team. On the other hand, a
coin weight close to the p= 1 limit almost guarantees a vote in case of a victory, therefore
favoring teams with an undefeated record. With these considerations in mind, I will let
voters in my model go with the winner of the game with the mid-value probability p=
0.75, so that the algorithm equally emphasizes the strength of schedule and the winning
record of the teams.
The Mathematical Model
Consider a competition in which N teams play an uneven paired schedule,
meaning that not all teams play each other. For each team i, let ni be the total number of
games played, wi the number of wins, and li the number of losses. Because soccer allows
tied games, we treat a tie as half a win and half a loss, so that ni = wi + li stays true. Also,
consider V voters, with vi voters casting their single vote to team i, so that even though
voters change their preferences, the total number of voters remains constant, ii
v V .
At the beginning of the algorithm each voter is randomly assigned a favorite team
out of the N teams to be ranked. Then each of the N voters randomly picks a previous
game played by his favorite team and, completely ignoring his current team preference,
he casts his vote to the winner of that game with probability p, and goes with the loser
with probability 1- p.
Chapter 2: Ranking Algorithms Andrei C. Grecu
27
Additionally, in order to put more emphasis on recent games, I make the
probability of choosing a given game inversely proportional to the number of years since
it took place. In order to do this I assign each game the value 1
kY, where Yk is the number
of years since the game took place, and I recalculate the weighted sums for the number of
games, wins, and losses for each team. For example, assuming that team i played n
games, won w of them, lost l of them, and tied in t of them, I calculate the discounted
number of games, ni, wins, wi, and loses, li, for team i by summing the discounted value
of each separate game and by treating ties as half-wins and half-losses, so that I maintain
the equality ni = wi + li:
1
1n
ik k
nY
1 1
1 10.5*
w t
ik kk k
wY Y
1 1
1 10.5*
l t
ik kk k
lY Y
Where:
i i i
is the number of years since game k took place
n , w , and l are the discounted number of games, wins, and losses
n, w, and l are the real numer of games, wins, and losses for team i
kY
In order to avoid rewarding teams for playing more games, I set the rate at which
a voter considers a game played by his favored team i to be independent of the number ni
of games played by the team. With this choice of constant rates, the expected rate of
Chapter 2: Ranking Algorithms Andrei C. Grecu
28
change for the number of votes cast for each team in the random walk is characterized by
the following homogenous system of linear differential equations:
V’ = G * V
Where:
iV is the column vector of the number of votes v cast for each of the N teams
G is a square matrix whose entries are derived from previous games such that:
* (1 )*ii i iG p l p w
2* 10.5* * ,
2ij ij ij
pG N A i j
Where:
ij
ij
N is the number of games played between i and j
A is the number of times i beat j minus the number of times j beat i
With this choice of matrix G, which encompasses all the outcomes of previous
games between all teams, I am interested in the steady-state equilibrium that gives the
expected number of voters vi who prefer each team:
G * V = O
This equilibrium equation has a unique solution V for any given p in the (0.5,1)
interval. Indeed, with p strictly greater than 0.5, p > 0.5, the off-diagonal elements
2* 10.5* * ,
2ij ij ij
pG N A i j
of the matrix G are non-negative. If, in addition, the
Chapter 2: Ranking Algorithms Andrei C. Grecu
29
underlying graph representing games played between teams consists of a single
connected component, then V is the unique equilibrium solution, lies in the null-space of
G and therefore is the eigenvector associated with the zero eigenvalue. Even though the
equilibrium V does not imply constant flows of voters switching their preference from
team i to team j, it guarantees a constant number of random walkers voting for each team
at any time. Therefore, by reducing the matrix G to its row-reduced echelon form, we can
easily compute the expected number of voters supporting each team, and implicitly rank
the teams according to the overall percentage of votes received.
Application to the 2006 Soccer World Cup
In order to rank the teams that qualified for the 2006 soccer World Cup, I applied
the algorithm described above to the 477 games among the 55 national teams that took
part in at least one World Cup between 1994 and 2006. Using Excel to compute the
discounted number of games, wins, and loses for each team, I constructed the matrix G
used to find the steady-state equilibrium. Then using MATLAB to find the row-reduced
echelon form of G, I determined the relative strength of each of the 55 teams considered.
Choosing the 32 teams qualified for the 2006 World Cup out of the 55 teams, and scaling
the results on a 100-point scale, I obtained the following ranking of teams:
Chapter 2: Ranking Algorithms Andrei C. Grecu
30
2006 WORLD CUP PARTICIPANTS
1 CZECH REPUBLIC 100.002 FRANCE 99.973 BRAZIL 98.444 PORTUGAL 88.175 ENGLAND 82.516 GERMANY 82.057 ITALY 80.788 ARGENTINA 80.619 NETHERLANDS 77.6410 SPAIN 77.4511 MEXICO 72.2312 SWEDEN 69.2213 AUSTRALIA 68.9714 CROATIA 64.0915 PARAGUAY 60.7316 USA 60.4617 SERBIA AND MONTENEGRO 59.9918 UKRAINE 56.6019 JAPAN 53.0320 IRAN 52.8421 SOUTH KOREA 48.2722 TUNISIA 47.5923 POLAND 45.4024 GHANA 41.0425 SWITZERLAND 40.5026 COSTA RICA 38.5027 IVORY COAST 37.1028 TOGO 35.5329 ECUADOR 34.2530 SAUDI ARABIA 33.1731 TRINIDAD AND TOBAGO 29.1232 ANGOLA 27.08
Chapter 2: Ranking Algorithms Andrei C. Grecu
31
2.3 Neural Network Rankings
Artificial neutral networks are biologically inspired algorithms whose pattern-
matching and learning capabilities address problems otherwise difficult to solve using
standard computational and statistical methods. By mathematically modeling the
processes that take place in the human brain, artificial neural networks “learn” from a
given data set, thus being able to develop a solution without needing a predefined
solution algorithm. However, despite their ability to explain complex relationships
between inputs and outputs, artificial neural networks are based on a simple model of
biological neural networks, which makes them intuitively appealing.
Technically speaking, an artificial neural network is characterized by three
elements: i) its processing elements analogous to the neurons in the neural networks, ii)
its connections among processing elements and their corresponding weights, which
contain the information stored in the network, and iii) its evolution algorithm, which
gives the manner in which the neural network searches and converges to a solution.
In an attempt to model the way in which the human brain processes visual data
and learns to recognize objects, psychologist Frank Rosenblatt designed the first artificial
neural network in 1958. Since then, artificial neural network have been applied in a
variety of applications, including bonds rating, target marketing, evaluating loan
applications, predicting stock movements, and certifying signatures. Another application
of neural networks is the rating of sport teams based on previous results, which I will
discuss in this chapter.
Chapter 2: Ranking Algorithms Andrei C. Grecu
32
The Intuition
Wilson (1995) discusses the use of a neural network to rank the NCAA Division
1-A college football teams. In his approach, the processing elements correspond to the
football teams to be ranked, with the value of each neuron representing the relative value
of one team. Also, connections between processing elements correspond to games played
between teams, with the weights of the connections being derived from the score of
previous encounters. Finally, the evolution of the neural network is characterized by the
transfer and summation functions: On one hand, the transfer function look at one game at
a time, takes as inputs the value of the opponent and the weight of the connection
between the two teams, and returns an updated value of the team as a result of that game.
On the other hand, the summation function averages the results of the transfer function
for each game, thus giving the updated value of the team. Eventually, the algorithm stops
when the updated values of all neurons stabilize over time, when a new iteration does not
change the relative value of each neuron.
Using the same setting, I look at the soccer World Cup and design an artificial
neural network that ranks the qualified teams based on their previous results. In order to
do this, I will change the approach presented in Wilson (1995) in two important ways.
First, in assigning weights to the connections corresponding to previous games, I will
factor in both the score and the date of the game, thus putting decreasing emphasis on
games that took place longer time ago. Second, I will implement a soccer-intuitive
transfer function, which updates the values of processing elements (teams) based on the
weight of their connection (score and date of previous game).
Chapter 2: Ranking Algorithms Andrei C. Grecu
33
Consider the following history of games between soccer national teams, in which
the arrow from GER to USA means that team GER beat team USA, and WGER,USA is a
weight that increases with the difference in goals scored by GER and USA, and decreases
with the number of years since the game took place:
WGER,USA
WSPA,GER WUSA,JAP
WUSA,SPA WGER,JAP
Figure 3: Neural network setting with 4 neurons representing
teams, and 5 connections representing previous games
Taking the processing elements and connections as inputs, an evolution algorithm
updates the value assigned to each team at time t based on the team values at time t-1, as
well as the connection weights, which remain constant throughout the algorithm. For the
situation pictured in Figure 3, the following updates are performed at each iteration, until
the value assigned to each team does not change between incremental units of time:
GER USA
SPA JAP
Chapter 2: Ranking Algorithms Andrei C. Grecu
34
1, , 1, , 1, ,,
( , ) ( , ) ( , )
3
T t USA GER USA T t JAP GER JAP T t SPA SPA GERt GER
F V W F V W F V WV
1, , 1, , 1, ,,
( , ) ( , ) ( , )
3
T t GER GER USA T t JAP USA JAP T t SPA USA SPAt USA
F V W F V W F V WV
1, , 1, ,,
( , ) ( , )
2
T t GER SPA GER T t USA USA SPAt SPA
F V W F V WV
1, , 1, ,,
( , ) ( , )
2
T t GER GER JAP T t USA USA JAPt JAP
F V W F V WV
Where:
T t-1
t,ABC
ABC,XYZ
F is the transfer function with inputs V and W
V is the value of team ABC at time t
W is the weight of the connection between team ABC and team XYZ
Intuitively, the transfer function FT should i) increase the value of a team
following a victory, ii) assign more value to a victory against a strong opponent than
against a weaker opponent, iii) assign more value to a recent victory at a high score than
to a close victory a while ago; iv) decrease the value of a team following a defeat, v)
decrease more value following a defeat against a weak opponent than against a stronger
opponent, and finally vi) decrease more value for a recent defeat at a high score than for a
close defeat a while ago. Also intuitively, the initial value assigned to each team should
not influence the final rankings. Thus, in order to avoid any bias resulting from the initial
value assigned to each team, I assign all teams the same initial value and let the
connection weights be the only factors determining the relative ranking of teams. With
Chapter 2: Ranking Algorithms Andrei C. Grecu
35
these considerations in mind, I implement the following mathematical model for a neural
network that ranks the teams qualified for the World Cup.
The Mathematical Model
Consider N teams with a history of games among themselves, such that every
team is connected to all other teams either through direct games or through a succession
of games involving its direct opponents. We consider a corresponding artificial neural
network with N neurons, such that each team is assigned a neuron in the network. Using
the results of previous encounters among the N teams over the last 12 years, we compute
the weights of all connections between team i and team j, such that clear, recent results
are weighted more heavily than tight games, which took place longer ago:
ij ijW *Yijg
Where:
ij
ij
g is the difference between the number of goals scored by team i and team j
Y is a year coefficient equal to (12 - number of years since the game took place)
Given the artificial neural network and the weights described above, we need to
assign each team an initial value, before starting the evolution algorithm. As discussed in
the previous section, we want the relative values of the teams to be derived solely from
the connection weights, rather than being influenced by the initial values assigned to the
teams. Therefore, in order to reduce the bias resulting from arbitrary initial values, we
Chapter 2: Ranking Algorithms Andrei C. Grecu
36
assign all teams an initial value of 50, and we implement an evolution algorithm that uses
the connection weights as inputs to rank the teams on a 0 to 100 scale.
At the heart of the evolution algorithm is the transfer function, which updates the
value of each team based on the value of the opponent and the weight of the connection
between the two teams. Intuitively, we want the transfer function to always increase the
value of a team following a victory and decrease its value following a defeat. However,
we want these changes to vary according to the strength of the opponent, the magnitude
of the victory, and the number of years since the game took place. An intuitive transfer
function that accomplishes the objectives discussed above is presented below:
0 Vi,t maxVi,t+1’ maxVi,t+1 100
Figure 4: The value of team i can increase more following a victory against a strong
opponent than a victory against a weaker opponent, maxVi,t+1 > maxVi,t+1’
Consider the case in which team i beat team j, so that the value of team i rises
from Vi,t, at time t, to Vi,t+1, at time t+1. At this point we model a transfer function that
performs two steps in updating the value of team i: i) first, it computes the range of
possible updated values of team i, (minVi,t+1, maxVi,t+1), as a function of the opponent’s
value Vj,t, and then ii) it determines the exact updated value Vi,t+1 (minVi,t+1, maxVi,t+1),
by looking at the connection weight Wij. Such a transfer function generates the greatest
increase in a team’s value following a recent, clear victory against a strong opponent, and
Chapter 2: Ranking Algorithms Andrei C. Grecu
37
causes the smallest increase in value following a tight victory against a weak opponent,
twelve years ago.
First, in determining (minVi, t+1, maxVi, t+1), assume that minVi, t+1 = Vi, t, or the
“worst” a team can do in case of a victory is keep its previous value. Meanwhile, assume
that maxVi,t+1, or the maximum possible increase in the value of team i, is linearly
dependent on the value of the opponent team, Vj,t. Since the team values are bound to the
interval [0,100], consider the two limit cases. On one hand, if team i wins against a 100-
value team, its updated value Vi, t+1 should be allowed to potentially increase all the way
to 3
4of the distance between Vi, t and 100, namely to the point Vi +
3
4* (100 – Vi). On
the other hand, if team i wins against a 0-value team, regardless of the score and date, its
update value Vi, t+1 should not be allowed to increase by more than only 1
4of the distance
between Vi, t and 100, or the point Vi + 1
4* (100 – Vi). Using these two values as
reference, and assuming a linear relationship between the maximum possible increase in
the value of team i, maxVi,t+1, and the value of team j, Vj,t, we derive the formula for the
maximum possible updated value of team i, for a given Vj,t:
, ,, 1 ,
100 V 100 3* VV * V
200 4i t i tvictory
i t j tmax
Second, once we compute (minVi,t+1, maxVi,t+1), or the interval of potential
updated values for team i, we look at the connection weight Wij to determine the exact
updated value for team i within the interval. For large values of Wij, corresponding to
recent, categorical victories, we want the transfer function to assign a big increase in the
Chapter 2: Ranking Algorithms Andrei C. Grecu
38
value of team i. Conversely, for small values of Wij, corresponding to close victories that
took place a while ago, we want a smaller increase in the value of team i within the
interval (minVi,t+1, maxVi,t+1). Therefore, assume that the transfer function returns the
maximum updated value for team i, maxVi,t+1, following a game with weight Wmax, the
highest weight in the entire neural network. For all other connection weights smaller than
Wmax, the transfer function returns an update value for team i in the interval (minVi,t+1,
maxVi,t+1), according to the following formula:
, ,, 1 , 1V V *( V V )ijvictory victory
i t i ti t i tmax
Wmax
W
Similarly, in a game in which team i lost to team j we want the value of team i to
decrease as a function of both the value of the opponent team Vj,t and the connection
weight Wij. Now, the “best” a loosing team can do is keep its current value, maxVi, t+1 =
Vi,t, in case it lost in a tight game, against a very strong team, and a long time ago. In the
general case, following a defeat, the updated value of team i will lie in the interval whose
upper limit is the previous value of the team, Vi,i, and whose lower limit is a linear
function of the opponent’s value:
, ,, 1 ,
V VV * V
200 4i t i tdefeat
i t j tmin
Having computed the interval of possible updated values for team i, (minVi,t+1,
maxVi,t+1), we look at the connection weight Wij to determine the exact updated value for
team i within the interval. For large values of Wij, corresponding to recent, categorical
defeats, we want the transfer function to assign a big decrease in the value of team i.
Chapter 2: Ranking Algorithms Andrei C. Grecu
39
Conversely, for small values of Wij, corresponding to close defeats that took place a
while ago, we want a smaller decrease in the value of team i within the interval (minVi,t+1,
maxVi, t+1). Therefore, the transfer function, which returns the exact updated value of
team I following a defeat, is a linearly dependent on the connection weight Wij:
, ,, 1 , 1V V *( V V )ijdefeat defeat
i t i ti t i tmax
Wmin
W
Finally, in case of a tie, we want to penalize the team with the higher value and
reward the team with the lower value, since the former was expected to win, while the
latter produced the surprise. However, since ties are only half-upsets, we only award half
the increase computed in case of a victory, and subtract half the value computed in case
of a defeat. Also, in a tie team i and team j score the same number of goals, so the
connection weight degenerates to Wij = 0. Therefore, I choose a transfer function that
updates the team values as a function of the number or years since the game against team
j, Yij. Assuming that team i has a greater value than team j at time t, and supposing that
we are taking into account games at most 12 years ago, the transfer function increases the
value of team j and decreases the value of team i as follows:
victoryj,t+1 j,t
, 1 j,t ji
( V -2*V )V V *Y
24tiej t
max
defeati,t+1 i,t
, 1 i,t ij
(2* V -V )V V *Y
12tiei t
min
Using the transfer functions presented here, the evolution algorithm looks at all
the games played by team i, computes the updated value of team i corresponding to each
Chapter 2: Ranking Algorithms Andrei C. Grecu
40
game played, and then averages the separate values to return the overall update value of
team i. This process in repeated until the values of the teams stabilize between
incremental units of time. Finally, in order to avoid having very large or negative values
assigned to certain teams, we normalize the values assigned to each team after each
iteration, such that the highest ranked team has a value of 100 and all other teams have a
proportional value within the interval (0,100).
Application to the 2006 Soccer World Cup
In order to rank the teams that participate in the 2006 World Cup I formed a
neural network whose neurons correspond to the 55 soccer national teams that qualified
for at least one World Cup between 1994 and 2006. Next, I determined the weights of the
intra-neural connections by examining 477 previous games among the 55 teams, played
either in previous World Cups or in competitive regional tournaments that replicate the
World Cup environment- neutral field, strong motivation. Using the C++ program
included in Appendix A, I implemented the transfer functions explained in the previous
section to update the value of each team based on the value of the opponent and the
connection weight corresponding to each game, I obtained the convergent solution for the
value of each team after 178 iterations2:
2 Included in Appendix B is a graph that shows how the algorithm converges to stable values for each team
Chapter 2: Ranking Algorithms Andrei C. Grecu
41
WORLD CUP 2006 PARTICIPANTS
1 BRAZIL 100.002 ITALY 93.323 FRANCE 85.654 ARGENTINA 84.225 ENGLAND 82.096 GERMANY 81.557 PORTUGAL 80.248 NETHERLAND 79.889 SPAIN 79.4710 SWEDEN 77.8711 CZECH REPUBLIC 77.6612 MEXIC 76.2013 AUSTRALIA 69.2014 PARAGUAY 64.6915 JAPAN 64.2316 IRAN 63.4817 IVORY COAST 61.9818 YUGOSLAVIA 61.1919 POLAND 61.0820 TOGO 55.9221 CROATIA 53.6422 SOUTH KOREA 52.1723 COSTA RICA 51.4024 UKRAINE 50.1825 GHANA 46.8326 USA 45.2327 TUNISIA 44.9628 SAUDI ARABIA 43.9329 TRINIDAD AND TOBAGO 28.5830 SWITZERLAND 25.5131 ECUADOR 19.7232 ANGOLA 17.39
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
42
Chapter 3: A Poisson Model for World Cup Games
Chapter 2 presents three algorithms for ranking soccer national teams qualified
for the World Cup, based on historical games among the teams prior to the start of the
competition. Next, this chapter assesses the predictive power of the rankings developed in
the previous chapter by looking at the relationship between initial rankings and game
results in the case of the 2002 World Cup in South Korea and Japan. Thus, in order to
assess the predicting accuracy of the rankings, I will employ the ranking algorithms from
Chapter 2 using historical games available at the beginning of the 2002 World Cup.
Using the 2002 rankings, I will then look at the games from the 2002 World Cup and
examine how the value assigned to each team predicts the number of goals scored by that
team during the tournament. Implicitly, for every game I calculate the probability of
winning assigned to each team and I compare my predictions with the actual results from
South Korea and Japan. Finally, I explain how the structure of games from the World
Cup makes it difficult to compute conditional probabilities for each team to win entire
tournament, which is why I choose to run the simulations of the World Cup in Chapter 4.
Rankings at the start of the 2002 World Cup
Before looking for a probability distribution for the number the goals scored in
the 2002 World Cup games, we need to determine the relative rankings of the teams as of
June 2002, the start date for the tournament. In order to rank the teams at the start of the
World Cup, we apply the algorithms discussed in Chapter 2 to a history of games played
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
43
among soccer national teams between 1990 and 2002. Thus, i) we put decreasing
emphasis on games that took place longer time ago, ii) we only consider competitive
soccer national teams that qualified for at least one World Cup between 1990 and 2002,
and iii) we only look at games that were part of a competitive tournament, in which teams
play their best players at full potential. More precisely, the dataset consists of 473 games
played between 55 teams at the following tournaments:
1. World Cup: France 1998, USA 1994, Italy 1990
2. African Nations Cup: Mali 2002, Ghana 2000, Burkina Faso 1998, South
Africa 1996, Tunisia 1994, Senegal 1992, Algeria 1990
3. Asian Cup: Lebanon 2000, United Arab Emirates 1996, Japan 1992
4. CONCACAF Gold Cup: USA 2002, USA 2000, USA 1998, USA 1996,
6. European Championship: Belgium/Netherlands 2000, England 1996, Sweden
1992
By applying the three ranking algorithms to this set of games, with their
corresponding dates and scores, I obtained the following rankings of soccer national
teams at the beginning of the 2002 World Cup:
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
44
2002 WORLD CUP EIGENVECTOR RANKING
1 ITALY 100.002 ARGENTINA 95.663 GERMANY 92.364 BRAZIL 90.815 MEXICO 82.736 USA 76.027 ENGLAND 74.468 FRANCE 64.609 URUGUAY 62.4210 CAMEROON 61.6411 SPAIN 61.2712 SWEDEN 60.7913 PARAGUAY 54.6314 BELGIUM 49.5615 RUSSIA 47.9216 DENMARK 46.8117 COSTA RICA 45.9218 NIGERIA 44.9619 ECUADOR 44.4820 SOUTH KOREA 42.8121 CROATIA 39.8822 PORTUGAL 34.6223 IRELAND 31.8424 SAUDI ARABIA 31.0225 TUNISIA 28.6526 SOUTH AFRICA 25.7627 JAPAN 23.1728 TURKEY 21.7929 SENEGAL 12.7530 SLOVENIA 8.7831 CHINA 7.7832 POLAND 7.00
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
45
2002 RANDOM WALKERS RANKING
1 FRANCE 100.002 PORTUGAL 82.903 ITALY 75.274 CROATIA 63.805 BRAZIL 59.046 GERMANY 54.697 ENGLAND 51.228 ARGENTINA 48.089 SPAIN 46.9310 IRELAND 45.0611 MEXIC 42.3012 DENMARK 40.7713 NIGERIA 40.6314 CAMEROON 39.6715 SENEGAL 39.4216 USA 36.5817 BELGIUM 36.4418 SWEDEN 34.5819 PARAGUAY 33.3320 URUGUAY 32.8421 TURKEY 32.3722 RUSSIA 32.1923 SLOVENIA 31.1624 SOUTH AFRICA 30.8125 JAPAN 26.2026 ECUADOR 22.8427 COSTA RICA 22.6028 TUNISIA 21.4029 SAUDI ARABIA 20.8230 SOUTH KOREA 19.1331 CHINA 10.5332 POLAND 10.00
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
46
2002 NEURAL NETWORK RANKING
1 ITALY 100.002 PORTUGAL 96.203 FRANCE 94.564 BRAZIL 84.975 CROATIA 82.696 DENMARK 47.037 ENGLAND 46.118 NIGERIA 45.649 GERMANY 45.5610 SPAIN 44.9111 ARGENTINA 44.9112 SOUTH AFRICA 37.8813 CAMEROON 33.9214 MEXIC 31.4415 PARAGUAY 30.8216 SLOVENIA 29.6017 SWEDEN 28.8718 TURKEY 26.8119 URUGUAY 26.3720 TUNISIA 25.2621 SENEGAL 24.9722 BELGIUM 23.8723 JAPAN 23.4124 RUSSIA 19.6025 USA 19.5626 IRELAND 19.1627 ECUADOR 19.0528 COSTA RICA 18.7429 SOUTH KOREA 18.3330 SAUDI ARABIA 18.2231 CHINA 2.5732 POLAND 2.00
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
47
A Poisson Distribution of Goals
In a typical soccer game two teams play in continuous time for 90 minutes3, with
the team that scores more goals winning the game. In order to score a goal, the two teams
alternate possession of the ball, which allows them to attack the opponent team’s goal
and perhaps score. If attacks are assumed to be independent, then the distribution of goals
scored is negative binomial, as claimed in Pollard (1977), Moroney (1951), and Reed,
Pollard, and Benjamin (1971). However, the probability p that any attack will result in a
goal is relatively small. For example, a total of 161 goals were scored in the 64 games
from the 2002 World Cup, for an average of approximately 2.5 goals per game or one
goal every 40 minutes. Consequently, even thought there are a lot of attacks in a game,
there is a small probability p of scoring in any given attack. Therefore, given the small
probabilities of success p, the Poisson approximation is a good fit for the number of goals
scored in a soccer game, as showed in Lee (1997), Maher (1982), and Dyte and Clarke
(2000).
Using an approach similar to Dyte and Clarke (2000), my model for the number
of goals scored by each team in a given game relies on two assumptions. First, it assumes
that the number of goals scored by each team in a game is Poisson distributed. Second, it
assumes that the number of goals scored by a team is independent of the number of goals
scored by the opposing team. Given these two assumptions, I am interested in measuring
the rankings’ predictive power with respect to the number of goals scored by team i in a
game against team j. In particular, I am looking for the following relationship:
3 59 out of the 64 games played in the 2002 World Cup ended after 90 minutes. Thus, even though some games from the knockout stage of the World Cup go into extra time to allow teams to score the winning goal, I will focus my analysis on results after 90 minutes of play.
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
48
0 1 2ln( ) * *ij i jg x x R x R
Where:
is the number of goals scored by team i in a game against team j
is the rating of team i at the time of the game
ij
i
g
R
Having agreed on the model, I looked at the results from the games played in the
2002 World Cup. Even though only 64 games were played in the tournament, they
correspond to 128 observations, since for every game we are interested in predicting the
number of goals scored by each team. Using MATLAB to fit a Poisson regression to the
data, I obtained the following sets of coefficients, corresponding to each of the three
rankings developed:
1. Eigenvector Ranking:
Value t value p value X0 0.3532 1.5902 0.1118X1 0.0071 2.4309 0.0151X2 -0.0106 -3.4533 0.0006Deviance 140.9387Dispersion 1.0134
2. Random Walkers Ranking:
Value t value p value
X0 0.6224 2.279 0.0227
X1 0.0046 1.1241 0.261
X2 -0.0153 -3.0812 0.0021
Deviance 145.7578Dispersion 1.0237
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
49
3. Neural Network Ranking:
Value t value p value
X0 0.3976 1.9985 0.0457
X1 0.0039 1.3371 0.1812
X2 -0.0091 -2.4773 0.0132
Deviance 148.7348
Dispersion 1.0429
All three regressions fit the data well, and give a positive coefficient in front of Ri,
the rating of team i, and negative coefficient in front of Rj, the rating of the opponent
team j. These results confirm the basic intuition, which says that the higher the rating of
team i, and the lower the ranking of team j, the higher the expected number of goals
scored by team i. Also, the negative coefficients in front of Rj are significantly larger in
absolute terms than the positive coefficients in front of Ri for all three regressions,
suggesting that in determining the number of goals scored by a team, the rating of the
opponent is more important than the team’s own ranking, at least in the 2002 World Cup.
Using the regression coefficients to compute the expected number of goals scored
by a team in a certain game and then using that expectation as a mean, we can compute
marginal probabilities for each team’s Poisson distribution of goals scored in a certain
game. If we further assume that the number of goals scored by team i is independent of
the number of goals scored by team j, we can compute the probability of any specific
result for a given game:
0 1 2exp( * * )i i jx x R x R
0 1 2exp( * * )j j ix x R x R
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
50
**( & ) *
! !
ji jij i
ji
gg
ij jiij ji
eeP g g
g g
As an example, consider the game between Argentina and Nigeria from the 2002
World Cup. The Eigenvector ratings computed at the beginning of the tournament for the
two teams are RARG = 95.66 and RNIG = 61.64. Using these ratings, we compute the
expected number of goals scored by each team in their encounter:
0 1 2exp( * * )
exp(0.3532 0.0071*95.66 0.0106*61.64)
1.46
GER ARG NIGx x R x R
0 1 2exp( * * )
exp(0.3532 0.0071*61.64 0.0106*95.66)
0.79
NIG NIG ARGx x R x R
Thus, before the game we expected Argentina to score 1.46 goals and Nigeria
only 0.79 goals in their direct game. Using these expectations as means, we can compute
the probability assigned to each score in the game between Argentina and Nigeria, as
long as we assume that the number of goals scored by each team is Poisson distributed
and the number of goals scored by Argentina is independent of the number of goals
scored by Nigeria:
1.46 0.79
* *(1-0 Argentina win) *
! !
1.46* *
0.149
ARG ARG NIG NIGg gARG NIG
ARG NIG
e eP
g g
e e
This is the probability of a 1 - 0 Argentina victory over Nigeria. Performing
similar computations, we can compute the probability assigned to any score in the game
Chapter 3: A Poisson Model for World Cup Games Andrei C. Grecu
51
between Argentina and Nigeria. The table below contains the probabilities assigned to
any result in which both teams score between 0 and 9 goals:
Chapter 4: Simulating the Soccer World Cup Andrei C. Grecu
58
Chapter 4: Simulating the Soccer World Cup
Chapter 3 showed how the results of the ranking algorithms from Chapter 2 could
be used to make predictions regarding the outcome of separate games from the World
Cup. Moreover, we have seen that for the 2002 World Cup games, picking winners using
the three ranking methods outperformed the strategy of always going with the
bookmakers’ favorite in each separate game.
In this chapter we are going to shift our focus from separate World Cup games to
the overall picture and determine the probability of winning the Cup assigned to each
participating team. In particular, how is the probability of winning assigned to each team
influenced by the particular schedule of games from the World Cup tournament? How
does the initial draw advantage some teams, while disadvantaging other participants?
Finally, which teams had a lucky draw for the World Cup final tournament and which
teams were assigned the most difficult schedule? Given the structure of games in the
World Cup, it turns out to be easier to answer these questions by performing a simulation
of the games from the tournament than by explicitly calculating conditional probabilities
of certain events happening.
The Structure of the World Cup Tournament
The soccer World Cup has a complex, two-phase structure. Initially, the 32
qualified teams are divided into eight groups of four. Even though this allocation is based
upon a draw, teams are also divided into four value-pools according to their previous
Chapter 4: Simulating the Soccer World Cup Andrei C. Grecu
59
international results, and each group is restricted to exactly one team from each value-
pool. Theoretically, this structure advantages the highest ranked teams, which are seeded
such that they play lower ranked teams in the group stage. However, teams that
participate in the World Cup are of comparable value and during the six round robin
games played in each group, teams have three games to demonstrate their superiority
over the other teams from the group. At the end of the group games, the first criterion for
ranking the teams is the number of points achieved by each team in the three group
games; in case of a tie, the next criterion used to differentiate between teams is the goal
difference record of each team.4Given the final ranking, the top two teams from each
group advance to the second round of the competition, which consists of a simple 16-
team knockout arrangement. Moreover, the entire structure of games of the knockout
stage is predetermined, such that the winner of group A plays the runner up of group B,
the runner up of group C plays the winner of group D, and so on all the way to the final.
This particular structure essentially splits the teams in two different halves, such that
teams from one half will not play teams from the other half until the final of the World
Cup, assuming that both teams reach that phase.
The tree structure that describes the schedule of games from the knockout stage of
the World Cup tournament is depicted below. Since 48 games are played in the group
stage, the figure labels games G49 to G62, leading all the way to the final:
4 It very rarely happens that these two criteria are not sufficient for ranking the teams, but other criteria for differentiating exist, such as the number of red/yellow cards received by each team, or the official international ranking of the teams at the time of the play.
Chapter 4: Simulating the Soccer World Cup Andrei C. Grecu
60
WORLD CUP GAME SCHEDULE
Last 16 Quarter-Finals Semi-finals FINAL Semi-finals Quarter-Finals Last 16
G49 G51
G57 G59
G50 G52 G62
G53 G61 G55
G58 G60
G54 G56
Figure 5: The tree structure describing the games from the World Cup tournament. E.g.:
The winner of group A (WA) plays the runner-up of group B (RB) in game G49
In theory, we could explicitly calculate conditional probabilities of winning the
Cup for each participating team. However, even if we calculated conditional probabilities
involving winning probabilities in games against all other 31 teams from the World Cup,
we would still run into difficulties when ranking teams after the group stage games, since
goal difference required for tie-breaking make the exact score a requirement. Therefore, I
choose to simulate the games from the World Cup using a method inspired from
Winston, and Albright (2001).
WA
RB
WC
RD
WE
RF
WG
RH
W49
W50
W53
W54
W57
W58
W59
W60
W51
W52
W55
W56
WB
RA
WD
RC
WF
RE
WH
RG
W61
W62
FINAL
Chapter 4: Simulating the Soccer World Cup Andrei C. Grecu
61
The Simulation Model
Assume that at the beginning of the World Cup the value of team i is Vi, the
corresponding value from the Eigenvector rankings. This simulation models the outcome
of a game between team i and team j by generating two numbers from two normal
distributions with equal variance σ2: the first number Pi is drawn from the distribution
N(Vi, σ2) and characterizes team i’s performance in the game; the second number Pj is
drawn from the distribution N(Vj, σ2) and characterize team j’s performance in the game.
Given these two numbers generated from N(Vi, σ2) and N(Vj, σ
2), the score Sij of the
game between team i and team j is defined as:
ij i j i jS P P = N(V , ) N(V , )
The equal variance σ of the two distributions determines how often will the
sample from the population with the larger mean be lower than the sample from the
population with the smaller mean. This probability is particularly important for our
interpretation of the model, since a negative score Sij = Pi – Pj < 0 for Vi > Vj translates
into a “surprise”, or a game in which the team with lower value Vj defeated the team with
higher value Vi. Therefore, for all the 48 games from the group stage, I look at the 48
values of the “favorite” team in each game, Vf, and I look at the 48 values of the
“underdog” team in each game, Vu. The Central Limit Theorem tells us that f uV V has
approximately a normal distribution regardless of the underlying population distributions.
Therefore, I compute the mean and variance of the two sample sizes, the “favorites” and
the “underdogs”, and I determine the variance σ2 required to make P (Vf – Vu > 0) = 0.75,
assuming that 25% of the games in the World Cup are upsets.
Chapter 4: Simulating the Soccer World Cup Andrei C. Grecu
/* update the team value at time t */void team_value(){ for (int i = 0; i < N; ++i) { double val = 0.0; int cnt = 0;
for (int j = 0; j < N; ++j) for (int k = 1; k <= 13; ++k) { double tmp = update(i, j, k); if (tmp != INFI) { val += tmp; ++cnt; } } if (cnt != 0) curr[i] = (double) val/cnt; else curr[i] = prev[i]; } /* scaling */
double oldmax = -INFI; double oldmin = INFI;
for (int i = 0; i < N; ++i) { oldmax = max(oldmax, curr[i]); oldmin = min(oldmin, curr[i]); } double a = 100.0/(oldmax-oldmin); double b = - 100.0*oldmin/(oldmax-oldmin); for (int i = 0; i < N; ++i) curr[i] = a*curr[i] + b;
}
Appendix A: Neural Network C++ Code Andrei C. Grecu
73
bool finish(){ for (int i = 0; i < N; ++i) if (abs(prev[i] - curr[i]) >= epsilon) return false; return true;}
void stable(){ int iter = 0; while (true) { if (iter == 1000) break;
++ iter;
//cerr << ",,,,,,," << endl;
team_value(); if (finish()) break;
/* backup computed values */ for (int i = 0; i < N; ++i) prev[i] = curr[i]; /* print current iteration */ if(iter<=1){ cout << "Begin Iteration # = " << iter << endl; for (int i = 0; i < N; ++i) cout << teams[i] << " " << curr[i] << endl; cout << "End Iteration" << endl; }
}
cout << "# of iterations: = " << iter << endl;}
int team_to_int(string s){ for (int i = 0; i < N; ++i) if (teams[i].compare(s) == 0) return i;
Appendix A: Neural Network C++ Code Andrei C. Grecu
74
return -1;}
void read_data(){ /* read the # of teams */ cin >> N; /* read all the teams */ for (int i = 0; i < N; ++i) { string s; cin >> s;
teams.push_back(s); } /* read the games */ while (true) { string a, b; int score; int year; year = -1; cin >> a >> b >> score >> year; if (year == -1) break; // cerr << a << " " << b << " " << score << " " << year << endl; int na = team_to_int(a); int nb = team_to_int(b); assert(na != -1); assert(nb != -1); year -= 1993; adj[na][nb][year] = score; }}
int main(void){ for (int i = 0; i < 60; ++i) for (int j = 0; j < 60; ++j) for (int k = 0; k < 15; ++k) adj[i][j][k] = 100;
Appendix A: Neural Network C++ Code Andrei C. Grecu
75
read_data(); for (int i = 0; i < N; ++i) prev[i] = S; stable(); /* print final results */ cout << "FINAL RESULTS" << endl;
for (int i = 0; i < N; ++i) cout << teams[i] << " " << curr[i] << endl; cout << "DONE!" << endl; return 0;
}
Appendix B: Neural Network Evolution Andrei C. Grecu
76
APPENDIX B: NEURAL NETWORK EVOLUTION
After about 50 iterations, the neural network converges to constant values for
every team:
Neural Network Evolution
0
20
40
60
80
100
120
0 20 40 60 80 100
Iterations
Tea
m V
alu
e
BRA
ITA
FRA
ARG
ENG
GER
PTG
NET
SPA
SWE
CZE
MEX
PAR
JAP
IRA
IVO
YUG
POL
Bibliography Andrei C. Grecu
77
BIBLIOGRAPHY
Callaghan, Thomas; Muncha, Peter; and Porter Manson. “Random Walker Ranking for NCAA Division I-A Football”, Georgia Institute of Technology, June 15, 2005
Callaghan, Thomas; Muncha, Peter; and Porter Manson. “The Bowl Championship Series: A Mathematical Review”, Notices of the American Mathematical Society, September, 2004
Coleman, Jay. “Minimizing Game Score Violations in College Football Rankings”, Interfaces, Vol. 35, No. 6, November- December 2005
Colley, Wesley; Colley’s Bias Free College Football Ranking Method, Ph.D. dissertation, Princeton University
Devore, Jay. Probability and Statistics for Engineering and Statistics, 6th Edition.Belmont: Brooks/Cole- Thomson learning, 2004.
Dixon, Mark and Coles, Stuart. “Modeling Association Football Scores and Inefficiencies in the Football Betting Market”, Applied Statistics (1997), 46, No. 2
Dobson, A.J. An Introduction to Generalized Linear Models, Chapman and Hall, London 2001
Dyte D. and Clarke S.R. “A ratings based Poisson model for World Cup soccer simulation”, Journal of the Operational Research Society (2000) 51, 993-998
Fleiss, Joseph L. Statistical Methods for Rates and Proportions. 2nd Edition, New York: John Wiley & Sons, 1981.
Goddard, Stephen. “Ranking in Tournaments and Group Decision Making”, ManagementScience, Vol. 29, No.12, Dec. 1983
Sharpe, Graham. Gambling on Goals: A Century of Football Betting, Mainstream Publishing, Edinburgh and London 1997
Jech, Thomas. “The Ranking of Incomplete Tournaments: A Mathematician’s Guide to Popular Sports”, Department of Mathematics, Pennsylvania State University
Karlis, Dimitris and Ntzoufras, Ioannis. “Statistical Modelling for Soccer Games: The Greek League”, Department of Statistics, Athens University of Economics and Business
Bibliography Andrei C. Grecu
78
Keener, James. “The Perron-Frobenius Theorem and the Ranking of Football Teams”, Society for Industrial and Applied Mathematics Review, Vol.35, No.1, pp. 80-93, March 1993
Koning, Ruud. “Balance in Competition in Dutch Soccer”, The Statistician, 49, Part 3, pp 419-431
Martinich, Joseph. “College Football Rankings: Do Computers Know Best?”, College of Business Administration, University of Missouri- St. Louis, May 2002
McCullagh, Peter and Nelder, J.A. Generalized Linear Models, Chapman and Hall, London 1989
McGarry T. and Schutz RW. “Efficacy of Traditional Sport Tournament Structures”, Journal of the Operational Research Society (1997), 48, 65-74
Palomino, Frederic; Rigotti, Luca; Rustichini, Also. “Skill, Strategy, and Passion: an Empirical Analysis of Soccer”, in progress, Department of Econometrics, Tilburg University
Pollard R, Benjamin B, and Reep C. “Sports and the Negative Binomial Distribution”, Optimal Strategies in Sports, 1977
Wilson, Rick. “Ranking College Football Teams: A Neural Network Approach”, Interfaces 25, July-August 1995 (pp. 44-59)