Continuous distribution

Beta distribution

An unknown probability or proportion: a conversion rate, a batting average, the share of a vote. It is the conjugate prior for the Bernoulli and binomial, so after a Beta() prior and successes in trials the posterior is Beta(): the parameters act like prior counts of successes and failures.

Beta probability calculator

P(X ≤ 0.26) = 0.489628

At the parameters set by the sliders. The shaded region on the plot is the probability; the dots on the CDF mark F at its ends.

PDF

01200.20.40.60.81f(x)mean

CDF

00.250.50.75100.20.40.60.81F(x)

mean 0.2857 · variance 0.02551 · sd 0.1597 · mode 0.2 · entropy −0.4845 nats

Formulas

Parameters
Support
PDF
CDF
Mean
Variance
Mode
MGF
Entropy

Worked example

A new button is clicked by 7 of the first 10 visitors. Starting from a uniform prior on its click rate , what is the probability that ?

The uniform prior is Beta(1, 1), so the posterior is Beta(1 + 7, 1 + 3) = Beta(8, 4), with mean . Then . answer checked by code

How it relates to others

All the relationships, as a diagram →

In Python

from scipy import stats
import numpy as np

X = stats.beta(a=2, b=5)
X.pdf(0.3)  # f(0.3) = 2.161
X.cdf(0.3)  # P(X ≤ 0.3) = 0.5798
X.mean(), X.var()  # 0.2857, 0.02551
X.ppf(0.95)  # 95th percentile
X.rvs(size=10, random_state=0)

rng = np.random.default_rng(0)
rng.beta(a=2, b=5, size=10)

Choosing between this and its neighbours? Which distribution for proportions and probabilities? · Which prior distribution should I use?

← LévyKumaraswamy →