Dirichlet Distribution Calculator

Evaluate the Dirichlet density for three proportions and their concentration parameters.

Math and PercentUpdated 2026-11-202 min read
Dirichlet Distribution Calculator
Density
...
Mean of x1...
Total concentration...

What it does

The Dirichlet distribution is a distribution over proportions. It is the natural choice when a random vector has positive components that must add to one, such as the probabilities of several outcomes or the mix of topics in a document. It is also the conjugate prior for multinomial probabilities in Bayesian statistics.

The density depends on three positive concentration parameters. Their sum is the total concentration, which controls how tightly the distribution clusters around its mean. A large total concentration gives proportions close to the mean, while a small total concentration spreads them across the simplex.

The normalising constant uses gamma functions. The tool evaluates the density in log space for stability and reports the mean of the first component alongside the total concentration. The three components you enter must add to one to within a tight tolerance.

When a concentration parameter is below one, the density becomes infinite at the corresponding boundary. The tool reports that case explicitly. For parameters equal to one the distribution is uniform over the simplex.

This page handles three components only and reports a density, not a probability. Probabilities require integration over a region of the simplex, which is outside the scope of this calculator.

How to use

  1. Enter three positive concentration parameters.
  2. Enter three proportions that sum to one.
  3. Read the density at that point.
  4. Read the mean of the first component.
  5. Read the total concentration.
  6. Compare densities for different parameter settings.

Formula

f(x) = Gamma(a0) / (Gamma(a1)Gamma(a2)Gamma(a3)) x x1^(a1-1) x2^(a2-1) x3^(a3-1), with a0 = a1+a2+a3.
ai
Positive concentration parameter for component i.
a0
Sum of the concentration parameters.
xi
Proportion of component i, with the three summing to one.
f(x)
Dirichlet density on the simplex.

The density is with respect to the first two components, with the third determined by the simplex constraint. The mean of component i is ai divided by a0. A concentration below one gives a boundary singularity, which the tool reports as infinite.

Worked example

Example: symmetric concentrations of 2

Defaults: all three alphas equal 2 and each proportion near one third.

  1. Total concentration is 2 + 2 + 2 = 6.
  2. Gamma of 6 divided by gamma of 2 cubed is 120.
  3. Each proportion is about one third, so the product of powers is about 1/27.
  4. Density is 120 / 27 = 4.4444.
  5. The mean of x1 is 2 / 6 = 0.3333.
  6. The tool shows 4.4444, 0.3333 and 6.0000.

Reference table

Effect of concentration on the Dirichlet mean
AlphasMean of x1Total concentration
1, 1, 10.33333
2, 2, 20.33336
4, 2, 10.57147

Limits

  • Handles exactly three components.
  • Reports density rather than region probability.
  • Boundary densities can be infinite for small alphas.
  • Does not fit parameters from observed proportions.

Common mistakes

  • Entering proportions that do not sum to one.
  • Using a zero or negative concentration.
  • Reading density as a probability.
  • Confusing component concentration with the total concentration.
  • Expecting a four component or general k version.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is the mean of x1 for alphas 4, 2 and 1?

The total is 7, so the mean of x1 is 4/7 = 0.5714.

What does total concentration control?

It controls how tightly the distribution concentrates around its mean. Larger values give narrower Spread.

What if the proportions sum to 0.99?

The tool returns the error The three x values must be non negative and add up to 1.

Questions

What is the Dirichlet distribution?

A distribution over vectors of proportions that sum to one.

Where is it used?

In Bayesian statistics, topic models, compositional data and anywhere proportions are random.

What do the alphas mean?

They are concentration parameters that shape the distribution and set its means.

What is total concentration?

The sum of the alphas, controlling how concentrated the distribution is.

Can a density be infinite?

Yes, when an alpha is below one the density diverges at that boundary.

Does this tool handle more than three components?

No. It is limited to three components for a simple form.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.