Beta distribution

Beta
Probability density function
Probability density function for the beta distribution
Cumulative distribution function
Cumulative distribution function for the beta distribution
Notation Beta(α, β)
Parameters α > 0 shape (real)
β > 0 shape (real)
Support or
PDF
where and is the Gamma function.
CDF

(the regularized incomplete beta function)
Mean





(see section: Geometric mean)

where is the digamma function
Median
Mode

for α, β > 1

any value in for α, β = 1

{0, 1} (bimodal) for α, β < 1

0 for α ≤ 1, β ≥ 1, αβ

1 for α ≥ 1, β ≤ 1, αβ
Variance

(see trigamma function and see section: Geometric variance)
Skewness
Excess kurtosis
Entropy
MGF
CF (see Confluent hypergeometric function)
Fisher information
see section: Fisher information matrix
Method of moments

In probability theory and statistics, the beta distribution is a family of continuous probability distributions defined on the interval [0, 1] or (0, 1) in terms of two positive parameters, denoted by alpha (α) and beta (β), that appear as exponents of the variable and its complement to 1, respectively, and control the shape of the distribution.

The beta distribution has been applied to model the behavior of random variables limited to intervals of finite length in a wide variety of disciplines. The beta distribution is a suitable model for the random behavior of percentages and proportions.

In Bayesian inference, the beta distribution is the conjugate prior probability distribution for the Bernoulli, binomial, negative binomial, and geometric distributions.

The formulation of the beta distribution discussed here is also known as the beta distribution of the first kind, whereas beta distribution of the second kind is an alternative name for the beta prime distribution. The generalization to multiple variables is called a Dirichlet distribution.

Definitions

[edit]

Probability density function

[edit]
An animation of the beta distribution for different values of its parameters.

The probability density function (PDF) of the beta distribution, for or , and shape parameters , , is a power function of the variable and of its reflection as follows:

where is the gamma function. The beta function, , is a normalization constant to ensure that the total probability is 1. In the above equations is a realization—an observed value that actually occurred—of a random variable .

Several authors, including N. L. Johnson and S. Kotz,[1] use the symbols and (instead of and ) for the shape parameters of the beta distribution, reminiscent of the symbols traditionally used for the parameters of the Bernoulli distribution, because the beta distribution approaches the Bernoulli distribution in the limit when both shape parameters and approach the value of zero.

In the following, a random variable beta-distributed with parameters and will be denoted by:[2][3]

Other notations for beta-distributed random variables used in the statistical literature are [4] and .[5]

Cumulative distribution function

[edit]
CDF for symmetric beta distribution vs. x and α = β
CDF for skewed beta distribution vs. x and β = 5α

The cumulative distribution function is

where is the incomplete beta function and is the regularized incomplete beta function.

Alternative parameterizations

[edit]

Two parameters

[edit]
Mean and sample size
[edit]

The beta distribution may also be reparameterized in terms of its mean μ (0 < μ < 1) and the sum of the two shape parameters ν = α + β > 0([3] p. 83). Denoting by αPosterior and βPosterior the shape parameters of the posterior beta distribution resulting from applying Bayes theorem to a binomial likelihood function and a prior probability, the interpretation of the addition of both shape parameters to be sample size = ν = α·Posterior + β·Posterior is only correct for the Haldane prior probability Beta(0,0). Specifically, for the Bayes (uniform) prior Beta(1,1) the correct interpretation would be sample size = α·Posterior + β Posterior − 2, or ν = (sample size) + 2. For sample size much larger than 2, the difference between these two priors becomes negligible. (See section Bayesian inference for further details.) ν = α + β is referred to as the "sample size" of a beta distribution, but one should remember that it is, strictly speaking, the "sample size" of a binomial likelihood function only when using a Haldane Beta(0,0) prior in Bayes theorem.

This parametrization may be useful in Bayesian parameter estimation. For example, one may administer a test to a number of individuals. If it is assumed that each person's score (0 ≤ θ ≤ 1) is drawn from a population-level beta distribution, then an important statistic is the mean of this population-level distribution. The mean and sample size parameters are related to the shape parameters α and β via[3]

