{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "7174H28FT6"
    }
  ],
  "body": "\n## Example\n\nLet $K \\ge 2$ and $\\alpha_1, \\dots, \\alpha_K \u003e 0$, and let $\\alpha_0 = \\alpha_1 + \\dots + \\alpha_K$.\nThe *Dirichlet distribution* $\\operatorname{Dir}(\\alpha_1, \\dots, \\alpha_K)$ is the law of a random vector $(X_1, \\dots, X_K)$ in the open simplex $\\set{x \\in \\R^K : x_i \u003e 0, \\ x_1 + \\dots + x_K = 1}$.\nThe vector $(X_1, \\dots, X_{K-1})$ has the density\n$$f(x_1, \\dots, x_{K-1}) = \\frac{\\Gamma(\\alpha_0)}{\\Gamma(\\alpha_1) \\cdots \\Gamma(\\alpha_K)} \\prod_{i=1}^K x_i^{\\alpha_i - 1}$$\non the set where all $x_i \u003e 0$ and $x_1 + \\dots + x_{K-1} \u003c 1$, with $x_K = 1 - x_1 - \\dots - x_{K-1}$; here $\\Gamma$ is the [[gamma function|0H5SYBSED9]].\nA construction: if $Y_1, \\dots, Y_K$ are independent and $Y_i$ has the [[gamma distribution|0B80PAQD3C]] with shape $\\alpha_i$ and scale $1$, then $(Y_1, \\dots, Y_K) / (Y_1 + \\dots + Y_K)$ has law $\\operatorname{Dir}(\\alpha_1, \\dots, \\alpha_K)$.\nCheck for $K = 2$: the density becomes $\\frac{\\Gamma(\\alpha_1 + \\alpha_2)}{\\Gamma(\\alpha_1)\\Gamma(\\alpha_2)} x^{\\alpha_1 - 1} (1 - x)^{\\alpha_2 - 1}$ on $(0, 1)$, so $X_1$ has the [[beta distribution|0EW824Z7G2]] with parameters $\\alpha_1, \\alpha_2$.\nThe means are $E[X_i] = \\alpha_i / \\alpha_0$ and the variances are $\\operatorname{Var}(X_i) = \\frac{\\alpha_i (\\alpha_0 - \\alpha_i)}{\\alpha_0^2 (\\alpha_0 + 1)}$.\n\n## Remarks\n\nIf all $\\alpha_i = 1$, the density is constant, so the law is uniform on the simplex.\nThe Dirichlet law is the conjugate prior of the multinomial law: with prior $\\operatorname{Dir}(\\alpha_1, \\dots, \\alpha_K)$ for the cell probabilities and observed counts $n_1, \\dots, n_K$, the posterior is $\\operatorname{Dir}(\\alpha_1 + n_1, \\dots, \\alpha_K + n_K)$.\nIt is the finite-dimensional building block of the [[Dirichlet process|XT4SWG6J7N]].\n\n## Explanations\n\n### L1 human\n\nThe Dirichlet distribution is a law on random probability vectors: lists of $K$ positive numbers that add up to $1$.\nIt is used to model an unknown die with $K$ faces, before the die has been thrown.\nLarge parameters concentrate the vector near the mean $(\\alpha_1, \\dots, \\alpha_K)/\\alpha_0$, and small parameters push it towards the corners of the simplex.\nFor two categories it is the beta distribution.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "instance_of": [
      "0DVDCMA2DK"
    ],
    "kind": "example",
    "msc": [
      "60E05",
      "62E15",
      "62F15"
    ],
    "name": "Dirichlet distribution",
    "same_as": {
      "wikidata": "Q981016",
      "wikipedia": "Dirichlet distribution"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Dirichlet_distribution"
      }
    ],
    "tag": "RX4CVSSRRJ",
    "uses": [
      "0H5SYBSED9",
      "0B80PAQD3C",
      "0EW824Z7G2"
    ]
  },
  "kind": "example",
  "link": "https://math2.tamnd.com/node/RX4CVSSRRJ/",
  "links": [
    {
      "field": "instance_of",
      "target": "0DVDCMA2DK"
    },
    {
      "field": "uses",
      "target": "0H5SYBSED9"
    },
    {
      "field": "uses",
      "target": "0B80PAQD3C"
    },
    {
      "field": "uses",
      "target": "0EW824Z7G2"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/RX4CVSSRRJ.md",
  "msc": [
    "60E05",
    "62E15",
    "62F15"
  ],
  "name": "Dirichlet distribution",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/RX4/RX4CVSSRRJ.md",
  "status": null,
  "tag": "RX4CVSSRRJ",
  "uri": "m2://RX4CVSSRRJ",
  "url": "https://math2.tamnd.com/wiki/dirichlet-distribution/",
  "writing": {
    "tag": "RX4CVSSRRJ",
    "kind": "example",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
