Beta Distribution Calculator

Beta Distribution Calculator

Work with a beta distribution from its shape parameters, or straight from successes and failures, to get probabilities, the mean, mode and a 95% credible interval for an unknown rate.

f(x) = x^(α−1) (1 − x)^(β−1) ÷ B(α, β)

x can be a decimal or a percentage.

Enter α, β and a value between 0 and 1

What is the Beta Distribution?

The beta distribution describes an unknown proportion: a value somewhere between 0 and 1, such as a conversion rate, a batting average or a share of voters. Two shape numbers, α and β, set where it peaks and how tightly.

Its most practical use is Bayesian. Start with Beta(1, 1), which says every rate is equally plausible, then add each success to α and each failure to β. The result describes what the data say about the true rate, uncertainty included.

With little data the curve is wide; with lots it narrows around the observed rate. That makes it easy to ask direct questions such as "how likely is it that the true rate is below 10%?".

Beta Distribution Formula

As given in the NIST/SEMATECH e-Handbook, section 1.3.6.6.17. See Sources.

1. From counts to shape

α = successes + 1 · β = failures + 1 (from a flat prior)

2. Density and probabilities

f(x) = x^(α−1) (1 − x)^(β−1) ÷ B(α, β)
P(X < x) = I_x(α, β), the regularized incomplete beta function

3. Summaries

mean = α ÷ (α + β) · mode = (α − 1) ÷ (α + β − 2)
variance = αβ ÷ ((α + β)² (α + β + 1))

Worked Example: Is the Sign-Up Rate Below 10%?

Given:
A new landing page gets 12 sign-ups from 100 visitors. How likely is it that the true rate is below 10%?
Step 1:
Shape from the counts:
α = 12 + 1 = 13 · β = 88 + 1 = 89
Step 2:
Centre:
mean 13 ÷ 102 = 0.127 · mode 12 ÷ 100 = 0.12
Step 3:
Area below 0.10:
I₀.₁(13, 89) = 0.2081
Result:
P(true rate < 10%) ≈ 20.8%

The page probably beats 10%, but there's still about a one-in-five chance it doesn't. A hundred visitors isn't much: the middle 95% runs from about 7% to 20%.

Beta Shapes for Common Parameters

How α and β change the shape.

Shape, mean and SD of beta distributions
α, βShapeMeanSD
1, 1Flat: uniform on 0 to 10.50.289
0.5, 0.5U-shaped, piled at both ends0.50.354
2, 2Gentle hump in the middle0.50.224
2, 5Skewed towards low values0.2860.16
5, 2Skewed towards high values0.7140.16
50, 50Narrow peak at 0.50.50.05

Common Beta Distribution Mistakes

  • Using total trials as β. β counts failures, not attempts. 12 out of 100 is Beta(13, 89), not Beta(13, 101).
  • Forgetting the +1. Beta(12, 88) uses no prior at all; Beta(13, 89) is what a flat prior plus the data gives.
  • Entering x as a percentage number. x lives between 0 and 1. Type 0.1 or 10%, not 10.
  • Treating the mean as the observed rate. The mean 13/102 = 12.7% is pulled slightly towards 50% by the prior; the mode equals the observed 12%.

Beta Distribution FAQs

Why is the beta distribution used for rates?

It lives on 0 to 1, can take almost any hump-shaped or U-shaped form, and updates with new data simply by adding counts.

What is a conjugate prior?

A prior that stays in the same family after updating. Beta is conjugate to binomial data: Beta prior plus successes and failures gives another Beta.

What is a credible interval?

The range holding a stated share of the distribution, here the middle 95%. With a Bayesian model you can say the true rate lies in it with 95% probability.

Can I use a different prior?

Yes: switch to α and β and add your own. Beta(0.5, 0.5), Jeffreys’ prior, is another common neutral choice.

How do I compare two rates, such as in an A/B test?

Find each version’s beta distribution, then ask how often a draw from one beats the other. The A/B test calculator does this kind of comparison.

Why is the mode missing sometimes?

When α or β is 1 or less the density keeps rising towards an edge, so there’s no single interior peak.

How do I calculate it in Excel?

=BETA.DIST(x, α, β, TRUE) gives P(X < x), and =BETA.INV(p, α, β) gives percentiles.

What does α + β mean?

Roughly how much evidence the distribution represents. Beta(13, 89) is worth about 100 observations; Beta(130, 890) would be ten times as sure.

Sources

Related Tools