α = μν, β = (1 − μ)ν

Under this parametrization, one may place an uninformative prior probability over the mean, and a vague prior probability (such as an exponential or gamma distribution) over the positive reals for the sample size, if they are independent, and prior data and/or beliefs justify it.

Mode and concentration
[edit]

Concave beta distributions, which have , can be parametrized in terms of mode and "concentration". The mode, , and concentration, , can be used to define the usual shape parameters as follows:[6]

For the mode, , to be well-defined, we need , or equivalently . If instead we define the concentration as , the condition simplifies to and the beta density at and can be written as:

where directly scales the sufficient statistics, and . Note also that in the limit, , the distribution becomes flat.

Mean and variance
[edit]

Solving the system of (coupled) equations given in the above sections as the equations for the mean and the variance of the beta distribution in terms of the original parameters α and β, one can express the α and β parameters in terms of the mean (μ) and the variance (var):

This parametrization of the beta distribution may lead to a more intuitive understanding than the one based on the original parameters α and β. For example, by expressing the mode, skewness, excess kurtosis and differential entropy in terms of the mean and the variance:

Four parameters

[edit]

A beta distribution with the two shape parameters α and β is supported on the range [0,1] or (0,1). It is possible to alter the location and scale of the distribution by introducing two further parameters representing the minimum, a, and maximum c (c > a), values of the distribution,[1] by a linear transformation substituting the non-dimensional variable x in terms of the new variable y (with support [a,c] or (a,c)) and the parameters a and c:

The probability density function of the four parameter beta distribution is equal to the two parameter distribution, scaled by the range (c − a), (so that the total area under the density curve equals a probability of one), and with the "y" variable shifted and scaled as follows:

That a random variable Y is beta-distributed with four parameters α, β, a, and c will be denoted by:

Some measures of central location are scaled (by (c − a)) and shifted (by a), as follows:

Note: the geometric mean and harmonic mean cannot be transformed by a linear transformation in the way that the mean, median and mode can.

The shape parameters of Y can be written in term of its mean and variance as

The statistical dispersion measures are scaled (they do not need to be shifted because they are already centered on the mean) by the range (c − a), linearly for the mean deviation and nonlinearly for the variance:

Since the skewness and excess kurtosis are non-dimensional quantities (as moments centered on the mean and normalized by the standard deviation), they are independent of the parameters a and c, and therefore equal to the expressions given above in terms of X (with support [0,1] or (0,1)):

Properties

[edit]

Measures of central tendency

[edit]

Mode

[edit]

The mode of a beta distributed random variable X with α, β > 1 is the most likely value of the distribution (corresponding to the peak in the PDF), and is given by the following expression:[1]

When both parameters are less than one (α, β < 1), this is the anti-mode: the lowest point of the probability density curve.[7]

Letting α = β, the expression for the mode simplifies to 1/2, showing that for α = β > 1 the mode (resp. anti-mode when α, β < 1), is at the center of the distribution: it is symmetric in those cases. See Shapes section in this article for a full list of mode cases, for arbitrary values of α and β. For several of these cases, the maximum value of the density function occurs at one or both ends. In some cases the (maximum) value of the density function occurring at the end is finite. For example, in the case of α = 2, β = 1 (or α = 1, β = 2), the density function becomes a right-triangle distribution which is finite at both ends. In several other cases there is a singularity at one end, where the value of the density function approaches infinity. For example, in the case α = β = 1/2, the beta distribution simplifies to become the arcsine distribution. There is debate among mathematicians about some of these cases and whether the ends (x = 0, and x = 1) can be called modes or not.[8][2]

Mode for beta distribution for 1 ≤ α ≤ 5 and 1 ≤ β ≤ 5
  • Whether the ends are part of the domain of the density function
  • Whether a singularity can ever be called a mode
  • Whether cases with two maxima should be called bimodal

Median

[edit]
Median for beta distribution for 0 ≤ α ≤ 5 and 0 ≤ β ≤ 5
(Mean–median) for beta distribution versus alpha and beta from 0 to 2

