SamMorton123 / 26.2-app

Simple Streamlit app to showcase my track and field Elo ratings.
1 stars 0 forks source link

Elo ratings with larger fields. #5

Open jkraft87 opened 2 years ago

jkraft87 commented 2 years ago

Hey Sam, curious if you're willing to share your ELO algorithm for races? I've been wanting to create something similar but obviously ELO is designed for head to head competition. Looking for inspiration on an efficient way to do bigger fields of competition. TIA.

SamMorton123 commented 2 years ago

Hi! I'm not a mathematician, but I found the best way to proceed was to treat each race as a set of simultaneous head-to-heads, which could then be evaluated in traditional Elo fashion. However, this spawned some further considerations that had to be made. Specifically, (1) winners of races with larger fields would receive more points, even if the performance wasn't "better," just because they defeated more competitors and (2) due to the nature of professional racing, the "payoff" for fighting for a better position at the pointy end of a race is greater than the payoff for fighting for a 9th vs. 10th placing. For example, the motivation to win a big race over finishing second is naturally far higher than the motivation for a racer to fight for 9th place over 10th place. To address both of these concerns, I implemented a number of weight "decay" functions which made head-to-head wins less valuable within a given race as you progressed down the placings. For example, the head-to-head of the winner defeating the runner-up may have a weight of 10, whereas the head-to-head between the 9th and 10th place finishers might be only weighted at 2. This practice actually successfully minimized the impact of concern (1) from above, and satisfactorily captured what I describe in point (2). In practice, I had the weight decay as a function of the place of the winner of each head-to-head and also the difference in placings in the head to head (e.g. inputs for 5th v 7th finisher head-to-head would be 5 [top place] and 2[difference in places]). This helped address the two points I brought up above, and a third issue, which was that athletes were being penalized too heavily for doing poorly in a single race. With the weight decay method, an athlete loses fewer points for a bad race than they do for a victory in a big race. One last thing is to remember to have the ratings regress to a mean (often 1500) at the beginning of each season, which reflects uncertainty/change in ability/form year-to-year.

I'm a university student, so I wasn't able to dedicate a huge amount of time to making the math behind these methods perfect, but I hope this helps. I was able to apply this Elo rating system to both track results and pro cycling results (with some additional changes for cycling, such as incorporating margin of victory for GC results). Please let me know if you have any more questions!

jkraft87 commented 2 years ago

That's all very awesome. Definitely saved me some time when I would've inevitably ran into the same issue with field sizes. Appreciate the time you've taken. Thanks.