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

Is there a similar way to this for calculating the $$\alpha$$ and $$\beta$$ parameters for a Beta distribution if I know the harmonic mean and variance that I want the distribution to have ($$\alpha>1$$ and $$\beta>0$$)?

$$HM=\frac{\alpha-1}{\alpha+\beta-1}$$

Example: harmonic mean = 0.25 and variance = 0.04 should yield $$\alpha$$ = 2 and $$\beta$$ = 3

As per JimB’s comments below; is there a single solution if $$\alpha > 1$$ and $$\beta > 1$$?

• One way: write $\alpha = 1 + \beta(h/(1-h))$ where $h$ is the harmonic mean. Plug that into the equation for the variance and solve for $\beta.$
– whuber
Jul 14, 2023 at 23:47

You are not guaranteed a single solution.

If you do the substitutions as suggested by whuber, you will end up having to solve a cubic expression for $$\alpha$$ or $$\beta$$ which with minor difficulty will lead to three pairs of solutions.

In your example, you will get $$\alpha=1+\frac\beta 3$$ and something like $$64\beta^3-33\beta^2-495\beta+54 =0$$ and solutions $$(3,2) \text{ and }\\ \left(\frac{9 \sqrt{41}+75}{128},\frac{27 \sqrt{41}-159}{128}\right) \text{ and } \\\left(\frac{-9 \sqrt{41}+75}{128},\frac{-27 \sqrt{41}-159}{128}\right)$$ where you can reject the third pair as it has $$0< \alpha<1$$ and $$\beta<0$$.

The second pair with $$\alpha \approx 1.036157172944497$$ and $$\beta\approx 0.1084715188334915$$ appears to be a solution satisfying the conditions. It is a deeply strange solution as $$61\%$$ of the probability would be concentrated in the interval $$[0.99,1]$$ and less than $$3\%$$ below the harmonic mean, and this raises the question of whether the harmonic mean is an useful statistic for describing a Beta distributed sample.

This shows the probability densities of the two solutions - the first in blue and the second in red, with the harmonic mean as a vertical black line. It is the small but substantial probability of extremely small values using the second solution which brings its harmonic mean down, despite the vast bulk of the distribution being much higher (its pdf is unbounded near $$1$$).

• Just to play Devil's Advocate about the usefulness of the harmonic mean for describing a Beta distributed sample: isn't it the use of the variance that results in potentially multiple solutions? There is a unique solution when using the mean and the harmonic mean with the estimates of $\alpha$ and $\beta$ being $\frac{m(1-h)}{m-h}$ and $\frac{(1-h) (1-m)}{m-h}$, respectively.
– JimB
Jul 15, 2023 at 7:10
• Maybe a slight modification in my argument: it appears to be the combination of the harmonic mean and the variance that causes the multiple solutions. Using the combination of the variance and mean results in just a single solution.
– JimB
Jul 15, 2023 at 7:31
• @JimB The harmonic mean uses the reciprocal. The reciprocal of a Beta distributed random variable is a Beta-prime distributed random variable on $[1,\infty]$ with the parameters swapped. In this case, the corresponding Beta-prime random variable has a mean of $\frac1{0.25}=4$ but in the case of the second solution would have an infinite variance, causing issues for the speed of convergence for the sample harmonic mean of the original Beta random variable with the second solution as parameters. Jul 15, 2023 at 20:27
• @JimB I have added a chart for the densities of the two solutions which suggests to me that you can substantially manipulate the harmonic mean with small adjustments to the probability of extremely small values even if the bulk of the distribution is elsewhere. These adjustments would make minimal changes to the arithmetic mean and variance, so I would still say it is the nature of the harmonic mean which causes this. Jul 15, 2023 at 20:42
• I think I might not have been clear. As you've mentioned there is no guarantee of a unique solution (although I think using the harmonic mean and variance always results in two legitimate solutions). That should be enough to not use the harmonic mean and the variance as the moments in a method of moments estimator for $\alpha$ and $\beta$. That one of the two solutions has an infinite variance for the harmonic mean would seem to be irrelevant. Two solutions == bad. Again, it is the combination of using the sample harmonic mean and sample variance that should be avoided.
– JimB
Jul 15, 2023 at 22:51