Apologies for the rather vague title, I'm missing some terminology here. Feel free to correct me.

I would like to sample random variables from two distributions, $Z$, a Beta distribution with shape parameters $\hat{a}$ and $\hat{b}$, and $XY$ a product distribution generated by multiplying random variables sampled from a (different) Beta distribution ($X$, shape parameters $a$ and $b$) with independently sampled discrete random variables $Y$ equal to 1 with a probability $c$ and zero otherwise. The tricky part is I need the mean and variance of $Z$ and $XY$ to be identical.

Formally then (I'm not a mathematician so expect notation errors),

$Z\sim B(\hat{a}, \hat{b})$

$X\sim B(a, b)$

$P(Y=1)=c,\ P(Y=0)=1-c$

The following are the analytic expectation and variance of $Z$ and $XY$, the latter I get to using the expressions for E/var of a production distribution here:




$Var(XY)=c\left(\frac{1}{4(2b+1)} + \frac{1-c}{(1+b/a)^2}\right)$

Then setting $E(Z)=E(XY)$ and $Var(Z)=Var(XY)$ I aim to get expressions for $a$ and $b$ for known $\hat{a}$ and $\hat{b}$ and $c$. I arrive at the following:

$a=\left(\frac{1}{4}\left(\frac{1}{4c(2\hat{b}+1)} - \frac{(1-c)}{(1-\hat{\beta})^2} \right)^{-1}-1\right)\frac{1}{2\hat{\beta}}$




Not super pretty in know.

The trouble is that when I compute $a$ and $b$ as above, the analytic expectation and variances of $Z$ and $XY$ don't match so clearly I have made a mistake somewhere in the analysis.

Can anyone suggest a correction or alternative approach to getting what I want?



1 Answer 1


By the light of day I think this is actually correct. The issue is that for beta distributions with strong skew, the sample variance can deviate fairly substantially from the analytic variance giving the impression that the result does not hold.


Your Answer

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

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