The median of the beta distribution is the unique real number for which the regularized incomplete beta function . There is no general closed-form expression for the median of the beta distribution for arbitrary values of α and β. Closed-form expressions for particular values of the parameters α and β follow:[citation needed]

  • For symmetric cases α = β, median = 1/2.
  • For α = 1 and β > 0, median (this case is the mirror-image of the power function [0,1] distribution)
  • For α > 0 and β = 1, median = (this case is the power function [0,1] distribution[8])
  • For α = 3 and β = 2, median = 0.6142724318676105..., the real solution to the quartic equation 1 − 8x3 + 6x4 = 0, which lies in [0,1].
  • For α = 2 and β = 3, median = 0.38572756813238945... = 1−median(Beta(3, 2))

The following are the limits with one parameter finite (non-zero) and the other approaching these limits:[citation needed]

A reasonable approximation of the value of the median of the beta distribution, for both α and β greater or equal to one, is given by the formula[9]

When α, β ≥ 1, the relative error (the absolute error divided by the median) in this approximation is less than 4% and for both α ≥ 2 and β ≥ 2 it is less than 1%. The absolute error divided by the difference between the mean and the mode is similarly small:

Abs[(Median-Appr.)/Median] for beta distribution for 1 ≤ α ≤ 5 and 1 ≤ β ≤ 5Abs[(Median-Appr.)/(Mean-Mode)] for beta distribution for 1≤α≤5 and 1≤β≤5

Mean

[edit]
Mean for beta distribution for 0 ≤ α ≤ 5 and 0 ≤ β ≤ 5

The expected value (mean) (μ) of a beta distribution random variable X with two parameters α and β is a function of only the ratio β/α of these parameters:[1]

Letting α = β in the above expression one obtains μ = 1/2, showing that for α = β the mean is at the center of the distribution: it is symmetric. Also, the following limits can be obtained from the above expression:

Therefore, for β/α → 0, or for α/β → ∞, the mean is located at the right end, x = 1. For these limit ratios, the beta distribution becomes a one-point degenerate distribution with a Dirac delta function spike at the right end, x = 1, with probability 1, and zero probability everywhere else. There is 100% probability (absolute certainty) concentrated at the right end, x = 1.

Similarly, for β/α → ∞, or for α/β → 0, the mean is located at the left end, x = 0. The beta distribution becomes a 1-point Degenerate distribution with a Dirac delta function spike at the left end, x = 0, with probability 1, and zero probability everywhere else. There is 100% probability (absolute certainty) concentrated at the left end, x = 0. Following are the limits with one parameter finite (non-zero) and the other approaching these limits:

While for typical unimodal distributions (with centrally located modes, inflexion points at both sides of the mode, and longer tails) (with Beta(αβ) such that α, β > 2) it is known that the sample mean (as an estimate of location) is not as robust as the sample median, the opposite is the case for uniform or "U-shaped" bimodal distributions (with Beta(αβ) such that α, β ≤ 1), with the modes located at the ends of the distribution. As Mosteller and Tukey remark ([10] p. 207) "the average of the two extreme observations uses all the sample information. This illustrates how, for short-tailed distributions, the extreme observations should get more weight." By contrast, it follows that the median of "U-shaped" bimodal distributions with modes at the edge of the distribution (with Beta(αβ) such that α, β ≤ 1) is not robust, as the sample median drops the extreme sample observations from consideration. A practical application of this occurs for example for random walks, since the probability for the time of the last visit to the origin in a random walk is distributed as the arcsine distribution Beta(1/2, 1/2):[5][11] the mean of a number of realizations of a random walk is a much more robust estimator than the median (which is an inappropriate sample measure estimate in this case).

Geometric mean

[edit]
(Mean − GeometricMean) for beta distribution versus α and β from 0 to 2, showing the asymmetry between α and β for the geometric mean
Geometric means for beta distribution Purple = G(x), Yellow = G(1 − x), smaller values α and β in front
Geometric means for beta distribution. purple = G(x), yellow = G(1 − x), larger values α and β in front

The logarithm of the geometric mean GX of a distribution with random variable X is the arithmetic mean of ln(X), or, equivalently, its expected value:

For a beta distribution, the expected value integral gives:

where ψ is the digamma function.

