# Is it possible to find out how unlikely a given $\mathrm{Beta}(\alpha,\beta) – \mathrm{Beta}(\alpha’,\beta’)$ is?

Let $X_i$ be the distance between two nodes in a graph.

$X_i \sim \mathrm{NB}(r,p)$ where $p \sim \mathrm{Beta}(\alpha, \beta)$.

After the posterior hyperparameters are obtained, $\mathrm{Beta}(\alpha,\beta) – \mathrm{Beta}(\alpha’,\beta’)$ could be found which would correspond to the change in expected distance.

Is it possible to find out how unlikely a given $\mathrm{Beta}(\alpha,\beta) – \mathrm{Beta}(\alpha’,\beta’)$ (change in expected distance) is?

• It's not really clear what your question is. Perhaps you could make some edits to improve it. Also, please enclose your math with dollar signs to render it properly. Feb 27 '13 at 23:05

There might be a closed-form way to solve this problem, but I think the simplest way is a Monte Carlo. Perform $k$ draws from each of the beta distributions, and perform the subtraction. Now you have $k$ samples from the distribution $Beta(\alpha, \beta)-Beta(\alpha^\prime, \beta^\prime)$. The probability of a value in some range is the number of draws in that range divided by $k$.