Answer

What is the beta distribution, and what is it used for?

Inspired by a question on Cross Validated ·

distributionsbayesian

The short answer

The beta distribution is a distribution over proportions: every value on its horizontal axis is a possible success rate between 0 and 1, and the curve shows how plausible each rate is. Its two parameters behave like counts of successes and failures, which is why it is the standard way to express uncertainty about a probability, a conversion rate, or any other share.

The horizontal axis is a probability

Most familiar distributions describe a measurement: a height, a waiting time, a number of heads. The beta distribution describes something one level up. Each point on its horizontal axis is a proportion, a number between 0 and 1 such as the true click-through rate of an ad, the share of voters who back a candidate, or a basketball player's real free-throw percentage.

The height of the curve over each proportion says how believable that value is, given what you know. A tall, narrow hump near 0.7 means you are fairly sure the rate is close to 70%. A wide, flat curve means you have little idea. So a beta curve is a picture of your uncertainty about a rate you cannot observe directly.

The two parameters act like counts

A beta distribution is written Beta(a, b), with both parameters positive. The easiest way to think about them: a is roughly the number of successes you have seen, and b the number of failures. The average of the distribution is a / (a + b), and the bigger a + b is, the narrower the curve, just as more data makes you more certain.

A useful rule for odd-looking shapes: when a is below 1, the density climbs without limit as you approach 0; when b is below 1, it does the same as you approach 1. That is why a curve with, say, a close to 1 and b = 0.5 is almost flat on the left and then shoots upward at the right edge. It says the underlying rate is most likely very close to 1.

Why it is so useful: updating with data

The beta distribution pairs naturally with yes/no data. Suppose your current belief about a rate is Beta(a, b) and you then watch some new trials. Your updated belief is simply Beta(a + successes, b + failures). Statisticians call this a conjugate prior for the binomial: the math stays inside the beta family, so updating is just addition.

This is the backbone of Bayesian A/B testing, of estimating batting or conversion rates from small samples, and of many rating systems that shrink items with few reviews toward a sensible average. It is also used on its own to model any quantity that naturally lives between 0 and 1, such as the fraction of a day spent on a task.

A second, purely frequentist fact is worth knowing: if you draw n values from a uniform distribution and sort them, the k-th smallest follows Beta(k, n - k + 1). So beta distributions also appear whenever you ask where a ranked value is likely to fall.

See it in R

Here we start with a flat Beta(1, 1) belief about a success rate, observe 27 successes in 40 attempts, and update. Base R has dbeta, pbeta, qbeta and rbeta built in.

set.seed(2026)

# Start with a flat prior, Beta(1, 1): every success rate from 0 to 1 equally plausible
a0 <- 1; b0 <- 1

# Observe 40 attempts with 27 successes
successes <- 27; failures <- 13

# Updating is just adding counts
a1 <- a0 + successes; b1 <- b0 + failures
cat("Posterior: Beta(", a1, ",", b1, ")\n")

# Mean of Beta(a, b) is a / (a + b)
cat("Posterior mean:", round(a1 / (a1 + b1), 3), "\n")

# 95% credible interval for the true success rate
print(round(qbeta(c(0.025, 0.975), a1, b1), 3))

# Probability the true rate is above 0.5
cat("P(rate > 0.5):", round(1 - pbeta(0.5, a1, b1), 3), "\n")

# Check by simulation: draw many plausible rates from the posterior
draws <- rbeta(100000, a1, b1)
cat("Simulated mean:", round(mean(draws), 3), "\n")

# Shapes for a few parameter choices
x <- seq(0.001, 0.999, length.out = 500)
plot(x, dbeta(x, a1, b1), type = "l", lwd = 2, ylim = c(0, 6),
     xlab = "success rate", ylab = "density")
lines(x, dbeta(x, 1, 1), lty = 2)        # flat
lines(x, dbeta(x, 2, 8), col = "blue")   # low rates likely
lines(x, dbeta(x, 0.5, 0.5), col = "red") # U-shape
Posterior: Beta( 28 , 14 )
Posterior mean: 0.667
[1] 0.519 0.799
P(rate > 0.5): 0.986
Simulated mean: 0.666

In this one seeded run, the updated belief is Beta(28, 14). Its mean is 0.667, there is a 95% probability the true rate lies between 0.519 and 0.799, and a 0.986 probability that it is above one half. The 100,000 simulated draws average 0.666, matching the formula. The plot shows how different parameter pairs produce flat, skewed, humped and U-shaped curves.

How to report it (APA 7th)

State the prior, the data and the resulting posterior, then give a point estimate with a credible interval. Because a proportion cannot exceed 1, APA style drops the leading zero. For example: With a uniform Beta(1, 1) prior and 27 successes in 40 trials, the posterior was Beta(28, 14), with a posterior mean success rate of .67, 95% CrI [.52, .80].

Call it a credible interval rather than a confidence interval: it is a direct probability statement about the rate, which a frequentist confidence interval is not.

Related tools and guides

More answered questions

Working with your own data?

General answers only go so far. Send us your situation and we'll reply by email within two business days.

Ask your question

Written by AskStats with AI assistance. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.