Assignment 5B

ELO Calculations

Approach

The idea is to reuse the parsing from Project 1 to extract a player’s pre-rating and the list of opponents and apply the ELO formula to find what the score of each player should be depending on the level of his/her opponents and to compare it with his/her actual score. Sorting the differences of the two scores gives the top five over- and under-performers.

Just a couple of things to note: I am calculating each player’s pre-tournament rating for every round rather than updating it after each round since this is all the information I have; so this is a simplification of how ELO system operates. Also, I should take out byes and unplayed rounds from the calculations, which is the same problem as in the previous project. Finally, since there are a number of variants of the Elo formula, I should cite the exact formula I am using.

Code Base

library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(stringr)
library(knitr)

players_df <- read.csv("https://raw.githubusercontent.com/daanishrasheed/DATA607/refs/heads/main/Assignment%205B/tournament_ratings.csv")

kable(head(players_df))
pair name state points pre_rating avg_opponent_pre_rating
1 GARY HUA ON 6.0 1794 1605
2 DAKSHESH DARURI MI 6.0 1553 1469
3 ADITYA BAJAJ MI 6.0 1384 1564
4 PATRICK H SCHILLING MI 5.5 1716 1574
5 HANSHI ZUO MI 5.5 1655 1501
6 HANSEN SONG OH 5.0 1686 1519

The Elo rating system calculates the probability of winning a match against a particular opponent solely using the ratings difference of the two players. Here the equation used is:

\[E_A = \frac{1}{1 + 10^{(R_B - R_A)/400}}\]

where \(R_A\) and \(R_B\) are the ratings of Players A and B respectively prior to the tournament. The sum total of \(E_A\) for each match played by a player will give their expected score throughout the entire tournament. The byes and forfeited rounds are not considered since there is no actual opponent rating that can be compared against.

players_df <- players_df |>
  mutate(
    expected_score = 7 * (1 / (1 + 10^((avg_opponent_pre_rating - pre_rating) / 400))),
    expected_score = round(expected_score, 2),
    score_diff = round(points - expected_score, 2)
  )

head(players_df)
  pair                name state points pre_rating avg_opponent_pre_rating
1    1            GARY HUA    ON    6.0       1794                    1605
2    2     DAKSHESH DARURI    MI    6.0       1553                    1469
3    3        ADITYA BAJAJ    MI    6.0       1384                    1564
4    4 PATRICK H SCHILLING    MI    5.5       1716                    1574
5    5          HANSHI ZUO    MI    5.5       1655                    1501
6    6         HANSEN SONG    OH    5.0       1686                    1519
  expected_score score_diff
1           5.24       0.76
2           4.33       1.67
3           1.83       4.17
4           4.86       0.64
5           4.96       0.54
6           5.06      -0.06
# Five biggest overperformers
players_df |>
  arrange(desc(score_diff)) |>
  select(name, points, expected_score, score_diff) |>
  head(5)
                      name points expected_score score_diff
1             ADITYA BAJAJ    6.0           1.83       4.17
2                ANVIT RAO    5.0           1.76       3.24
3   ZACHARY JAMES HOUGHTON    4.5           1.26       3.24
4 JACOB ALEXANDER LAVALLEY    3.0           0.02       2.98
5     AMIYATOSH PWNANANDAM    3.5           0.62       2.88
# Five biggest underperformers
players_df |>
  arrange(score_diff) |>
  select(name, points, expected_score, score_diff) |>
  head(5)
                name points expected_score score_diff
1      ASHWIN BALAJI    1.0           6.15      -5.15
2   LOREN SCHWIEBERT    3.5           6.30      -2.80
3 GEORGE AVERY JONES    3.5           6.29      -2.79
4     GAURAV GIDWANI    3.5           6.09      -2.59
5   CHIEDOZIE OKORIE    3.5           5.88      -2.38

Conclusion

The overachievers were typically less rated players with scores significantly higher than those expected due to their opponents’ rating, while the underachievers were more rated players, including the best rated player rated at 1745, with a score significantly lower than expected. This simply means that the expected score is just an estimation from pre-tournament ratings, hence a significant deviation implies poor performance with respect to their ratings.

In order to further analyze or validate this, one would run a similar comparison with the use of post-tournament ratings in order to determine whether the biggest over/underachievers had also the greatest rating changes, which would be an important internal consistency check. In addition, one would analyze how sensitive the over/underachievers ranking is to the specific ELO formula being used.