This is the density function and random generation from the Dirichlet distribution.
This is a vector containing a single deviate or matrix containing one random deviate per row. Each vector, or matrix row, must sum to 1.
This is the number of random deviates to generate.
This is a vector or matrix of shape parameters.
Application: Continuous Multivariate
p(theta) = (gamma(alpha + ... + alpha[k]) / (gamma(alpha) ... gamma(alpha[k]))) * theta^(alpha - 1) ... theta[k]^(alpha[k] - 1) theta,...,theta[k] >= 0, (the sum of j=1 to k of) theta[j] = 1
Inventor: Johann Peter Gustav Lejeune Dirichlet (1805-1859)
Notation 1: theta ~ Dirichlet(alpha,..., alpha[k])
Notation 2: p(theta) = Dirichlet(theta | alpha,...,alpha[k])
Notation 3: theta ~ Dir(alpha,..., alpha[k])
Notation 4: p(theta) = Dir(theta | alpha,...,alpha[k])
Parameter: 'prior sample sizes' alpha[j] > 0, alpha = (the sum from j=1 to k of) alpha[j]
Mean: E(theta[j]) = alpha[j] / alpha
Variance: var(theta[j]) = (alpha[j] * (alpha - alpha[j])) / (alpha^2 * (alpha+ 1))
Covariance: cov(theta[i], theta[j]) = - ((alpha[i]*alpha[j]) / (alpha^2 * (alpha + 1)))
Mode: mode(theta[j]) = (alpha[j] - 1) / (alpha - k)
The Dirichlet distribution is the multivariate generalization of the univariate beta distribution. Its probability density function returns the belief that the probabilities of k rival events are theta[j] given that each event has been observed alpha[j] - 1 times.
The Dirichlet distribution is commonly used as a prior distribution in Bayesian inference. The Dirichlet distribution is the conjugate prior distribution for the parameters of the categorical and multinomial distributions.
A very common special case is the symmetric Dirichlet distribution, where all of the elements in parameter vector alpha have the same value. Symmetric Dirichlet distributions are often used as vague or weakly informative Dirichlet prior distributions, so that one component is not favored over another. The single value that is entered into all elements of alpha is called the concentration parameter.
ddirichlet gives the density and
rdirichlet generates random deviates.
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.