Created
November 3, 2023 20:46
-
-
Save siman-man/eb4fb559a688563c5f013616b619d76c to your computer and use it in GitHub Desktop.
AHC rating calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S = 724.4744301 | |
R = 0.8271973364 | |
perfs = DATA.map(&:to_i) | |
Q = [] | |
perfs.each do |perf| | |
1.upto(100) do |j| | |
Q << perf - S * Math.log(j) | |
end | |
end | |
Q.sort_by! { |q| -q } | |
numerator = (1..100).map { |i| Q[i - 1] * R ** i }.sum | |
denominator = (1..100).map { |i| R ** i }.sum | |
r = Rational(numerator, denominator) | |
if r < 400 | |
r = Rational(400, Math.exp(Rational(400 - r, 400))) | |
end | |
pp perfs | |
puts r.to_f | |
__END__ | |
1861 | |
1193 | |
2464 | |
1745 | |
1889 | |
2760 | |
2699 | |
2034 | |
2978 | |
1791 | |
2199 | |
3101 | |
2287 | |
2428 | |
1605 | |
2543 | |
2102 | |
2314 | |
2485 | |
3019 | |
2701 | |
1243 | |
2355 | |
2803 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref. https://www.dropbox.com/s/ne358pdixfafppm/AHC_rating.pdf?dl=0