Therefore, the geometric mean of a beta distribution with shape parameters α and β is the exponential of the digamma functions of α and β as follows:

While for a beta distribution with equal shape parameters α = β, it follows that skewness = 0 and mode = mean = median = 1/2, the geometric mean is less than 1/2: 0 < GX < 1/2. The reason for this is that the logarithmic transformation strongly weights the values of X close to zero, as ln(X) strongly tends towards negative infinity as X approaches zero, while ln(X) flattens towards zero as X → 1.

Along a line α = β, the following limits apply:

Following are the limits with one parameter finite (non-zero) and the other approaching these limits:

The accompanying plot shows the difference between the mean and the geometric mean for shape parameters α and β from zero to 2. Besides the fact that the difference between them approaches zero as α and β approach infinity and that the difference becomes large for values of α and β approaching zero, one can observe an evident asymmetry of the geometric mean with respect to the shape parameters α and β. The difference between the geometric mean and the mean is larger for small values of α in relation to β than when exchanging the magnitudes of β and α.

N. L.Johnson and S. Kotz[1] suggest the logarithmic approximation to the digamma function ψ(α) ≈ ln(α − 1/2) which results in the following approximation to the geometric mean:

Numerical values for the relative error in this approximation follow: [(α = β = 1): 9.39%]; [(α = β = 2): 1.29%]; [(α = 2, β = 3): 1.51%]; [(α = 3, β = 2): 0.44%]; [(α = β = 3): 0.51%]; [(α = β = 4): 0.26%]; [(α = 3, β = 4): 0.55%]; [(α = 4, β = 3): 0.24%].

Similarly, one can calculate the value of shape parameters required for the geometric mean to equal 1/2. Given the value of the parameter β, what would be the value of the other parameter, α, required for the geometric mean to equal 1/2?. The answer is that (for β > 1), the value of α required tends towards β + 1/2 as β → ∞. For example, all these couples have the same geometric mean of 1/2: [β = 1, α = 1.4427], [β = 2, α = 2.46958], [β = 3, α = 3.47943], [β = 4, α = 4.48449], [β = 5, α = 5.48756], [β = 10, α = 10.4938], [β = 100, α = 100.499].

The fundamental property of the geometric mean, which can be proven to be false for any other mean, is

This makes the geometric mean the only correct mean when averaging normalized results, that is results that are presented as ratios to reference values.[12] This is relevant because the beta distribution is a suitable model for the random behavior of percentages and it is particularly suitable to the statistical modelling of proportions. The geometric mean plays a central role in maximum likelihood estimation, see section "Parameter estimation, maximum likelihood." Actually, when performing maximum likelihood estimation, besides the geometric mean GX based on the random variable X, also another geometric mean appears naturally: the geometric mean based on the linear transformation ––(1 − X), the mirror-image of X, denoted by G(1−X):

Along a line α = β, the following limits apply:

Following are the limits with one parameter finite (non-zero) and the other approaching these limits:

It has the following approximate value:

Although both GX and G(1−X) are asymmetric, in the case that both shape parameters are equal α = β, the geometric means are equal: GX = G(1−X). This equality follows from the following symmetry displayed between both geometric means:

Harmonic mean

[edit]
Harmonic mean for beta distribution for 0 < α < 5 and 0 < β < 5
Harmonic mean for beta distribution versus α and β from 0 to 2
Harmonic means for beta distribution Purple = H(X), Yellow = H(1 − X), smaller values α and β in front
Harmonic means for beta distribution: purple = H(X), yellow = H(1 − X), larger values α and β in front

The inverse of the harmonic mean (HX) of a distribution with random variable X is the arithmetic mean of 1/X, or, equivalently, its expected value. Therefore, the harmonic mean (HX) of a beta distribution with shape parameters α and β is:

The harmonic mean (HX) of a beta distribution with α < 1 is undefined, because its defining expression is not bounded in [0, 1] for shape parameter α less than unity.

Letting α = β in the above expression one obtains

showing that for α = β the harmonic mean ranges from 0, for α = β = 1, to 1/2, for α = β → ∞.

Following are the limits with one parameter finite (non-zero) and the other approaching these limits:

