{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\set{f(\\cdot \\mid \\theta) : \\theta \\in \\Theta}$ be a [[parametric model|Q0DXKAQXE1]] given by densities or mass functions, with [[likelihood|05FSTXM92W]] $L(\\theta \\mid x) = f(x \\mid \\theta)$.\nLet $\\mathcal{C}$ be a family of probability distributions on $\\Theta$.\nThe family $\\mathcal{C}$ is *conjugate* for the model if the following holds for every [[prior|00NBBSXRQS]] $\\pi \\in \\mathcal{C}$.\nFor every observation $x$ with $0 \u003c \\int_\\Theta f(x \\mid \\theta) \\, \\pi(d\\theta) \u003c \\infty$, the [[posterior|0KJ7ZS8AJA]] $\\pi(\\cdot \\mid x)$ belongs to $\\mathcal{C}$.\nA *conjugate prior* is a member of such a family, usually a family indexed by finitely many hyperparameters.\n\n## Remarks\n\nExample: for $k$ successes in $n$ Bernoulli trials with chance $p \\in (0, 1)$, the [[beta distributions|0PP5ZAJPP7]] form a conjugate family.\nIndeed, with prior density proportional to $p^{a - 1}(1 - p)^{b - 1}$, the posterior density is proportional to $p^{a + k - 1}(1 - p)^{b + n - k - 1}$, so the posterior is $\\mathrm{Beta}(a + k, b + n - k)$.\nNon-example: for a Poisson observation $x$ with rate $\\lambda \u003e 0$, the log-normal family is not conjugate.\nThe posterior density is proportional to $\\lambda^{x} e^{-\\lambda}$ times a log-normal density, and the factor $e^{-\\lambda}$ cannot be written in log-normal form.\nThe gamma family is conjugate for the Poisson rate: a $\\mathrm{Gamma}(\\alpha, \\beta)$ prior, with rate $\\beta$, gives the posterior $\\mathrm{Gamma}(\\alpha + x, \\beta + 1)$.\nThe family of all distributions on $\\Theta$ is conjugate, because every posterior is a distribution on $\\Theta$; so the notion is useful only for small families.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "EHY450Q5CW",
    "kind": "definition",
    "msc": [
      "62F15"
    ],
    "name": "Conjugate prior",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Conjugate_prior"
      }
    ],
    "tag": "S99HFQ9WPH",
    "uses": [
      "Q0DXKAQXE1",
      "00NBBSXRQS",
      "0KJ7ZS8AJA",
      "05FSTXM92W",
      "0PP5ZAJPP7"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/S99HFQ9WPH/",
  "links": [
    {
      "field": "defines",
      "target": "EHY450Q5CW"
    },
    {
      "field": "uses",
      "target": "Q0DXKAQXE1"
    },
    {
      "field": "uses",
      "target": "00NBBSXRQS"
    },
    {
      "field": "uses",
      "target": "0KJ7ZS8AJA"
    },
    {
      "field": "uses",
      "target": "05FSTXM92W"
    },
    {
      "field": "uses",
      "target": "0PP5ZAJPP7"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/S99HFQ9WPH.md",
  "msc": [
    "62F15"
  ],
  "name": "Conjugate prior",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/S99/S99HFQ9WPH.md",
  "status": null,
  "tag": "S99HFQ9WPH",
  "uri": "m2://S99HFQ9WPH",
  "url": "https://tamnd.github.io/math2/wiki/conjugate-prior-definition/",
  "writing": {
    "tag": "S99HFQ9WPH",
    "kind": "definition",
    "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
      }
    ]
  }
}
