Multivariate distribution

Dirichlet distribution

A random vector of proportions that add to 1: the topic mix of a document, the market shares of firms, an unknown set of category probabilities. It is the conjugate prior for the categorical and multinomial: after observing counts the posterior is Dirichlet(). With it is the beta. The plot shows over the first two proportions; the third is , so the density lives on the triangle.

Joint density of (X₁, X₂)

00.20.40.60.8100.20.40.60.81x₁x₂mean (0.2222, 0.3333)

E[X₁] = 0.2222 · E[X₂] = 0.3333 · Var X₁ = 0.01728 · Var X₂ = 0.02222 · Cov = −0.007407 · corr = −0.378

Formulas

Parameters
  • , the concentrations; write
Support
PDF
CDF
Mean
Variance
Mode
Entropy

Each coordinate on its own is Beta. Small s (below 1) push the mass to the corners, sparse mixtures; large ones concentrate it near the mean.

Worked example

Topic proportions for a document follow Dirichlet(2, 3, 4). What are the mean and variance of the first topic's share?

, so and 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.dirichlet(alpha=[2, 3, 4])
X.pdf([0.2, 0.3, 0.5])  # density here: 7.56
X.mean(), X.var()
X.rvs(size=5, random_state=0)

rng = np.random.default_rng(0)
rng.dirichlet(alpha=[2, 3, 4], size=5)

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

← MultinomialMultivariate normal →