The harmonic mean plays a role in maximum likelihood estimation for the four parameter case, in addition to the geometric mean. Actually, when performing maximum likelihood estimation for the four parameter case, besides the harmonic mean HX based on the random variable X, also another harmonic mean appears naturally: the harmonic mean based on the linear transformation (1 − X), the mirror-image of X, denoted by H1 − X:

The harmonic mean (H(1 − X)) of a beta distribution with β < 1 is undefined, because its defining expression is not bounded in [0, 1] for shape parameter β less than unity.

Letting α = β in the above expression one obtains

showing that for α = β the harmonic mean ranges from 0, for α = β = 1, to 1/2, for α = β → ∞.

Following are the limits with one parameter finite (non-zero) and the other approaching these limits:

Although both HX and H1−X are asymmetric, in the case that both shape parameters are equal α = β, the harmonic means are equal: HX = H1−X. This equality follows from the following symmetry displayed between both harmonic means:

Measures of statistical dispersion

[edit]

Variance

[edit]

The variance (the second moment centered on the mean) of a beta distribution random variable X with parameters α and β is:[1][13]

Letting α = β in the above expression one obtains

showing that for α = β the variance decreases monotonically as α = β increases. Setting α = β = 0 in this expression, one finds the maximum variance var(X) = 1/4[1] which only occurs approaching the limit, at α = β = 0.

The beta distribution may also be parametrized in terms of its mean μ (0 < μ < 1) and sample size ν = α + β (ν > 0) (see subsection Mean and sample size):

Using this parametrization, one can express the variance in terms of the mean μ and the sample size ν as follows:

Since ν = α + β > 0, it follows that var(X) < μ(1 − μ).

For a symmetric distribution, the mean is at the middle of the distribution, μ = 1/2, and therefore:

Also, the following limits (with only the noted variable approaching the limit) can be obtained from the above expressions:

Geometric variance and covariance

[edit]
log geometric variances vs. α and β
log geometric variances vs. α and β

The logarithm of the geometric variance, ln(varGX), of a distribution with random variable X is the second moment of the logarithm of X centered on the geometric mean of X, ln(GX):

and therefore, the geometric variance is:

In the Fisher information matrix, and the curvature of the log likelihood function, the logarithm of the geometric variance of the reflected variable 1 − X and the logarithm of the geometric covariance between X and 1 − X appear:

For a beta distribution, higher order logarithmic moments can be derived by using the representation of a beta distribution as a proportion of two gamma distributions and differentiating through the integral. They can be expressed in terms of higher order poly-gamma functions. See the section § Moments of logarithmically transformed random variables. The variance of the logarithmic variables and covariance of ln X and ln(1−X) are:

where the trigamma function, denoted ψ1(α), is the second of the polygamma functions, and is defined as the derivative of the digamma function:

Therefore,

The accompanying plots show the log geometric variances and log geometric covariance versus the shape parameters α and β. The plots show that the log geometric variances and log geometric covariance are close to zero for shape parameters α and β greater than 2, and that the log geometric variances rapidly rise in value for shape parameter values α and β less than unity. The log geometric variances are positive for all values of the shape parameters. The log geometric covariance is negative for all values of the shape parameters, and it reaches large negative values for α and β less than unity.

Following are the limits with one parameter finite (non-zero) and the other approaching these limits:

Limits with two parameters varying:

Although both ln(varGX) and ln(varG(1 − X)) are asymmetric, when the shape parameters are equal, α = β, one has: ln(varGX) = ln(varG(1−X)). This equality follows from the following symmetry displayed between both log geometric variances:

The log geometric covariance is symmetric:

Mean absolute deviation around the mean

[edit]
Ratio of ,ean abs.dev. to std.dev. for beta distribution with α and β ranging from 0 to 5
Ratio of mean abs.dev. to std.dev. for beta distribution with mean 0 ≤ μ ≤ 1 and sample size 0 < ν ≤ 10

The mean absolute deviation around the mean for the beta distribution with shape parameters α and β is:[8]

