Skip to content

Instantly share code, notes, and snippets.

@lambda-fairy
Created November 10, 2015 03:19
Show Gist options
  • Save lambda-fairy/783616180dd2515e0e57 to your computer and use it in GitHub Desktop.
Save lambda-fairy/783616180dd2515e0e57 to your computer and use it in GitHub Desktop.
Elo rating code
module Elo where
updateRating :: Double -> Double -> Double -> Double -> Double
updateRating volatility me you result = me + change
where
change = volatility * (result - expected)
expected = 1 / (1 + (10 ** ((you - me) / 400)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment