The Beta Distribution Explained Simply

Imagine we have 800 sessions on a landing page and 65 conversions. The raw rate is 65/800 ≈ 8.1%. It looks like a precise number, but is it really? Is it the true conversion probability of the page, or could it be different? And if someone claimed the page converts at least 10% — do the data confirm or contradict that?
Questions like this are everyday fare for anyone working with traffic and conversion data. Bayesian statistics offers an elegant and direct tool to answer them: the Beta distribution.

The Beta distribution is a continuous probability distribution defined on the interval [0, 1]. That sounds abstract, but it’s exactly what we need whenever we want to model the uncertainty around a proportion: a conversion rate, a CTR, a click percentage, a probability of success. Intuitively, Beta is a distribution over the possible probabilities of the event, and that is what makes it unique.

What we’ll cover:


What is a distribution over probabilities

In real life, unlike textbook probability problems, we almost never have the exact value of a probability — we have data.
We have 65 conversions out of 800 visits, not the “true” conversion rate of the page. Our job is to work back from those data to an estimate of the hidden value and, above all, to an idea of how uncertain that estimate is.

A probability distribution like the Beta solves precisely this problem: instead of a single number (the raw 8.1%), we get a curve that assigns a degree of plausibility to every possible value of the proportion. Higher points on the curve correspond to more probable values; lower points to less probable ones. Uncertainty is not a flaw in the estimate — it is part of the result.

In technical terms, the Beta is defined by its probability density function (PDF):

\( Beta(p; \alpha, \beta) = \frac{p^{\alpha-1} \times (1-p)^{\beta-1}}{B(\alpha, \beta)} \\ \)

Where:

  • \(p\) — the proportion we are estimating (a value between 0 and 1)
  • \(\alpha\) and \(\beta\) — the shape parameters, which determine the appearance of the distribution

Later we will see that α and β can be interpreted as counts of successes and failures, starting from an initial value chosen as the prior. For now, let’s focus on their influence on the shape.

The function \(B(\alpha, \beta)\) in the denominator serves solely to normalize the distribution, ensuring the total area under the curve equals 1 — as required for any probability distribution.


Parameters α and β: the flexibility of the Beta

The real strength of the Beta is its flexibility. Depending on α and β values, its shape changes dramatically, making it suitable for very different scenarios:

  • When α and β are equal, the distribution is symmetric around 0.5
  • When α > β, the distribution is skewed to the right (higher values more likely)
  • When α < β, the distribution is skewed to the left (lower values more likely)
  • When α = β = 1, the Beta becomes a uniform distribution — all values between 0 and 1 are equally likely (non-informative prior)
  • When α and β are both less than 1, the distribution takes a U-shape (high probability at the extremes, low in the middle)

The mean of the Beta is calculated with a simple formula:

\( \text{Mean} = \frac{\alpha}{\alpha + \beta} \\ \)

And the mode (for α > 1 and β > 1):

\( \text{Mode} = \frac{\alpha – 1}{\alpha + \beta – 2} \\ \)

Shape tells the story

Let’s look at four parameter combinations to see visually how versatile the Beta is:

Beta distribution with four different parameter combinations: Beta(0.5, 0.5) U-shaped, Beta(2, 5) skewed left, Beta(5, 2) skewed right, Beta(5, 5) symmetric bell-shaped.
Beta distribution with four different parameter combinations: Beta(0.5, 0.5) U-shaped, Beta(2, 5) skewed left, Beta(5, 2) skewed right, Beta(5, 5) symmetric bell-shaped.
  • Beta(0.5, 0.5) — U-shaped: high probability at the extremes (near 0% and 100%), low in the middle. A prior used when we suspect the phenomenon is “all or nothing”.
  • Beta(2, 5) — skewed right (long tail toward 1): useful when the proportion tends to be low.
  • Beta(5, 2) — skewed left: for proportions that tend to be high.
  • Beta(5, 5) — symmetric bell centered on 0.5: when the evidence is balanced.

The same mathematical family produces such different shapes: this is why the Beta is the most widely used distribution for modeling proportions and probabilities in Bayesian statistics.


An example: the online game

Let’s jump into an example. An online game organizer claims that at least 1 in 10 players wins a prize. We have the data from the last 800 players, among whom there were 65 winners.
Is the organizer telling the truth? Based on the data, do we think the probability of winning is at least 10%?

We use the Beta. Our prior — what we know before seeing the data — is Beta(1, 1), the uniform distribution that assigns equal plausibility to every possible value. After observing 65 winners out of 800, the posterior is Beta(66, 736). Why 66 and 736? Because with a Beta(1, 1) prior, the posterior parameters are α = 1 + successes and β = 1 + failures, so α = 1 + 65 = 66 and β = 1 + 735 = 736.

Let’s calculate the probability that the true win rate is at least 10%:

# Non-informative prior: Beta(1,1)
# Data: 65 winners out of 800 players
# Posterior: Beta(1 + 65, 1 + 735) = Beta(66, 736)
a_post <- 66; b_post <- 736

# Probability that p >= 0.10 — two equivalent ways
integrate(function(x) dbeta(x, a_post, b_post), 0.10, 1)
1 - pbeta(0.10, a_post, b_post)

Output:

0.03974288 with absolute error < 2.3e-06
0.03974288

Based on the data, the probability that the true win rate is at least 10% is about 4%. The organizer’s claim appears implausible.

Posterior Beta(66, 736) with non-informative prior Beta(1,1). The red area corresponds to P(p ≥ 10%) ≈ 4% — the region where the organizer's claim would be true.
Posterior Beta(66, 736) with non-informative prior Beta(1,1). The red area corresponds to P(p ≥ 10%) ≈ 4% — the region where the organizer’s claim would be true.

The figure shows the flat prior (orange horizontal line) and the posterior Beta(66, 736) (blue curve). The shaded red area to the right of the 10% threshold is tiny — about 4% — while the vast majority of the distribution lies below 10%.

We can also read the credible interval of the distribution — the Bayesian equivalent of a confidence interval, but with a more direct meaning:

# Mean and 95% CI of the posterior
cat("Mean:", round(66/(66+736), 3), "\n")
cat("95% CI:", round(qbeta(c(0.025, 0.975), 66, 736), 3))

Output:

Mean: 0.082
95% CI: 0.064 0.102
Posterior Beta(66, 736) with mean (green), mode (orange) and 95% credible interval (red segment): the distribution is concentrated between 6.4% and 10.2%.
Posterior Beta(66, 736) with mean (green), mode (orange) and 95% credible interval (red segment): the distribution is concentrated between 6.4% and 10.2%.

The most probable win rate is around 8.2%, with a 95% credible interval between 6.4% and 10.2%. The organizer claimed 10% — right at the upper bound of our estimate, with less than 3% probability that the true value is higher. Not impossible, but decidedly implausible.


An SEO example: estimating a conversion rate

Let’s return to the opening case: 65 conversions out of 800 sessions on a landing page. We estimate the conversion rate with the Beta, exactly as we just did.

With a non-informative prior Beta(1, 1) and the observed data, the posterior is Beta(66, 736). The mean is 66/802 ≈ 8.2%, with a 95% CI between 6.4% and 10.2%.

This interval is the statistical answer to the question “how much can I trust my conversion rate?” The raw 8.1% we see in GA4 is just the center of the distribution: the true value could reasonably lie anywhere between 6.4% and 10.2%.

If we accumulate more data — say 200 conversions out of 2200 total sessions — with a Beta(1, 1) prior, the posterior becomes Beta(201, 2001), the mean is 201/2202 ≈ 9.1% but the 95% CI narrows to [8.0%; 10.4%]: uncertainty decreases because we have more evidence.

If instead we have very little data (5 conversions out of 50 sessions), the posterior Beta(6, 46) gives a mean of 6/52 ≈ 11.5% and a 95% CI of [4.9%; 20.6%] — enormous uncertainty. Here the Beta does not hide the uncertainty: it displays it honestly.

A word of caution: the Beta models our uncertainty about the proportion, not the proportion itself. The result is not “the conversion rate is 8.2%”, but “based on the data, the distribution of our uncertainty about the rate is Beta(66, 736)”. It is a subtle but fundamental difference — and it is the heart of the Bayesian approach.


The Beta as sequential updating

One of the most elegant properties of the Beta is that it supports sequential updating: if after the first 65 conversions out of 800 sessions we observe another 40 out of 500 new sessions, we do not have to start from scratch. We take the posterior Beta(66, 736) as the new prior and update it with the new data:

# New posterior: Beta(66 + 40, 736 + 460) = Beta(106, 1196)
a_new <- 66 + 40; b_new <- 736 + 460
cat("New mean:", round(a_new/(a_new + b_new), 3), "\n")
cat("New 95% CI:", round(qbeta(c(0.025, 0.975), a_new, b_new), 3))

Output:

New mean: 0.081
New 95% CI: 0.067 0.097

The mean stayed stable (confirming that the new data are consistent), but the interval narrowed: from [6.4%; 10.2%] to [6.7%; 9.7%]. Each new data point refines the estimate.

This property — today’s posterior is tomorrow’s prior — is what makes the Beta the tool of choice for Bayesian analysis of proportions, and the foundation on which more advanced tools like Bayesian A/B testing and Thompson sampling are built.


Try it yourself

A lead generation site has 12 conversions out of 350 sessions.

  1. Calculate the posterior Beta with a non-informative prior Beta(1, 1). What are the posterior α and β parameters?
  2. What is the mean of the posterior? And the 95% CI?
  3. The site owner claims the conversion rate is at least 5%. Do the data support that? (Hint: calculate P(p ≥ 0.05) using pbeta)
  4. If the same site had 120 conversions out of 3500 sessions (same raw rate, 10× the data), how would the interval change? Why?

In this article we have seen what the Beta distribution is, how α and β parameters determine its shape, and how it is used to estimate proportions from observed data. It is the fundamental building block of Bayesian inference for conversion rates.
In the next article we will take the next step: estimating a conversion rate with the Beta, using informative and non-informative priors in a concrete SEO case.


Further reading

Two books to continue: Finalmente ho capito la statistica by Maurizio De Pra (Italian edition) to place the Beta among other distributions, and Bayesian Statistics the Fun Way by Will Kurt to discover why this distribution is the queen of Bayesian inference, with R examples like the ones we use here.

This article is part of the «Bayesian approach» path, the curated guide to articles on Bayesian statistics and inference applied to SEO.

Leave a Reply

Your email address will not be published. Required fields are marked *