What is a Dirichlet distribution?
A Dirichlet distribution is a distribution over probability vectors (x1,…,xK) where each component is non‑negative and the total sums to 1. This space is called a simplex.
- α (alpha) can be interpreted like pseudo‑counts. The relative sizes of α determine the mean vector.
- α0 = Σα_i is the concentration (strength): larger α0 ⇒ tighter around the mean; smaller α0 ⇒ more variability.
- If some α_i < 1, samples tend to be sparse and stick to corners/edges; if all α_i > 1, mass is often inside the simplex.
- K=2 is a special case:
x1 ~ Beta(α1,α2)(this tool shows the Beta overlay and links to the Beta tool).
Common use cases: Bayesian priors for categorical probabilities, topic proportions, mixture weights, and probability‑like test data. You don’t need to enter personal information to use it.
Presets
Pick a practical preset (it regenerates instantly; you can tweak after applying).
Tip: For large K, use profile JSON for sharing instead of long URLs.
Generator
Choose a parameterization, generate samples, then inspect means, marginals, and diagnostics.
Per-component stats
| Component | Theory mean | Sample mean | Theory var | Sample var |
|---|
Samples preview (first 20)
Profile JSON (save/restore settings)
Share URLs contain settings only. For large K, use profile JSON to save/restore without long URLs.
Tip: Don’t include confidential labels (customer names, etc.) in shared profiles.
FAQ
Why do components negatively correlate?
Why do samples stick to corners?
Does rounding affect Σ=1?
Is seeded RNG secure?
Related tools
- Distributions hubBrowse distribution tools and randomness diagnostics.
- Distribution samplerA multi-distribution sampler (normal, gamma, beta, and more).
- Beta distribution generatorK=2 Dirichlet is Beta — useful for single probability values.
- Random JSON generatorGenerate JSON test data (arrays & NDJSON).
- Random CSV generatorGenerate table-shaped test data in CSV.
- Randomness testsQuick sanity checks for randomness.
- Probability & simulation guideLearn and explore related topics.