The mean absolute deviation around the mean is a more robust estimator of statistical dispersion than the standard deviation for beta distributions with tails and inflection points at each side of the mode, Beta(αβ) distributions with α,β > 2, as it depends on the linear (absolute) deviations rather than the square deviations from the mean. Therefore, the effect of very large deviations from the mean are not as overly weighted.

Using Stirling's approximation to the Gamma function, N.L.Johnson and S.Kotz[1] derived the following approximation for values of the shape parameters greater than unity (the relative error for this approximation is only −3.5% for α = β = 1, and it decreases to zero as α → ∞, β → ∞):

At the limit α → ∞, β → ∞, the ratio of the mean absolute deviation to the standard deviation (for the beta distribution) becomes equal to the ratio of the same measures for the normal distribution: . For α = β = 1 this ratio equals , so that from α = β = 1 to α, β → ∞ the ratio decreases by 8.5%. For α = β = 0 the standard deviation is exactly equal to the mean absolute deviation around the mean. Therefore, this ratio decreases by 15% from α = β = 0 to α = β = 1, and by 25% from α = β = 0 to α, β → ∞ . However, for skewed beta distributions such that α → 0 or β → 0, the ratio of the standard deviation to the mean absolute deviation approaches infinity (although each of them, individually, approaches zero) because the mean absolute deviation approaches zero faster than the standard deviation.

Using the parametrization in terms of mean μ and sample size ν = α + β > 0:

α = μν, β = (1−μ)ν

one can express the mean absolute deviation around the mean in terms of the mean μ and the sample size ν as follows:

For a symmetric distribution, the mean is at the middle of the distribution, μ = 1/2, and therefore:

Also, the following limits (with only the noted variable approaching the limit) can be obtained from the above expressions:

Mean absolute difference

[edit]

The mean absolute difference for the beta distribution is:

The Gini coefficient for the beta distribution is half of the relative mean absolute difference:

Skewness

[edit]
Skewness for Beta Distribution as a function of variance and mean

The skewness (the third moment centered on the mean, normalized by the 3/2 power of the variance) of the beta distribution is[1]

Letting α = β in the above expression one obtains γ1 = 0, showing once again that for α = β the distribution is symmetric and hence the skewness is zero. Positive skew (right-tailed) for α < β, negative skew (left-tailed) for α > β.

Using the parametrization in terms of mean μ and sample size ν = α + β:

one can express the skewness in terms of the mean μ and the sample size ν as follows:

The skewness can also be expressed just in terms of the variance var and the mean μ as follows:

The accompanying plot of skewness as a function of variance and mean shows that maximum variance (1/4) is coupled with zero skewness and the symmetry condition (μ = 1/2), and that maximum skewness (positive or negative infinity) occurs when the mean is located at one end or the other, so that the "mass" of the probability distribution is concentrated at the ends (minimum variance).

The following expression for the square of the skewness, in terms of the sample size ν = α + β and the variance var, is useful for the method of moments estimation of four parameters:

This expression correctly gives a skewness of zero for α = β, since in that case (see § Variance): .

For the symmetric case (α = β), skewness = 0 over the whole range, and the following limits apply:

For the asymmetric cases (α ≠ β) the following limits (with only the noted variable approaching the limit) can be obtained from the above expressions:

Kurtosis

[edit]
Excess Kurtosis for Beta Distribution as a function of variance and mean

The beta distribution has been applied in acoustic analysis to assess damage to gears, as the kurtosis of the beta distribution has been reported to be a good indicator of the condition of a gear.[14] Kurtosis has also been used to distinguish the seismic signal generated by a person's footsteps from other signals. As persons or other targets moving on the ground generate continuous signals in the form of seismic waves, one can separate different targets based on the seismic waves they generate. Kurtosis is sensitive to impulsive signals, so it's much more sensitive to the signal generated by human footsteps than other signals generated by vehicles, winds, noise, etc.[15] Unfortunately, the notation for kurtosis has not been standardized. Kenney and Keeping[16] use the symbol γ2 for the excess kurtosis, but Abramowitz and Stegun[17] use different terminology. To prevent confusion[18] between kurtosis (the fourth moment centered on the mean, normalized by the square of the variance) and excess kurtosis, when using symbols, they will be spelled out as follows:[8][19]