Dirichlet Distribution Generator & Visualizer

Generate probability vectors (each component ≥0 and the total sums to 1), then visualize marginals and simplex plots.

Everything runs in your browser; nothing is uploaded. Share URLs contain settings only (no generated samples).

Secure mode uses CSPRNG. Seeded mode is for reproducibility, not secrecy.

Other languages 日本語 | English | Español | Français

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.

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.

All components use α_i = α. Good starting point to see “corner vs center”.

Show components (marginals)

Up to 5 components are used for marginal histograms. (For large K, the checkbox list is hidden — use the index input.)

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.

How to use this tool

Use this page to generate probability vectors that must stay non-negative and sum to 1.

Use in 3 steps

  1. Start with a small dimension such as K=3 and a preset that is easy to interpret.
  2. Generate the sample, then review theoretical means, marginals, and row previews together.
  3. Change one α value or the total concentration at a time so you can isolate mean shifts from concentration shifts.

How to read the result

Each row is one probability vector. The means show the expected share of each component, while the concentration controls how tightly samples stay near that mean. Because all components must sum to 1, increases in one component reduce room for others.

Boundary checks

Frequently asked questions

Why do components negatively correlate?
Because all components must sum to 1, increasing one component tends to decrease at least one other component.
Why do samples stick to corners?
If one or more α values are below 1, or total concentration is small, the density moves toward simplex boundaries.
Why can the exported row stop summing to 1 exactly?
Rounded output can lose exact equality even though the underlying sample still sums to 1 before rounding.
How is this different from Beta?
Dirichlet handles vectors of probabilities, while Beta is the two-component special case viewed through one component.
What should I do first on this page?
Start with a low-dimensional baseline, then change one α value or concentration setting at a time.