# Pareto distribution¶

## Error probability or chance to beat¶

Given two distributions $$X_A \sim \mathcal{PA}(\alpha_A, \beta_A)$$ and $$X_B \sim \mathcal{PA}(\alpha_B, \beta_B)$$ such that $$(\alpha_A, \beta_A, \alpha_B, \beta_B) \in \mathbb{R}_+^4$$, $$P[X_B > X_A]$$ is given by

$\begin{split}P[X_B > X_A] = \begin{cases} 1 - \frac{\alpha_B}{\alpha_A + \alpha_B}\left(\frac{\beta_A}{\beta_B}\right)^{\alpha_A}, & \beta_B > \beta_A,\\ \frac{\alpha_A}{\alpha_A + \alpha_B}\left(\frac{\beta_B}{\beta_A}\right)^{\alpha_B}, & \beta_B \le \beta_A \end{cases}\end{split}$

## Expected loss function¶

The expected loss function can easily be calculated from the definition yielding

$\begin{split}\mathrm{EL}(X_B) = \begin{cases} \frac{\alpha_A \beta_A}{\alpha_A - 1}\left(1- \left(\frac{\beta_B}{\beta_A}\right)^{\alpha_B}\right) - \frac{\alpha_B}{\alpha_B - 1}\left(\beta_B - \beta_A \left(\frac{\beta_B}{\beta_A}\right)^{\alpha_B}\right) + \frac{\alpha_B \beta_A \left(\frac{\beta_B}{\beta_A}\right)^{\alpha_B} }{(\alpha_B + \alpha_A - 1)(\alpha_A - 1)}, & \beta_A > \beta_B\\ \frac{\alpha_B \beta_B}{(\alpha_B + \alpha_A - 1)(\alpha_A - 1)}\left(\frac{\beta_A}{\beta_B}\right)^{\alpha_A}, & \beta_A \le \beta_B \end{cases}\end{split}$

and similarly for $$\mathrm{EL}(X_A)$$,

$\begin{split}\mathrm{EL}(X_A) = \begin{cases} \frac{\alpha_B \beta_B}{\alpha_B - 1}\left(1- \left(\frac{\beta_A}{\beta_B}\right)^{\alpha_A}\right) - \frac{\alpha_A}{\alpha_A - 1}\left(\beta_A - \beta_B \left(\frac{\beta_A}{\beta_B}\right)^{\alpha_A}\right) + \frac{\alpha_A \beta_B \left(\frac{\beta_A}{\beta_B}\right)^{\alpha_A} }{(\alpha_A + \alpha_B - 1)(\alpha_B - 1)}, & \beta_B > \beta_A\\ \frac{\alpha_A \beta_A}{(\alpha_A + \alpha_B - 1)(\alpha_B - 1)}\left(\frac{\beta_B}{\beta_A}\right)^{\alpha_B}, & \beta_B \le \beta_A \end{cases}\end{split}$

## Credible intervals¶

The expected value of the distribution $$Z = (X_A - X_B)/X_B = X_A / X_B - 1$$ can be computed using

$\mathrm{E}\left[\frac{X_A}{X_B}\right] = \frac{\alpha_A}{\alpha_A - 1} \frac{\alpha_B \beta_A}{(\beta_B (\alpha_B + 1))}.$

## Proofs¶

### Error probability¶

Integrating the joint distribution over all values of $$X_B > X_A$$ we obtain the integral

$\begin{split}P[X_B > X_A] &= \int_{\beta_A}^{\infty} \int_{\max(\beta_B, x_A)}^{\infty} \frac{\alpha_A \beta_A^{\alpha_A}}{x_A^{\alpha_A + 1}} \frac{\alpha_B \beta_B^{\alpha_B}}{x_B^{\alpha_B + 1}} \mathop{dx_B} \mathop{dx_A}\\ &= 1 - \int_{\beta_A}^{\infty} \frac{\alpha_A \beta_A^{\alpha_A}}{x_A^{\alpha_A + 1}} \left(1 - \left(\frac{\beta_B}{\max(\beta_B, x_A)}\right)^{\alpha_B}\right) \mathop{dx_A}\\ &= \alpha_A \beta_A^{\alpha_A} \beta_B^{\alpha_B} \int_{\beta_A}^{\infty} \frac{1}{x^{\alpha_A + 1} \max(\beta_B, x)^{\alpha_B}} \mathop{dx}.\end{split}$

Case $$\beta_B > \beta_A$$:

$\begin{split}\int_{\beta_A}^{\infty} \frac{1}{x^{\alpha_A + 1} \max(\beta_B, x)^{\alpha_B}} \mathop{dx} &= \int_{\beta_A}^{\beta_B} x^{-\alpha_A - 1} \beta_B^{-\alpha_B} \mathop{dx} + \int_{\beta_B}^{\infty} x^{-\alpha_A - 1} x^{-\alpha_B} \mathop{dx}\\ &= \beta_B^{-\alpha_B} \left(\frac{\beta_A^{-\alpha_A} - \beta_B^{-\alpha_A}}{\alpha_A}\right) + \frac{\beta_B^{-\alpha_A - \alpha_B}}{\alpha_A + \alpha_B}.\end{split}$
$\begin{split}P[X_B > X_A] &= \alpha_A \beta_A^{\alpha_A} \beta_B^{\alpha_B} \left[\beta_B^{-\alpha_B} \left(\frac{\beta_A^{-\alpha_A} - \beta_B^{-\alpha_A}}{\alpha_A}\right) + \frac{\beta_B^{-\alpha_A - \alpha_B}}{\alpha_A + \alpha_B}\right]\\ &= 1 - \frac{\alpha_B}{\alpha_A + \alpha_B}\left(\frac{\beta_A}{\beta_B}\right)^{\alpha_A}.\end{split}$

Case $$\beta_B \le \beta_A$$:

$\int_{\beta_A}^{\infty} \frac{1}{x^{\alpha_A + 1} \max(\beta_B, x)^{\alpha_B}} \mathop{dx} = \int_{\beta_A}^{\infty} x^{-\alpha_A - \alpha_B - 1} \mathop{dx} = \frac{\beta_A^{-\alpha_A - \alpha_B}}{\alpha_A + \alpha_B}$
$P[X_B > X_A] = \alpha_A \beta_A^{\alpha_A} \beta_B^{\alpha_B} \frac{\beta_A^{-\alpha_A - \alpha_B}}{\alpha_A + \alpha_B} = \frac{\alpha_A}{\alpha_A + \alpha_B}\left(\frac{\beta_B}{\beta_A}\right)^{\alpha_B}.$