# Calculating the parameters of a Beta-Binomial distribution using the mean and variance

I'm trying to do the same thing that was done in this question:

Calculating the parameters of a Beta distribution using the mean and variance

for the Beta-Binomial distribution for which the mean is

$$\mu = n\frac{\alpha}{\alpha+\beta}$$

and the variance is

$$\sigma^2 = n\frac{\alpha\beta(\alpha+\beta+n)}{(\alpha+\beta)^2(\alpha+\beta+1)}$$

How can I calculate $$\alpha$$ and $$\beta$$ in terms of $$\mu$$ and $$\sigma^2$$ for a given $$n$$?

Also some information regarding the bound of the mean and variance similar to the answer above would be appreciated, e.g. I know that $$\mu \in (0,n)$$.

• $n$ is needed. Otherwise no solution. – user158565 Jul 27 at 22:58
• Assume that n is given. I adjusted my question accordingly. – ToniMa Jul 27 at 23:53

$$\alpha = (n\mu-\sigma^2 -\mu^2)/T$$ $$\beta = (n-\mu)\left(n-\frac {\sigma^2 +\mu^2}{\mu}\right)/T$$

where $$T=\frac {n\sigma^2}{\mu} - n +\mu$$

$$0 \lt \mu \lt n$$ $$0 \lt \sigma^2 \lt n^2/4$$

$$\sigma^2 = n\frac{\alpha\beta(\alpha+\beta+n)}{(\alpha+\beta)^2(\alpha+\beta+1)} = n\frac{\alpha}{\alpha+\beta}\frac{\beta}{\alpha+\beta}\left (1+\frac {(n-1)}{(\alpha+\beta+1)}\right)$$

$$max(\frac{\alpha}{\alpha+\beta}\frac{\beta}{\alpha+\beta}) = 1/4$$ when $$\alpha = \beta$$.

$$max\left (1+\frac {(n-1)}{(\alpha+\beta+1)}\right) = n$$ when $$\alpha+\beta$$ goes to zero.

$$\alpha = \beta$$ and $$\alpha+\beta$$ goes to zero can be true simultaneously, so got the results.

• Thank you for the quick reply. Out of curiosity, is this information available in literature or did you derive it yourself? If the latter, how did you get the upper variance bound? – ToniMa Jul 29 at 9:31
• When I re-derived upper bound, I found a mistake. I corrected it and wrote the steps in Answer. – user158565 Jul 29 at 16:21