2
$\begingroup$

I'm looking to track the rating of each player in a pickleball league using a spreadsheet. A concept like ELO seems like the right approach, but I'd like to track both a mean (rating) and sigma (confidence) for each player, and then updating that based on the result of each of the games. Since it's in a spreadsheet, I'd like this calculation to be direct, assume that each game is won/lost (no draws), and use the score of each team in the update.

I understand the concept of using Bayesian to accomplish this, but I'm not familiar enough with the details to lay out what the update given existing ratings and the score of the game to update the mean/sigma. What would this look like?

$\endgroup$
3
  • $\begingroup$ How married are you to using a spreadhseet? I've done something similar for soccer teams, but it can't be done easily (if at all) in a spreadsheet. $\endgroup$ Commented Sep 9 at 21:01
  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Commented Sep 9 at 21:01
  • $\begingroup$ For each of the games played, there's a rating for each of the 4 players (mean and sigma) and then the score of the game. The update should adjust the rating of each of the players so that the prediction of the actual outcome would be closer than it was before, so I'm looking for a direction calculation that I would apply to the rating of each of the players using the 4 ratings and the score of the game as the input. $\endgroup$ Commented Sep 9 at 22:55

2 Answers 2

4
$\begingroup$

A Bradley-Terry model is very similar to to an ELO based system, but it specifies a full probability model. This makes Bayesian inference quite simple. In Bradley-Terry, the probability that player $i$ beats player $j$ is given by $$P(\text{$i$ beats $j$}) = \frac{e^{\beta_i}}{e^{\beta_i} + e^{\beta_j}},$$ where $\beta_i$ is effectively the "rating" or "strength" of player $i$. In a Bayesian framework, we simply specify priors for the $\beta_i$ parameters and proceed via Markov chain Monte Carlo (MCMC).

There are many reasonable choices of prior distribution. One reasonable option is $$\begin{aligned} \beta_i | \mu_i, \sigma_i &\sim N(\mu_i, \sigma_i) \\ \mu_i &\sim N(0, \text{some big number}) \\ \sigma_i &\sim \text{Half-Cauchy}(\text{some number}) \end{aligned}$$


Extending Model for Doubles

In a doubles format, the probability can be expressed as $$P(\{i,j\} \text{ beats } \{k,\ell\}) = \frac{e^{\beta_i+\beta_j}}{e^{\beta_i+\beta_j} + e^{\beta_k+\beta_\ell}}.$$


In R

It seems like it would be very difficult to fit such a model using a spreadsheet. If you are willing to use R (with the help of chatGPT perhaps), then check out this demonstration which illustrates how to perform MCMC for a Bradley-Terry model in the context of Hockey.

$\endgroup$
2
  • $\begingroup$ What is it that makes it hard to do in a spreadsheet? Should there be a direct calculation for the rating of each of the 4 players and the score of the game to update the rating of each of them? $\endgroup$ Commented Sep 9 at 22:53
  • 1
    $\begingroup$ @DaveJohansen. Not quite. In Bayesian statistics, we specify a probability model and then we find the posterior distribution. The posterior can be difficult to find exactly, so we usually use approximation methods (like MCMC). $\endgroup$
    – knrumsey
    Commented Sep 9 at 22:58
0
$\begingroup$

Note: I have given some details on the Terry-Bradley model in another answer, which I think is a more effective approach. This is a more direct answer, which is slightly too long for a comment.

The problem with ELO is, even though it is easy to compute ELO scores for your problem, there is no easy way to get a "standard deviation" for each player, like you request. The rating system, however, could go something like this:


A win is worth a score of $1$ and a loss is worth $0$. Let $R_i$ be the current rating of player $i$ (suppose each player starts at $600$, or something). When team $(i,j)$ plays team $(k,\ell)$, we can compute the expected score for the first team as $$E_{i,j} = \frac{1}{1+10^{(R_k+R_\ell - R_i-R_j)/400}}$$ and for the second team as $E_{k,\ell} = 1 - E_{i,j}$.

Let's suppose that team $(i,j)$ beats $(k,\ell)$ so the observed scores are $S_{i,j} = 1$ and $S_{k,\ell}=0$. The difference between the observed and expected scores is given by $$D_{i,j} = 1 - E_{i,j}, \qquad D_{k,\ell} = - E_{k,\ell}.$$

Now we need to raise the rating of players $i$ and $j$ and decrease the rating of players $k$ and $\ell$. Let's use the formulas:

$$\begin{aligned} R^\text{new}_i &= R^\text{old}_i + K_i(1 - E_{i,j}) & \text{rating goes up} \\ R^\text{new}_j &= R^\text{old}_j + K_j(1 - E_{i,j}) & \text{rating goes up} \\ R^\text{new}_k &= R^\text{old}_k - K_k E_{k,\ell} & \text{rating goes down} \\ R^\text{new}_\ell &= R^\text{old}_\ell - K_\ell E_{k,\ell} & \text{rating goes down}. \\ \end{aligned}$$

The $K_i$ terms determine how much the rating changes and also how much "relative credit" player $i$ vs. player $j$ should get for the outcome. One option is to set $K_i$ to a constant, such as $16$ or $32$ as in chess. But another option is to say that the stronger player should get more credit for a win, but also take a larger penalty for a loss. In this scenario, we could set $$K_i = K_0\frac{R_i^\text{old}}{R_i^\text{old} + R_j^\text{old}},$$ where $K_0$ is a constant (like $16$ or $32$) that you will have to play around with. Larger values mean that ratings will change more quickly.


Update: Questions in Comment

Is there a way to include score so that big wins adjust more than close ones?

Yes. The observed scores $S_{ij}$ and $S_{k\ell}$ should be numbers between $0$ and $1$, but there is wiggle room with how you define them. For instance, you could set $$S_{ij} = \frac{\# \text{ of sets won by team $(i,j)$}}{\# \text{ of sets won by team $(i,j)$} + \# \text{ of sets won by team $(k,\ell)$}}.$$

So if team $i,j$ wins 2 out of 3 sets they get $S_{ij}=2/3$ and the losing team gets $S_{kj}=1/3$. This approach may need to be adjusted if you want to use points instead of sets, because the winning team score will be too close to $0.5$.

A word of caution: With this approach, it is possible that the winning team can actually lose rating points. This is like how a stronger player loses points for a draw in chess. If you want to avoid this, you could also incorporate this into the $K$ terms by using a larger value of $K$ for a blowout and a smaller value for a close game (e.g. $K = 16 + 2\times \text{|Point Differential|}$).

Is there a way to do an approximation or estimate for updating the sigma/confidence?

Not easily. The notion of confidence doesn't make a lot of sense in traditional ELO. For this, you need a probability model. See my other answer for details.

$\endgroup$
2
  • $\begingroup$ That makes sense and is very helpful! Is there a way to include score so that big wins adjust more than close ones? Is there a way to do an approximation or estimate for updating the sigma/confidence? $\endgroup$ Commented Sep 10 at 23:33
  • $\begingroup$ @Dave See update. $\endgroup$
    – knrumsey
    Commented Sep 11 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.