Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to ask a question inspired by an excellent answer to the query about the intuition for the beta distribution. I wanted to get a better understanding of the derivation for the prior distribution for the batting average. It looks like David is backing out the parameters from the mean and the range.

Under the assumption that the mean is $0.27$ and the standard deviation is $0.18$, can you back out $\alpha$ and $\beta$ by solving these two equations: \begin{equation} \frac{\alpha}{\alpha+\beta}=0.27 \\ \frac{\alpha\cdot\beta}{(\alpha+\beta)^2\cdot(\alpha+\beta+1)}=0.18^2 \end{equation}

share|improve this question
Honestly, I just kept graphing values in R until it looked right. – David Robinson Jan 17 '13 at 3:09
Incidentally, that's the formula for the variance, not the standard deviation- which is .18? – David Robinson Jan 17 '13 at 3:18
I added the missing ^2 above. – Dimitriy V. Masterov Jan 17 '13 at 18:11
where do you get the standard deviation to be .18? – appleLover Jul 20 '13 at 19:20
up vote 6 down vote accepted

Notice that:

\begin{equation} \frac{\alpha\cdot\beta}{(\alpha+\beta)^2}=(\frac{\alpha}{\alpha+\beta})\cdot(1-\frac{\alpha}{\alpha+\beta}) \end{equation}

This means the variance can therefore be expressed in terms of the mean as

\begin{equation} \sigma^2=\frac{\mu*(1-\mu)}{\alpha+\beta+1} \\ \end{equation}

If you want a mean of $.27$ and a standard deviation of $.18$ (variance $.0324$), just calculate:

\begin{equation} \alpha+\beta=\frac{\mu(1-\mu)}{\sigma^2}-1=\frac{.27\cdot(1-.27)}{.0324}-1=5.083333 \\ \end{equation}

Now that you know the total, $\alpha$ and $\beta$ are easy:

\begin{equation} \alpha=\mu(\alpha+\beta)=.27 \cdot 5.083333=1.372499 \\ \beta=(1-\mu)(\alpha+\beta)=(1-.27) \cdot 5.083333=3.710831 \end{equation}

You can check this answer in R:

> mean(rbeta(10000000, 1.372499, 3.710831))
[1] 0.2700334
> var(rbeta(10000000, 1.372499, 3.710831))
[1] 0.03241907
share|improve this answer
David, do you happen to follow any baseball research? There are several competing techniques out there for finding the proper $\alpha$ and $\beta$, so I was wondering if you had any opinion on the matter if you were doing something besides just trying to find a graph that looked reasonable. – Michael McGowan Jan 17 '13 at 14:53
I don't particularly follow sabermetrics- in the other answer it just happened to provide a very convenient example of estimating p from a binomial with a prior. I don't even know if this is how it's done in sabermetrics, and if it is, I know there are many components I left out (players having different priors, stadium adjustments, weighting recent hits over old ones...) – David Robinson Jan 17 '13 at 15:02
I am impressed that your eyeballing was this accurate. – Dimitriy V. Masterov Jan 19 '13 at 1:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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