- Source: Dirichlet distribution
In probability and statistics, the Dirichlet distribution (after Peter Gustav Lejeune Dirichlet), often denoted
Dir
(
α
)
{\displaystyle \operatorname {Dir} ({\boldsymbol {\alpha }})}
, is a family of continuous multivariate probability distributions parameterized by a vector
α
{\displaystyle {\boldsymbol {\alpha }}}
of positive reals. It is a multivariate generalization of the beta distribution, hence its alternative name of multivariate beta distribution (MBD). Dirichlet distributions are commonly used as prior distributions in Bayesian statistics, and in fact, the Dirichlet distribution is the conjugate prior of the categorical distribution and multinomial distribution.
The infinite-dimensional generalization of the Dirichlet distribution is the Dirichlet process.
Definitions
= Probability density function
=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
f
(
x
1
,
…
,
x
K
;
α
1
,
…
,
α
K
)
=
1
B
(
α
)
∏
i
=
1
K
x
i
α
i
−
1
{\displaystyle f\left(x_{1},\ldots ,x_{K};\alpha _{1},\ldots ,\alpha _{K}\right)={\frac {1}{\mathrm {B} ({\boldsymbol {\alpha }})}}\prod _{i=1}^{K}x_{i}^{\alpha _{i}-1}}
where
{
x
k
}
k
=
1
k
=
K
{\displaystyle \{x_{k}\}_{k=1}^{k=K}}
belong to the standard
K
−
1
{\displaystyle K-1}
simplex, or in other words:
∑
i
=
1
K
x
i
=
1
and
x
i
∈
[
0
,
1
]
for all
i
∈
{
1
,
…
,
K
}
{\displaystyle \sum _{i=1}^{K}x_{i}=1{\mbox{ and }}x_{i}\in \left[0,1\right]{\mbox{ for all }}i\in \{1,\dots ,K\}}
The normalizing constant is the multivariate beta function, which can be expressed in terms of the gamma function:
B
(
α
)
=
∏
i
=
1
K
Γ
(
α
i
)
Γ
(
∑
i
=
1
K
α
i
)
,
α
=
(
α
1
,
…
,
α
K
)
.
{\displaystyle \mathrm {B} ({\boldsymbol {\alpha }})={\frac {\prod \limits _{i=1}^{K}\Gamma (\alpha _{i})}{\Gamma \left(\sum \limits _{i=1}^{K}\alpha _{i}\right)}},\qquad {\boldsymbol {\alpha }}=(\alpha _{1},\ldots ,\alpha _{K}).}
= Support
=The support of the Dirichlet distribution is the set of K-dimensional vectors
x
{\displaystyle {\boldsymbol {x}}}
whose entries are real numbers in the interval [0,1] such that
‖
x
‖
1
=
1
{\displaystyle \|{\boldsymbol {x}}\|_{1}=1}
, i.e. the sum of the coordinates is equal to 1. These can be viewed as the probabilities of a K-way categorical event. Another way to express this is that the domain of the Dirichlet distribution is itself a set of probability distributions, specifically the set of K-dimensional discrete distributions. The technical term for the set of points in the support of a K-dimensional Dirichlet distribution is the open standard (K − 1)-simplex, which is a generalization of a triangle, embedded in the next-higher dimension. For example, with K = 3, the support is an equilateral triangle embedded in a downward-angle fashion in three-dimensional space, with vertices at (1,0,0), (0,1,0) and (0,0,1), i.e. touching each of the coordinate axes at a point 1 unit away from the origin.
= Special cases
=A common special case is the symmetric Dirichlet distribution, where all of the elements making up the parameter vector
α
{\displaystyle {\boldsymbol {\alpha }}}
have the same value. The symmetric case might be useful, for example, when a Dirichlet prior over components is called for, but there is no prior knowledge favoring one component over another. Since all elements of the parameter vector have the same value, the symmetric Dirichlet distribution can be parametrized by a single scalar value α, called the concentration parameter. In terms of α, the density function has the form
f
(
x
1
,
…
,
x
K
;
α
)
=
Γ
(
α
K
)
Γ
(
α
)
K
∏
i
=
1
K
x
i
α
−
1
.
{\displaystyle f(x_{1},\dots ,x_{K};\alpha )={\frac {\Gamma (\alpha K)}{\Gamma (\alpha )^{K}}}\prod _{i=1}^{K}x_{i}^{\alpha -1}.}
When α=1[1], the symmetric Dirichlet distribution is equivalent to a uniform distribution over the open standard (K − 1)-simplex, i.e. it is uniform over all points in its support. This particular distribution is known as the flat Dirichlet distribution. Values of the concentration parameter above 1 prefer variates that are dense, evenly distributed distributions, i.e. all the values within a single sample are similar to each other. Values of the concentration parameter below 1 prefer sparse distributions, i.e. most of the values within a single sample will be close to 0, and the vast majority of the mass will be concentrated in a few of the values.
More generally, the parameter vector is sometimes written as the product
α
n
{\displaystyle \alpha {\boldsymbol {n}}}
of a (scalar) concentration parameter α and a (vector) base measure
n
=
(
n
1
,
…
,
n
K
)
{\displaystyle {\boldsymbol {n}}=(n_{1},\dots ,n_{K})}
where
n
{\displaystyle {\boldsymbol {n}}}
lies within the (K − 1)-simplex (i.e.: its coordinates
n
i
{\displaystyle n_{i}}
sum to one). The concentration parameter in this case is larger by a factor of K than the concentration parameter for a symmetric Dirichlet distribution described above. This construction ties in with concept of a base measure when discussing Dirichlet processes and is often used in the topic modelling literature.
Properties
= Moments
=Let
X
=
(
X
1
,
…
,
X
K
)
∼
Dir
(
α
)
{\displaystyle X=(X_{1},\ldots ,X_{K})\sim \operatorname {Dir} ({\boldsymbol {\alpha }})}
.
Let
α
0
=
∑
i
=
1
K
α
i
.
{\displaystyle \alpha _{0}=\sum _{i=1}^{K}\alpha _{i}.}
Then
E
[
X
i
]
=
α
i
α
0
,
{\displaystyle \operatorname {E} [X_{i}]={\frac {\alpha _{i}}{\alpha _{0}}},}
Var
[
X
i
]
=
α
i
(
α
0
−
α
i
)
α
0
2
(
α
0
+
1
)
.
{\displaystyle \operatorname {Var} [X_{i}]={\frac {\alpha _{i}(\alpha _{0}-\alpha _{i})}{\alpha _{0}^{2}(\alpha _{0}+1)}}.}
Furthermore, if
i
≠
j
{\displaystyle i\neq j}
Cov
[
X
i
,
X
j
]
=
−
α
i
α
j
α
0
2
(
α
0
+
1
)
.
{\displaystyle \operatorname {Cov} [X_{i},X_{j}]={\frac {-\alpha _{i}\alpha _{j}}{\alpha _{0}^{2}(\alpha _{0}+1)}}.}
The matrix is thus singular.
More generally, moments of Dirichlet-distributed random variables can be expressed in the following way. For
t
=
(
t
1
,
…
,
t
K
)
∈
R
K
{\displaystyle {\boldsymbol {t}}=(t_{1},\dotsc ,t_{K})\in \mathbb {R} ^{K}}
, denote by
t
∘
i
=
(
t
1
i
,
…
,
t
K
i
)
{\displaystyle {\boldsymbol {t}}^{\circ i}=(t_{1}^{i},\dotsc ,t_{K}^{i})}
its
i
{\displaystyle i}
-th Hadamard power. Then,
E
[
(
t
⋅
X
)
n
]
=
n
!
Γ
(
α
0
)
Γ
(
α
0
+
n
)
∑
t
1
k
1
⋯
t
K
k
K
k
1
!
⋯
k
K
!
∏
i
=
1
K
Γ
(
α
i
+
k
i
)
Γ
(
α
i
)
=
n
!
Γ
(
α
0
)
Γ
(
α
0
+
n
)
Z
n
(
t
∘
1
⋅
α
,
⋯
,
t
∘
n
⋅
α
)
,
{\displaystyle \operatorname {E} \left[({\boldsymbol {t}}\cdot {\boldsymbol {X}})^{n}\right]={\frac {n!\,\Gamma (\alpha _{0})}{\Gamma (\alpha _{0}+n)}}\sum {\frac {{t_{1}}^{k_{1}}\cdots {t_{K}}^{k_{K}}}{k_{1}!\cdots k_{K}!}}\prod _{i=1}^{K}{\frac {\Gamma (\alpha _{i}+k_{i})}{\Gamma (\alpha _{i})}}={\frac {n!\,\Gamma (\alpha _{0})}{\Gamma (\alpha _{0}+n)}}Z_{n}({\boldsymbol {t}}^{\circ 1}\cdot {\boldsymbol {\alpha }},\cdots ,{\boldsymbol {t}}^{\circ n}\cdot {\boldsymbol {\alpha }}),}
where the sum is over non-negative integers
k
1
,
…
,
k
K
{\displaystyle k_{1},\ldots ,k_{K}}
with
n
=
k
1
+
⋯
+
k
K
{\displaystyle n=k_{1}+\cdots +k_{K}}
, and
Z
n
{\displaystyle Z_{n}}
is the cycle index polynomial of the Symmetric group of degree
n
{\displaystyle n}
.
The multivariate analogue
E
[
(
t
1
⋅
X
)
n
1
⋯
(
t
q
⋅
X
)
n
q
]
{\textstyle \operatorname {E} \left[({\boldsymbol {t}}_{1}\cdot {\boldsymbol {X}})^{n_{1}}\cdots ({\boldsymbol {t}}_{q}\cdot {\boldsymbol {X}})^{n_{q}}\right]}
for vectors
t
1
,
…
,
t
q
∈
R
K
{\displaystyle {\boldsymbol {t}}_{1},\dotsc ,{\boldsymbol {t}}_{q}\in \mathbb {R} ^{K}}
can be expressed in terms of a color pattern of the exponents
n
1
,
…
,
n
q
{\displaystyle n_{1},\dotsc ,n_{q}}
in the sense of Pólya enumeration theorem.
Particular cases include the simple computation
E
[
∏
i
=
1
K
X
i
β
i
]
=
B
(
α
+
β
)
B
(
α
)
=
Γ
(
∑
i
=
1
K
α
i
)
Γ
[
∑
i
=
1
K
(
α
i
+
β
i
)
]
×
∏
i
=
1
K
Γ
(
α
i
+
β
i
)
Γ
(
α
i
)
.
{\displaystyle \operatorname {E} \left[\prod _{i=1}^{K}X_{i}^{\beta _{i}}\right]={\frac {B\left({\boldsymbol {\alpha }}+{\boldsymbol {\beta }}\right)}{B\left({\boldsymbol {\alpha }}\right)}}={\frac {\Gamma \left(\sum \limits _{i=1}^{K}\alpha _{i}\right)}{\Gamma \left[\sum \limits _{i=1}^{K}(\alpha _{i}+\beta _{i})\right]}}\times \prod _{i=1}^{K}{\frac {\Gamma (\alpha _{i}+\beta _{i})}{\Gamma (\alpha _{i})}}.}
= Mode
=The mode of the distribution is the vector (x1, ..., xK) with
x
i
=
α
i
−
1
α
0
−
K
,
α
i
>
1.
{\displaystyle x_{i}={\frac {\alpha _{i}-1}{\alpha _{0}-K}},\qquad \alpha _{i}>1.}
= Marginal distributions
=The marginal distributions are beta distributions:
X
i
∼
Beta
(
α
i
,
α
0
−
α
i
)
.
{\displaystyle X_{i}\sim \operatorname {Beta} (\alpha _{i},\alpha _{0}-\alpha _{i}).}
= Conjugate to categorical or multinomial
=The Dirichlet distribution is the conjugate prior distribution of the categorical distribution (a generic discrete probability distribution with a given number of possible outcomes) and multinomial distribution (the distribution over observed counts of each possible category in a set of categorically distributed observations). This means that if a data point has either a categorical or multinomial distribution, and the prior distribution of the distribution's parameter (the vector of probabilities that generates the data point) is distributed as a Dirichlet, then the posterior distribution of the parameter is also a Dirichlet. Intuitively, in such a case, starting from what we know about the parameter prior to observing the data point, we then can update our knowledge based on the data point and end up with a new distribution of the same form as the old one. This means that we can successively update our knowledge of a parameter by incorporating new observations one at a time, without running into mathematical difficulties.
Formally, this can be expressed as follows. Given a model
α
=
(
α
1
,
…
,
α
K
)
=
concentration hyperparameter
p
∣
α
=
(
p
1
,
…
,
p
K
)
∼
Dir
(
K
,
α
)
X
∣
p
=
(
x
1
,
…
,
x
K
)
∼
Cat
(
K
,
p
)
{\displaystyle {\begin{array}{rcccl}{\boldsymbol {\alpha }}&=&\left(\alpha _{1},\ldots ,\alpha _{K}\right)&=&{\text{concentration hyperparameter}}\\\mathbf {p} \mid {\boldsymbol {\alpha }}&=&\left(p_{1},\ldots ,p_{K}\right)&\sim &\operatorname {Dir} (K,{\boldsymbol {\alpha }})\\\mathbb {X} \mid \mathbf {p} &=&\left(\mathbf {x} _{1},\ldots ,\mathbf {x} _{K}\right)&\sim &\operatorname {Cat} (K,\mathbf {p} )\end{array}}}
then the following holds:
c
=
(
c
1
,
…
,
c
K
)
=
number of occurrences of category
i
p
∣
X
,
α
∼
Dir
(
K
,
c
+
α
)
=
Dir
(
K
,
c
1
+
α
1
,
…
,
c
K
+
α
K
)
{\displaystyle {\begin{array}{rcccl}\mathbf {c} &=&\left(c_{1},\ldots ,c_{K}\right)&=&{\text{number of occurrences of category }}i\\\mathbf {p} \mid \mathbb {X} ,{\boldsymbol {\alpha }}&\sim &\operatorname {Dir} (K,\mathbf {c} +{\boldsymbol {\alpha }})&=&\operatorname {Dir} \left(K,c_{1}+\alpha _{1},\ldots ,c_{K}+\alpha _{K}\right)\end{array}}}
This relationship is used in Bayesian statistics to estimate the underlying parameter p of a categorical distribution given a collection of N samples. Intuitively, we can view the hyperprior vector α as pseudocounts, i.e. as representing the number of observations in each category that we have already seen. Then we simply add in the counts for all the new observations (the vector c) in order to derive the posterior distribution.
In Bayesian mixture models and other hierarchical Bayesian models with mixture components, Dirichlet distributions are commonly used as the prior distributions for the categorical variables appearing in the models. See the section on applications below for more information.
= Relation to Dirichlet-multinomial distribution
=In a model where a Dirichlet prior distribution is placed over a set of categorical-valued observations, the marginal joint distribution of the observations (i.e. the joint distribution of the observations, with the prior parameter marginalized out) is a Dirichlet-multinomial distribution. This distribution plays an important role in hierarchical Bayesian models, because when doing inference over such models using methods such as Gibbs sampling or variational Bayes, Dirichlet prior distributions are often marginalized out. See the article on this distribution for more details.
= Entropy
=If X is a
Dir
(
α
)
{\displaystyle \operatorname {Dir} ({\boldsymbol {\alpha }})}
random variable, the differential entropy of X (in nat units) is
h
(
X
)
=
E
[
−
ln
f
(
X
)
]
=
ln
B
(
α
)
+
(
α
0
−
K
)
ψ
(
α
0
)
−
∑
j
=
1
K
(
α
j
−
1
)
ψ
(
α
j
)
{\displaystyle h({\boldsymbol {X}})=\operatorname {E} [-\ln f({\boldsymbol {X}})]=\ln \operatorname {B} ({\boldsymbol {\alpha }})+(\alpha _{0}-K)\psi (\alpha _{0})-\sum _{j=1}^{K}(\alpha _{j}-1)\psi (\alpha _{j})}
where
ψ
{\displaystyle \psi }
is the digamma function.
The following formula for
E
[
ln
(
X
i
)
]
{\displaystyle \operatorname {E} [\ln(X_{i})]}
can be used to derive the differential entropy above. Since the functions
ln
(
X
i
)
{\displaystyle \ln(X_{i})}
are the sufficient statistics of the Dirichlet distribution, the exponential family differential identities can be used to get an analytic expression for the expectation of
ln
(
X
i
)
{\displaystyle \ln(X_{i})}
(see equation (2.62) in ) and its associated covariance matrix:
E
[
ln
(
X
i
)
]
=
ψ
(
α
i
)
−
ψ
(
α
0
)
{\displaystyle \operatorname {E} [\ln(X_{i})]=\psi (\alpha _{i})-\psi (\alpha _{0})}
and
Cov
[
ln
(
X
i
)
,
ln
(
X
j
)
]
=
ψ
′
(
α
i
)
δ
i
j
−
ψ
′
(
α
0
)
{\displaystyle \operatorname {Cov} [\ln(X_{i}),\ln(X_{j})]=\psi '(\alpha _{i})\delta _{ij}-\psi '(\alpha _{0})}
where
ψ
{\displaystyle \psi }
is the digamma function,
ψ
′
{\displaystyle \psi '}
is the trigamma function, and
δ
i
j
{\displaystyle \delta _{ij}}
is the Kronecker delta.
The spectrum of Rényi information for values other than
λ
=
1
{\displaystyle \lambda =1}
is given by
F
R
(
λ
)
=
(
1
−
λ
)
−
1
(
−
λ
log
B
(
α
)
+
∑
i
=
1
K
log
Γ
(
λ
(
α
i
−
1
)
+
1
)
−
log
Γ
(
λ
(
α
0
−
K
)
+
K
)
)
{\displaystyle F_{R}(\lambda )=(1-\lambda )^{-1}\left(-\lambda \log \mathrm {B} ({\boldsymbol {\alpha }})+\sum _{i=1}^{K}\log \Gamma (\lambda (\alpha _{i}-1)+1)-\log \Gamma (\lambda (\alpha _{0}-K)+K)\right)}
and the information entropy is the limit as
λ
{\displaystyle \lambda }
goes to 1.
Another related interesting measure is the entropy of a discrete categorical (one-of-K binary) vector
Z
{\displaystyle {\boldsymbol {Z}}}
with probability-mass distribution
X
{\displaystyle {\boldsymbol {X}}}
, i.e.,
P
(
Z
i
=
1
,
Z
j
≠
i
=
0
|
X
)
=
X
i
{\displaystyle P(Z_{i}=1,Z_{j\neq i}=0|{\boldsymbol {X}})=X_{i}}
. The conditional information entropy of
Z
{\displaystyle {\boldsymbol {Z}}}
, given
X
{\displaystyle {\boldsymbol {X}}}
is
S
(
X
)
=
H
(
Z
|
X
)
=
E
Z
[
−
log
P
(
Z
|
X
)
]
=
∑
i
=
1
K
−
X
i
log
X
i
{\displaystyle S({\boldsymbol {X}})=H({\boldsymbol {Z}}|{\boldsymbol {X}})=\operatorname {E} _{\boldsymbol {Z}}[-\log P({\boldsymbol {Z}}|{\boldsymbol {X}})]=\sum _{i=1}^{K}-X_{i}\log X_{i}}
This function of
X
{\displaystyle {\boldsymbol {X}}}
is a scalar random variable. If
X
{\displaystyle {\boldsymbol {X}}}
has a symmetric Dirichlet distribution with all
α
i
=
α
{\displaystyle \alpha _{i}=\alpha }
, the expected value of the entropy (in nat units) is
E
[
S
(
X
)
]
=
∑
i
=
1
K
E
[
−
X
i
ln
X
i
]
=
ψ
(
K
α
+
1
)
−
ψ
(
α
+
1
)
{\displaystyle \operatorname {E} [S({\boldsymbol {X}})]=\sum _{i=1}^{K}\operatorname {E} [-X_{i}\ln X_{i}]=\psi (K\alpha +1)-\psi (\alpha +1)}
= Aggregation
=If
X
=
(
X
1
,
…
,
X
K
)
∼
Dir
(
α
1
,
…
,
α
K
)
{\displaystyle X=(X_{1},\ldots ,X_{K})\sim \operatorname {Dir} (\alpha _{1},\ldots ,\alpha _{K})}
then, if the random variables with subscripts i and j are dropped from the vector and replaced by their sum,
X
′
=
(
X
1
,
…
,
X
i
+
X
j
,
…
,
X
K
)
∼
Dir
(
α
1
,
…
,
α
i
+
α
j
,
…
,
α
K
)
.
{\displaystyle X'=(X_{1},\ldots ,X_{i}+X_{j},\ldots ,X_{K})\sim \operatorname {Dir} (\alpha _{1},\ldots ,\alpha _{i}+\alpha _{j},\ldots ,\alpha _{K}).}
This aggregation property may be used to derive the marginal distribution of
X
i
{\displaystyle X_{i}}
mentioned above.
= Neutrality
=If
X
=
(
X
1
,
…
,
X
K
)
∼
Dir
(
α
)
{\displaystyle X=(X_{1},\ldots ,X_{K})\sim \operatorname {Dir} ({\boldsymbol {\alpha }})}
, then the vector X is said to be neutral in the sense that XK is independent of
X
(
−
K
)
{\displaystyle X^{(-K)}}
where
X
(
−
K
)
=
(
X
1
1
−
X
K
,
X
2
1
−
X
K
,
…
,
X
K
−
1
1
−
X
K
)
,
{\displaystyle X^{(-K)}=\left({\frac {X_{1}}{1-X_{K}}},{\frac {X_{2}}{1-X_{K}}},\ldots ,{\frac {X_{K-1}}{1-X_{K}}}\right),}
and similarly for removing any of
X
2
,
…
,
X
K
−
1
{\displaystyle X_{2},\ldots ,X_{K-1}}
. Observe that any permutation of X is also neutral (a property not possessed by samples drawn from a generalized Dirichlet distribution).
Combining this with the property of aggregation it follows that Xj + ... + XK is independent of
(
X
1
X
1
+
⋯
+
X
j
−
1
,
X
2
X
1
+
⋯
+
X
j
−
1
,
…
,
X
j
−
1
X
1
+
⋯
+
X
j
−
1
)
{\displaystyle \left({\frac {X_{1}}{X_{1}+\cdots +X_{j-1}}},{\frac {X_{2}}{X_{1}+\cdots +X_{j-1}}},\ldots ,{\frac {X_{j-1}}{X_{1}+\cdots +X_{j-1}}}\right)}
. In fact it is true, further, for the Dirichlet distribution, that for
3
≤
j
≤
K
−
1
{\displaystyle 3\leq j\leq K-1}
, the pair
(
X
1
+
⋯
+
X
j
−
1
,
X
j
+
⋯
+
X
K
)
{\displaystyle \left(X_{1}+\cdots +X_{j-1},X_{j}+\cdots +X_{K}\right)}
, and the two vectors
(
X
1
X
1
+
⋯
+
X
j
−
1
,
X
2
X
1
+
⋯
+
X
j
−
1
,
…
,
X
j
−
1
X
1
+
⋯
+
X
j
−
1
)
{\displaystyle \left({\frac {X_{1}}{X_{1}+\cdots +X_{j-1}}},{\frac {X_{2}}{X_{1}+\cdots +X_{j-1}}},\ldots ,{\frac {X_{j-1}}{X_{1}+\cdots +X_{j-1}}}\right)}
and
(
X
j
X
j
+
⋯
+
X
K
,
X
j
+
1
X
j
+
⋯
+
X
K
,
…
,
X
K
X
j
+
⋯
+
X
K
)
{\displaystyle \left({\frac {X_{j}}{X_{j}+\cdots +X_{K}}},{\frac {X_{j+1}}{X_{j}+\cdots +X_{K}}},\ldots ,{\frac {X_{K}}{X_{j}+\cdots +X_{K}}}\right)}
, viewed as triple of normalised random vectors, are mutually independent. The analogous result is true for partition of the indices {1,2,...,K} into any other pair of non-singleton subsets.
= Characteristic function
=The characteristic function of the Dirichlet distribution is a confluent form of the Lauricella hypergeometric series. It is given by Phillips as
C
F
(
s
1
,
…
,
s
K
−
1
)
=
E
(
e
i
(
s
1
X
1
+
⋯
+
s
K
−
1
X
K
−
1
)
)
=
Ψ
[
K
−
1
]
(
α
1
,
…
,
α
K
−
1
;
α
0
;
i
s
1
,
…
,
i
s
K
−
1
)
{\displaystyle CF\left(s_{1},\ldots ,s_{K-1}\right)=\operatorname {E} \left(e^{i\left(s_{1}X_{1}+\cdots +s_{K-1}X_{K-1}\right)}\right)=\Psi ^{\left[K-1\right]}(\alpha _{1},\ldots ,\alpha _{K-1};\alpha _{0};is_{1},\ldots ,is_{K-1})}
where
Ψ
[
m
]
(
a
1
,
…
,
a
m
;
c
;
z
1
,
…
z
m
)
=
∑
(
a
1
)
k
1
⋯
(
a
m
)
k
m
z
1
k
1
⋯
z
m
k
m
(
c
)
k
k
1
!
⋯
k
m
!
.
{\displaystyle \Psi ^{[m]}(a_{1},\ldots ,a_{m};c;z_{1},\ldots z_{m})=\sum {\frac {(a_{1})_{k_{1}}\cdots (a_{m})_{k_{m}}\,z_{1}^{k_{1}}\cdots z_{m}^{k_{m}}}{(c)_{k}\,k_{1}!\cdots k_{m}!}}.}
The sum is over non-negative integers
k
1
,
…
,
k
m
{\displaystyle k_{1},\ldots ,k_{m}}
and
k
=
k
1
+
⋯
+
k
m
{\displaystyle k=k_{1}+\cdots +k_{m}}
. Phillips goes on to state that this form is "inconvenient for numerical calculation" and gives an alternative in terms of a complex path integral:
Ψ
[
m
]
=
Γ
(
c
)
2
π
i
∫
L
e
t
t
a
1
+
⋯
+
a
m
−
c
∏
j
=
1
m
(
t
−
z
j
)
−
a
j
d
t
{\displaystyle \Psi ^{[m]}={\frac {\Gamma (c)}{2\pi i}}\int _{L}e^{t}\,t^{a_{1}+\cdots +a_{m}-c}\,\prod _{j=1}^{m}(t-z_{j})^{-a_{j}}\,dt}
where L denotes any path in the complex plane originating at
−
∞
{\displaystyle -\infty }
, encircling in the positive direction all the singularities of the integrand and returning to
−
∞
{\displaystyle -\infty }
.
= Inequality
=Probability density function
f
(
x
1
,
…
,
x
K
−
1
;
α
1
,
…
,
α
K
)
{\displaystyle f\left(x_{1},\ldots ,x_{K-1};\alpha _{1},\ldots ,\alpha _{K}\right)}
plays a key role in a multifunctional inequality which implies various bounds for the Dirichlet distribution.
Related distributions
For K independently distributed Gamma distributions:
Y
1
∼
Gamma
(
α
1
,
θ
)
,
…
,
Y
K
∼
Gamma
(
α
K
,
θ
)
{\displaystyle Y_{1}\sim \operatorname {Gamma} (\alpha _{1},\theta ),\ldots ,Y_{K}\sim \operatorname {Gamma} (\alpha _{K},\theta )}
we have:: 402
V
=
∑
i
=
1
K
Y
i
∼
Gamma
(
α
0
,
θ
)
,
{\displaystyle V=\sum _{i=1}^{K}Y_{i}\sim \operatorname {Gamma} \left(\alpha _{0},\theta \right),}
X
=
(
X
1
,
…
,
X
K
)
=
(
Y
1
V
,
…
,
Y
K
V
)
∼
Dir
(
α
1
,
…
,
α
K
)
.
{\displaystyle X=(X_{1},\ldots ,X_{K})=\left({\frac {Y_{1}}{V}},\ldots ,{\frac {Y_{K}}{V}}\right)\sim \operatorname {Dir} \left(\alpha _{1},\ldots ,\alpha _{K}\right).}
Although the Xis are not independent from one another, they can be seen to be generated from a set of K independent gamma random variable.: 594 Unfortunately, since the sum V is lost in forming X (in fact it can be shown that V is stochastically independent of X), 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.
= Conjugate prior of the Dirichlet distribution
=Because the Dirichlet distribution is an exponential family distribution it has a conjugate prior.
The conjugate prior is of the form:
CD
(
α
∣
v
,
η
)
∝
(
1
B
(
α
)
)
η
exp
(
−
∑
k
v
k
α
k
)
.
{\displaystyle \operatorname {CD} ({\boldsymbol {\alpha }}\mid {\boldsymbol {v}},\eta )\propto \left({\frac {1}{\operatorname {B} ({\boldsymbol {\alpha }})}}\right)^{\eta }\exp \left(-\sum _{k}v_{k}\alpha _{k}\right).}
Here
v
{\displaystyle {\boldsymbol {v}}}
is a K-dimensional real vector and
η
{\displaystyle \eta }
is a scalar parameter. The domain of
(
v
,
η
)
{\displaystyle ({\boldsymbol {v}},\eta )}
is restricted to the set of parameters for which the above unnormalized density function can be normalized. The (necessary and sufficient) condition is:
∀
k
v
k
>
0
and
η
>
−
1
and
(
η
≤
0
or
∑
k
exp
−
v
k
η
<
1
)
{\displaystyle \forall k\;\;v_{k}>0\;\;\;\;{\text{ and }}\;\;\;\;\eta >-1\;\;\;\;{\text{ and }}\;\;\;\;(\eta \leq 0\;\;\;\;{\text{ or }}\;\;\;\;\sum _{k}\exp -{\frac {v_{k}}{\eta }}<1)}
The conjugation property can be expressed as
if [prior:
α
∼
CD
(
⋅
∣
v
,
η
)
{\displaystyle {\boldsymbol {\alpha }}\sim \operatorname {CD} (\cdot \mid {\boldsymbol {v}},\eta )}
] and [observation:
x
∣
α
∼
Dirichlet
(
⋅
∣
α
)
{\displaystyle {\boldsymbol {x}}\mid {\boldsymbol {\alpha }}\sim \operatorname {Dirichlet} (\cdot \mid {\boldsymbol {\alpha }})}
] then [posterior:
α
∣
x
∼
CD
(
⋅
∣
v
−
log
x
,
η
+
1
)
{\displaystyle {\boldsymbol {\alpha }}\mid {\boldsymbol {x}}\sim \operatorname {CD} (\cdot \mid {\boldsymbol {v}}-\log {\boldsymbol {x}},\eta +1)}
].
In the published literature there is no practical algorithm to efficiently generate samples from
CD
(
α
∣
v
,
η
)
{\displaystyle \operatorname {CD} ({\boldsymbol {\alpha }}\mid {\boldsymbol {v}},\eta )}
.
Occurrence and applications
= Bayesian models
=Dirichlet distributions are most commonly used as the prior distribution of categorical variables or multinomial variables in Bayesian mixture models and other hierarchical Bayesian models. (In many fields, such as in natural language processing, categorical variables are often imprecisely called "multinomial variables". Such a usage is unlikely to cause confusion, just as when Bernoulli distributions and binomial distributions are commonly conflated.)
Inference over hierarchical Bayesian models is often done using Gibbs sampling, and in such a case, instances of the Dirichlet distribution are typically marginalized out of the model by integrating out the Dirichlet random variable. This causes the various categorical variables drawn from the same Dirichlet random variable to become correlated, and the joint distribution over them assumes a Dirichlet-multinomial distribution, conditioned on the hyperparameters of the Dirichlet distribution (the concentration parameters). One of the reasons for doing this is that Gibbs sampling of the Dirichlet-multinomial distribution is extremely easy; see that article for more information.
= Intuitive interpretations of the parameters
=The concentration parameter
Dirichlet distributions are very often used as prior distributions in Bayesian inference. The simplest and perhaps most common type of Dirichlet prior is the symmetric Dirichlet distribution, where all parameters are equal. This corresponds to the case where you have no prior information to favor one component over any other. As described above, the single value α to which all parameters are set is called the concentration parameter. If the sample space of the Dirichlet distribution is interpreted as a discrete probability distribution, then intuitively the concentration parameter can be thought of as determining how "concentrated" the probability mass of the Dirichlet distribution to its center, leading to samples with mass dispersed almost equally among all components, i.e., with a value much less than 1, the mass will be highly concentrated in a few components, and all the rest will have almost no mass, and with a value much greater than 1, the mass will be dispersed almost equally among all the components. See the article on the concentration parameter for further discussion.
String cutting
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 a designated average length, but allowing some variation in the relative sizes of the pieces. Recall that
α
0
=
∑
i
=
1
K
α
i
.
{\displaystyle \alpha _{0}=\sum _{i=1}^{K}\alpha _{i}.}
The
α
i
/
α
0
{\displaystyle \alpha _{i}/\alpha _{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
{\displaystyle \alpha _{0}}
.
Pólya's urn
Consider an urn containing balls of K different colors. Initially, the urn contains α1 balls of color 1, α2 balls of color 2, and so on. Now perform N draws from the urn, where after each draw, the ball is placed back into the urn with an additional ball of the same color. In the limit as N approaches infinity, the proportions of different colored balls in the urn will be distributed as Dir(α1,...,αK).
For a formal proof, note that the proportions of the different colored balls form a bounded [0,1]K-valued martingale, hence by the martingale convergence theorem, these proportions converge almost surely and in mean to a limiting random vector. To see that this limiting vector has the above Dirichlet distribution, check that all mixed moments agree.
Each draw from the urn modifies the probability of drawing a ball of any one color from the urn in the future. This modification diminishes with the number of draws, since the relative effect of adding a new ball to the urn diminishes as the urn accumulates increasing numbers of balls.
Random variate generation
= From gamma distribution
=With a source of Gamma-distributed random variates, one can easily sample a random vector
x
=
(
x
1
,
…
,
x
K
)
{\displaystyle x=(x_{1},\ldots ,x_{K})}
from the K-dimensional Dirichlet distribution with parameters
(
α
1
,
…
,
α
K
)
{\displaystyle (\alpha _{1},\ldots ,\alpha _{K})}
. First, draw K independent random samples
y
1
,
…
,
y
K
{\displaystyle y_{1},\ldots ,y_{K}}
from Gamma distributions each with density
Gamma
(
α
i
,
1
)
=
y
i
α
i
−
1
e
−
y
i
Γ
(
α
i
)
,
{\displaystyle \operatorname {Gamma} (\alpha _{i},1)={\frac {y_{i}^{\alpha _{i}-1}\;e^{-y_{i}}}{\Gamma (\alpha _{i})}},\!}
and then set
x
i
=
y
i
∑
j
=
1
K
y
j
.
{\displaystyle x_{i}={\frac {y_{i}}{\sum _{j=1}^{K}y_{j}}}.}
Below is example Python code to draw the sample:
This formulation is correct regardless of how the Gamma distributions are parameterized (shape/scale vs. shape/rate) because they are equivalent when scale and rate equal 1.0.
= From marginal beta distributions
=A less efficient algorithm relies on the univariate marginal and conditional distributions being beta and proceeds as follows. Simulate
x
1
{\displaystyle x_{1}}
from
Beta
(
α
1
,
∑
i
=
2
K
α
i
)
{\displaystyle {\textrm {Beta}}\left(\alpha _{1},\sum _{i=2}^{K}\alpha _{i}\right)}
Then simulate
x
2
,
…
,
x
K
−
1
{\displaystyle x_{2},\ldots ,x_{K-1}}
in order, as follows. For
j
=
2
,
…
,
K
−
1
{\displaystyle j=2,\ldots ,K-1}
, simulate
ϕ
j
{\displaystyle \phi _{j}}
from
Beta
(
α
j
,
∑
i
=
j
+
1
K
α
i
)
,
{\displaystyle {\textrm {Beta}}\left(\alpha _{j},\sum _{i=j+1}^{K}\alpha _{i}\right),}
and let
x
j
=
(
1
−
∑
i
=
1
j
−
1
x
i
)
ϕ
j
.
{\displaystyle x_{j}=\left(1-\sum _{i=1}^{j-1}x_{i}\right)\phi _{j}.}
Finally, set
x
K
=
1
−
∑
i
=
1
K
−
1
x
i
.
{\displaystyle x_{K}=1-\sum _{i=1}^{K-1}x_{i}.}
This iterative procedure corresponds closely to the "string cutting" intuition described above.
Below is example Python code to draw the sample:
= When each alpha is 1
=When α1 = ... = αK = 1, a sample from the distribution can be found by randomly drawing a set of K − 1 values independently and uniformly from the interval [0, 1], adding the values 0 and 1 to the set to make it have K + 1 values, sorting the set, and computing the difference between each pair of order-adjacent values, to give x1, ..., xK.
= When each alpha is 1/2 and relationship to the hypersphere
=When α1 = ... = αK = 1/2, a sample from the distribution can be found by randomly drawing K values independently from the standard normal distribution, squaring these values, and normalizing them by dividing by their sum, to give x1, ..., xK.
A point (x1, ..., xK) can be drawn uniformly at random from the (K−1)-dimensional hypersphere (which is the surface of a K-dimensional hyperball) via a similar procedure. Randomly draw K values independently from the standard normal distribution and normalize these coordinate values by dividing each by the constant that is the square root of the sum of their squares.
See also
Generalized Dirichlet distribution
Grouped Dirichlet distribution
Inverted Dirichlet distribution
Latent Dirichlet allocation
Dirichlet process
Matrix variate Dirichlet distribution
References
External links
"Dirichlet distribution", Encyclopedia of Mathematics, EMS Press, 2001 [1994]
Dirichlet Distribution
How to estimate the parameters of the compound Dirichlet distribution (Pólya distribution) using expectation-maximization (EM)
Luc Devroye. "Non-Uniform Random Variate Generation". Retrieved 19 October 2019.
Dirichlet Random Measures, Method of Construction via Compound Poisson Random Variables, and Exchangeability Properties of the resulting Gamma Distribution
SciencesPo: R package that contains functions for simulating parameters of the Dirichlet distribution.
Kata Kunci Pencarian:
- Teori bilangan analitik
- Fungsi zeta Riemann
- Statistika nonparametrik
- Hipotesis Riemann
- Terence Tao
- Teorema bilangan prima
- Buku ilmu antik
- Dirichlet distribution
- Dirichlet-multinomial distribution
- Categorical distribution
- Generalized Dirichlet distribution
- Dirichlet process
- Beta distribution
- Grouped Dirichlet distribution
- Beta-binomial distribution
- Poisson-Dirichlet distribution
- Latent Dirichlet allocation