# Bradley-Terry Model The Bradley-Terry (BT) model is a probabilistic model for the outcome of pairwise comparisons between items. It can be used in the forward direction to predict outcomes if the "rating" or "skill" of items are known, but more commonly it is used to infer these ratings (such as Elo) given a dataset of pairwise outcomes. The original formulation is defined as follows: $ \operatorname{P}(i>j)=\frac{e^{\beta_i}}{e^{\beta_i}+e^{\beta_j}}=\frac{1}{1+e^{\beta_j-\beta_i}} = \sigma({\beta_j-\beta_i}). $ which essentially is the sigmoid of skill difference between the items being compared. ### Elo Rating The Elo rating system uses the BT model and divides the skill difference by 400 (called scale-factor), and so its also called "algorithm of 400". The update rule of player rating is given as `rating += k_factor * (actual_score - expected_score)` where k-factor of 32 is most widely used and actual score is win/draw/loss and expected score is probability computed using the BT model. ## Inference Given a dataset of pairwise comparisons $\mathcal{D} = {(i_k, j_k, y_k)}_{k=1}^N$, where $y_k = 1$ if item $i_k$ beat item $j_k$ and $y_k = 0$ otherwise, we want to infer the skill parameters $\boldsymbol{\beta} = (\beta_1, \ldots, \beta_M)$ for $M$ items. The likelihood of the observed data is: $ \mathcal{L}(\boldsymbol{\beta}) = \prod_{k=1}^{N} \sigma(\beta_{i_k} - \beta_{j_k})^{y_k} \cdot \sigma(\beta_{j_k} - \beta_{i_k})^{1-y_k} $ where $\sigma(x) = \frac{1}{1+e^{-x}}$ is the sigmoid function. The log-likelihood is: $ \ell(\boldsymbol{\beta}) = \sum_{k=1}^{N} \left[ y_k \log \sigma(\beta_{i_k} - \beta_{j_k}) + (1-y_k) \log \sigma(\beta_{j_k} - \beta_{i_k}) \right] $ which simplifies to the following which can be used with [[Maximum Likelihood Estimation]]: $ \ell(\boldsymbol{\beta}) = \sum_{k=1}^{N} \left[ y_k (\beta_{i_k} - \beta_{j_k}) - \log(1 + e^{\beta_{i_k} - \beta_{j_k}}) \right] $ **This is essentially [[Logistic Regression]] where each comparison creates a "data point" with the skill difference as the predictor.**