Dirichlet distribution

Jump to navigation Jump to search
File:Dirichlet distributions.png
Several images of the probability density of the Dirichlet distribution when K=3 for various parameter vectors α. Clockwise from top left: α=(6, 2, 2), (3, 7, 5), (6, 2, 6), (2, 3, 4).

In probability and statistics, the Dirichlet distribution (after Johann Peter Gustav Lejeune Dirichlet), often denoted Dir(α), is a family of continuous multivariate probability distributions parametrized by the vector α of positive reals. It is the multivariate generalization of the beta distribution, and conjugate prior of the multinomial distribution in Bayesian statistics. That is, its probability density function returns the belief that the probabilities of K rival events are <math>x_i</math> given that each event has been observed <math>\alpha_i-1</math> times.

Probability density function

File:LogDirichletDensity-alpha 0.3 to alpha 2.0.gif
Illustrating how the log of the density function changes when K=3 as we change the vector α from α=(0.3, 0.3, 0.3) to (2.0, 2.0, 2.0), keeping all the individual <math>\alpha_i</math>'s equal to each other.

The Dirichlet distribution of order K ≥ 2 with parameters α1, ..., αK > 0 has a probability density function with respect to Lebesgue measure on the Euclidean space RK–1 given by

<math>f(x_1,\dots, x_{K-1}; \alpha_1,\dots, \alpha_K) = \frac{1}{\mathrm{B}(\alpha)} \prod_{i=1}^K x_i^{\alpha_i - 1} </math>

for all x1, ..., xK–1 > 0 satisfying x1 + ... + xK–1 < 1, where xK is an abbreviation for 1 – x1 – ... – xK–1. The density is zero outside this open (K − 1)-dimensional simplex.

The normalizing constant is the multinomial beta function, which can be expressed in terms of the gamma function:

<math>\mathrm{B}(\alpha) = \frac{\prod_{i=1}^K \Gamma(\alpha_i)}{\Gamma\bigl(\sum_{i=1}^K \alpha_i\bigr)},\qquad\alpha=(\alpha_1,\dots,\alpha_K).</math>

Properties

Let <math>X = (X_1, \ldots, X_K)\sim\operatorname{Dir}(\alpha)</math>, meaning that the first K – 1 components have the above density and

<math>X_K=1-X_1-\cdots-X_{K-1}.</math>

Define <math>\textstyle\alpha_0 = \sum_{i=1}^K\alpha_i</math>. Then

<math> \mathrm{E}[X_i] = \frac{\alpha_i}{\alpha_0},</math>
<math>\mathrm{Var}[X_i] = \frac{\alpha_i (\alpha_0-\alpha_i)}{\alpha_0^2 (\alpha_0+1)},</math>

in fact, the marginals are Beta distributions:

<math>X_i \sim \operatorname{Beta}(\alpha_i, \alpha_0 - \alpha_i). </math>

Furthermore,

<math>\mathrm{Cov}[X_iX_j] = \frac{- \alpha_i \alpha_j}{\alpha_0^2 (\alpha_0+1)}.</math>

The mode of the distribution is the vector (x1, ..., xK) with

<math> x_i = \frac{\alpha_i - 1}{\alpha_0 - K}, \quad \alpha_i > 1. </math>

The Dirichlet distribution is conjugate to the multinomial distribution in the following sense: if

<math>\beta \mid X=(\beta_1, \ldots, \beta_{K}) \mid X \sim \operatorname{Mult}(X),</math>

where βi is the number of occurrences of i in a sample of n points from the discrete distribution on {1, ..., K} defined by X, then

<math>X \mid \beta \sim \operatorname{Dir}(\alpha + \beta).</math>

This relationship is used in Bayesian statistics to estimate the hidden parameters, X, of a discrete probability distribution given a collection of n samples. Intuitively, if the prior is represented as Dir(α), then Dir(α + β) is the posterior following a sequence of observations with histogram β.


Neutrality

(main article: neutral vector).

If <math>X = (X_1, \ldots, X_K)\sim\operatorname{Dir}(\alpha)</math>, then the vector~<math>X</math> is said to be neutral[1] in the sense that <math>X_1</math> is independent of <math>X_2/(1-X_1),X_3/(1-X_1),\ldots,X_K/(1-X_1)</math> and similarly for <math>X_2,\ldots,X_{K-1}</math>.

Observe that any permutation of <math>X</math> is also neutral (a property not possessed by samples drawn from a generalized Dirichlet distribution).

Related distributions

  • If, for <math>\scriptstyle i\in\{1,2,\ldots,K\},</math>
<math>Y_i\sim\operatorname{Gamma}(\textrm{shape}=\alpha_i,\textrm{scale}=1)\text{ independently},</math>
then
<math>V=\sum_{i=1}^K Y_i\sim\operatorname{Gamma}(\textrm{shape}=\sum_{i=1}^K\alpha_i,\textrm{scale}=1),</math>
and
<math>(X_1,\ldots,X_K) = (Y_1/V,\ldots,Y_K/V)\sim \operatorname{Dir}(\alpha_1,\ldots,\alpha_K).</math>
Though the Xis are not independent from one another, they can be seen to be generated from a set of <math>K</math> independent gamma random variables. Unfortunately, since the sum <math>V</math> is lost in the process of forming X = (X1, ..., XK), it is not possible to recover the original gamma random variables from these values alone. Nevertheless, because independent random variables are simpler to work with, this reparametrization can still be useful for proofs about properties of the Dirichlet distribution.
  • Multinomial opinions in subjective logic are equivalent to Dirichlet distributions.

Random number generation

A method to sample a random vector <math>x=(x_1, \ldots, x_K)</math> from the K-dimensional Dirichlet distribution with parameters <math>(\alpha_1, \ldots, \alpha_K)</math> follows immediately from this connection. First, draw K independent random samples <math>y_1, \ldots, y_K</math> from gamma distributions each with density

<math> \frac{y_i^{\alpha_i-1} \; e^{-y_i}}{\Gamma (\alpha_i)}, \!</math>

and then set

<math>x_i = y_i/\sum_{j=1}^K y_j. \!</math>

Intuitive interpretation of the parameters

One example use of the Dirichlet distribution is if one wanted to cut strings (each of initial length 1.0) into K pieces with different lengths, where each piece had, on average, a designated average length, but allowing some variation in the relative sizes of the pieces. The α/α0 values specify the mean lengths of the cut pieces of string resulting from the distribution. The variance around this mean varies inversely with α0.

See also

External links

References

  1. R. J. Connor and J. E. Mosiman 1969. Concepts of independence for proportions with a generalization of the Dirichlet distibution. Journal of the American Statistical Association, volume 64, pp194--206

Non-Uniform Random Variate Generation, by Luc Devroye http://cg.scs.carleton.ca/~luc/rnbookindex.html

Template:ProbDistributions

it:Variabile casuale di Dirichlet de:Dirichlet-Verteilung