# Uniform vs Beta(1,1) prior

Is there any difference in applying a uniform prior or a Beta(1,1) prior for your Bayesian analysis ?In which conditions is one preferred over the other ?

• No, there isn't, because the Beta(1,1) is the uniform distribution. – jbowman Dec 13 '17 at 2:00
• If your parameter is constrained to lie in the interval $[0,1]$ then these two are equivalent. If your parameter can take on other values, then the Beta(1,1) prior is not a reasonable prior in the first place. – Maurits M Dec 13 '17 at 12:16

## 2 Answers

They both are equivalent.

$$P(\theta) = { \Gamma(\alpha + \beta) \over \Gamma(\alpha)\Gamma(\beta)} \theta^{\alpha-1}(1-\theta)^{\beta-1}$$

if $$\alpha = \beta = 1$$

$$P(\theta) = { \Gamma(\alpha + \beta) \over \Gamma(\alpha)\Gamma(\beta)} \theta^{0}(1-\theta)^{0} = {\Gamma(2) \over \Gamma(1)\Gamma(1) } = {1 \over 1} = 1$$

As you can see $$\theta| \beta=1, \alpha = 1 \sim U(0,1)$$

Because a density function identifies uniquely a distribution, and the density of a uniform in the interval $$(c=0, \ d=1)$$ is:

$$f(x) = {1\over c -d} = {1 \over 1} = 1 \quad x \in (0,1)$$

• The proof is pretty brief. It is worth mentioning that $\Gamma(1) = 1$ and $\Gamma(z + 1) = z\Gamma(z)$ for completeness, since for those not familiar with gamma functions the ratio of gammas may not look like anything similar to uniform distribution... – Tim Dec 13 '17 at 7:26
• @Tim Knowledge of Gamma functions is unnecessary. It suffices to point out (1) the two distributions have the same support (a crucial point that is not in evidence in this answer) and (2) when $\alpha=\beta=1,$ the Beta density is proportional to a constant on its support. That makes the two distributions identical, because both must have the same normalization constant. – whuber Oct 23 '18 at 14:13
• @whuber I meant more details, rather then insisting on Gamma function. – Tim Oct 23 '18 at 14:20
• @Tim what does "cte" stand for here? – singularli Nov 4 '19 at 12:30
• @singularli shouldn't you rather ask someone who posted this answer? – Tim Nov 4 '19 at 14:12

There is a difference in that the Beta is the conjugate prior of the Bernoulli... So you have nice analytical formulas to help you update the Beta when new data comes is. In my limited experience, if you are modelling a probability, it's much better to use a Beta(1,1) prior rather than a Uniform(0,1), even for complicated models in pymc3 (where the update won't be analytical).

• Thanks, but as already mentioned, both priors are mathematically equivalent, so could you please somehow back up the statement that Beta(1, 1) is better? (It's not my -1.) – Tim Oct 23 '18 at 8:13
• In an A/B testing scenario, how would you easily update a uniform prior if not written as Beta(1,1)? I am answering the original question about "any difference" and "which conditions". – Piero Antonio Posocco Oct 24 '18 at 9:15
• This is useful advice despite the downvote – Learning stats by example Jun 17 '20 at 23:29