Beta

X∼Beta⁡(α,β)X \sim \operatorname{Beta}(\alpha, \beta)

A distribution over values between 0 and 1, which makes it the natural way to describe uncertainty about a probability or a proportion.

The story

Suppose you want to express what you believe about a coin's bias, a click-through rate or a conversion rate: some number between 0 and 1 that you do not know exactly. The Beta(α,β)\text{Beta}(\alpha, \beta) family can be flat, U-shaped, humped in the middle or piled up against either end, all controlled by two parameters. Its mean is α/(α+β)\alpha/(\alpha + \beta).

A useful way to read the parameters is as pseudo-counts: α\alpha behaves like a number of successes and β\beta like a number of failures. Start with a Beta(α,β)\text{Beta}(\alpha, \beta) belief about pp, observe ss successes and ff failures, and your updated belief is exactly Beta(α+s,β+f)\text{Beta}(\alpha + s, \beta + f). The larger α+β\alpha + \beta, the more concentrated the curve, just as more data makes you more certain.

Formulas

Support

x∈(0,1)x \in (0, 1)

PDF

f(x)=xα−1(1−x)β−1B(α,β)f(x) = \frac{x^{\alpha-1} (1 - x)^{\beta-1}}{\mathrm{B}(\alpha, \beta)}

CDF

F(x)=Ix(α,β)F(x) = I_x(\alpha, \beta)

Expectation

E[X]=αα+β\mathbb{E}[X] = \frac{\alpha}{\alpha + \beta}

Variance

Var⁡(X)=αβ(α+β)2(α+β+1)\operatorname{Var}(X) = \frac{\alpha\beta}{(\alpha + \beta)^2 (\alpha + \beta + 1)}

Mode

α−1α+β−2for α,β>1\frac{\alpha - 1}{\alpha + \beta - 2} \quad \text{for } \alpha, \beta > 1

Parameters

ParameterWhat it controls
α\alphaPulls probability towards 1; think of it as prior successes. Raising α\alpha shifts the mean α/(α+β)\alpha/(\alpha + \beta) upwards.
β\betaPulls probability towards 0; think of it as prior failures. Raising both α\alpha and β\beta together narrows the curve without moving its centre much.

Where it shows up

  • Uncertainty about a website's conversion rate in Bayesian A/B testing.
  • The proportion of a day a machine spends idle.
  • A batter's underlying hit rate, estimated from a season of at-bats.
  • The fraction of a task completed by a deadline in project planning.

Try this

  1. Set α=β=1\alpha = \beta = 1 to see a flat line, then lower both to 0.5. The curve becomes U-shaped: values near 0 and 1 are now more likely than values in the middle.
  2. Play Bayesian updating: start at α=1\alpha = 1, β=1\beta = 1, then imagine 7 successes and 3 failures by setting α=8\alpha = 8, β=4\beta = 4. The mean moves to 8/12≈0.6678/12 \approx 0.667 and the curve narrows. Shade from 0.5 to 1 to see how confident you now are that pp exceeds a half.
  3. Compare α=β=2\alpha = \beta = 2 with α=β=10\alpha = \beta = 10. Both are centred on 0.5, but the standard deviation falls from about 0.224 to about 0.109. Press Draw 1000 on each to see the difference in the histogram.

Related distributions

  • Beta(1, 1) is the Uniform on [0,1][0, 1].
  • It is the conjugate prior for the pp of a Bernoulli or Binomial: a Beta prior plus Binomial data gives a Beta posterior.
  • The jj-th smallest of nn independent Uniform(0, 1) draws follows Beta(j,n−j+1)\text{Beta}(j, n - j + 1).
  • If XX is Gamma(α,θ)\text{Gamma}(\alpha, \theta) and YY is Gamma(β,θ)\text{Gamma}(\beta, \theta), independent, then X/(X+Y)X/(X + Y) is Beta(α,β)\text{Beta}(\alpha, \beta).