I start with two Beta distributions:

$$\mathrm{Beta_A}(p; \alpha_A, \beta_A) = \frac{p^{\alpha_A-1}\,(1-p)^{\beta_A-1}}{\mathrm{B}(\alpha_A, \beta_A)}$$

$$\mathrm{Beta_B}(p; \alpha_B, \beta_B) = \frac{p^{\alpha_B-1}\,(1-p)^{\beta_B-1}}{{\mathrm{B}(\alpha_B, \beta_B)}}$$

where in the context of Bernoulli trials, $\alpha$ can be interpreted as $1 + \mathrm{successes}$ and $\beta$ can be interpreted as $1 + \mathrm{fails}$. $\mathrm{B}$ is the Beta function.

I then define the 'difference' between $\mathrm{Beta_A}$ and $\mathrm{Beta_B}$ as:

$$F(x; \alpha_A, \beta_A, \alpha_B, \beta_B) = \mathrm{Beta_A}(p) - \mathrm{Beta_B}(p)$$


  • what is the PDF of $F(x)$?
  • what family of probability density distributions does $F(x)$ belong to?

Example and illustration

For example for $\alpha_A=3, \beta_A=9$ (2 successes from 8 Bernoulli trials) and $\alpha_A=1, \beta_A=5$ (0 successes from 4 Bernoulli trials) the distribution of values that $p$ can take is:

Beta_A and Beta_B

If I then take $n$ random values $X_A \sim \mathrm{Beta_A}$ and $X_B \sim \mathrm{Beta_B}$, and find the differences between each $i^\mathrm{th}$ element, $X_{A,i} - X_{B,i}$, and plot these $n$ differences in a histogram, I am essentially sampling $F(x)$ - the underlying distribution of $\mathrm{Beta_A} - \mathrm{Beta_B}$ which can only be defined for $x \in [-1,+1]$.

With $n = 5 \times 10^7$ random samples and bin widths of $\Delta x = 0.004$, $F(x)$ takes the following form:

Histogram of sampled differences

What is the PDF of $F(x)$?


  • 1
    $\begingroup$ Do you mean a convolution? math.la.asu.edu/~jtaylor/teaching/Fall2010/STP421/lectures/… $\endgroup$ – Dave Nov 14 '19 at 12:32
  • 1
    $\begingroup$ I guess I meant to follow the logic of the derivation but applied to subtraction instead of addition. I don’t think there would be that bound on $x$, though working through the calculus should reveal if there is. $\endgroup$ – Dave Nov 14 '19 at 13:15
  • 1
    $\begingroup$ The notations are awfully confusing, as they make $F(x)$ look like the difference of two Beta densities. Furthermore, $x$ and $p$ are not explicitly related. $\endgroup$ – Xi'an Nov 14 '19 at 13:19
  • 1
    $\begingroup$ There is an answer on maths.stackexchange. $\endgroup$ – Xi'an Nov 14 '19 at 13:20
  • 1
    $\begingroup$ Here are some papers also. $\endgroup$ – kjetil b halvorsen Nov 14 '19 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.