AdmiralGT / ttennis_ladder

0 stars 1 forks source link

Rounding errors cause mistakes #28

Open AdmiralGT opened 7 years ago

AdmiralGT commented 7 years ago

rounding

Due to the flooring of values we get rounding errors in this case.

andrew-nubbert commented 7 years ago

What's wrong with it? What numbers are being floored? Is the fix simply round to the nearest number instead of floor?

AdmiralGT commented 7 years ago

In the 3rd game in the list, it shows DC4 1606 (-1) where in fact he has dropped from 1608 to 1606 so it should display (-2). Similarly in the 4th game it shows -2 when it was in fact -1 (1609 to 1608).

andrew-nubbert commented 7 years ago

Hmm it's more complicated than that. From our discussion just now:

If you have a drop from e.g. 1306.6 to 1305.4, then that is a drop of 1.2 rounded to 1, and from 1307 to 1305 which appears to be a difference of 2. That seems strange because 1 is not 2. But each number is still rounded correctly, so it's debatable any of the figures should change.

However - it doesn't make sense that the points dropped can increase over time. DC4 has a -1 then a -2 in the next match. That's what you want to fix because the amount dropped over time should never increase like that.

I think what's happening is it works out the change in rounded ranking points for the winner, then just puts a minus on it for the loser.

As I see it the options are

  1. Work out the change in rounded ranking points for the loser separately. Then the change would always be the correct difference in rounded ranking points for each player, but it would mean a single match could show e.g. a +5 and a -4, and the numbers could also go up from one match to the next (e.g. -1 then -2)
  2. Always have the most accurate rounded number for the difference for the match. That would mean the changes would never go up from one match to the next, and the change would show as the same for each player, but the points difference shown would sometimes not match the rounded ranking points difference shown (for one or both players).

Both of these would require a fix to what we have now. I prefer option 2.

ghost commented 7 years ago

Why isn't this just: calculate the diff from the rounded ratings?

ghost commented 7 years ago

Oh never mind, I see the problem now.

ghost commented 7 years ago

For me, the diff has to show how the individual players rating has changed, whic is option 1 that @ybbun mentions above. Each player isn't going to care that their rating is actually a floating point, so it will just seem odd that the diff doesn't match the apparent rating change. I don't think it matters if one player's rating appears to go up a different amount to the other player's going down.

AdmiralGT commented 7 years ago

The change in Elo ranking for each player should match the difference displayed.

andrew-nubbert commented 7 years ago

Also the Elo changes shown are different between the recent results and biggest upsets lists, so that needs fixing as part of it.