{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "75P3EJPH81"
    }
  ],
  "body": "\n## Definition\n\nLet $M_0$ and $M_1$ be two models for data $x$.\nFor $i = 0, 1$, model $M_i$ has a parameter $\\theta_i \\in \\Theta_i$, a density or mass function $f_i(x \\mid \\theta_i)$ and a proper [[prior|00NBBSXRQS]] $\\pi_i$ on $\\Theta_i$.\nThe *marginal likelihood* of $M_i$ is\n$$m_i(x) = \\int_{\\Theta_i} f_i(x \\mid \\theta_i) \\, \\pi_i(d\\theta_i).$$\nIf $m_0(x) \u003e 0$, the *Bayes factor* of $M_1$ against $M_0$ is\n$$B_{10}(x) = \\frac{m_1(x)}{m_0(x)}.$$\n\n## Remarks\n\nBy [[Bayes' theorem|0NM6E9VW04]], with prior model probabilities $P(M_0), P(M_1) \u003e 0$, the posterior odds are\n$$\\frac{P(M_1 \\mid x)}{P(M_0 \\mid x)} = B_{10}(x) \\cdot \\frac{P(M_1)}{P(M_0)}.$$\nIf both models are simple, that is each $\\Theta_i$ is a single point, then $B_{10}$ is the [[likelihood|05FSTXM92W]] ratio.\nExample: let $M_0$ say that a coin is fair and $M_1$ that its chance $p$ of heads is uniform on $[0, 1]$, and observe two heads in two tosses.\nThen $m_0 = 1/4$ and $m_1 = \\int_0^1 p^2 \\, dp = 1/3$, so $B_{10} = 4/3$.\nNon-example: with an improper prior $\\pi_1$, the integral $m_1(x)$ is defined only up to an arbitrary constant factor, so the ratio is not a well-defined Bayes factor.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "NSBYE143KS",
    "kind": "definition",
    "msc": [
      "62F15",
      "62F03"
    ],
    "name": "Bayes factor",
    "sources": [
      {
        "locator": "Definition",
        "url": "https://en.wikipedia.org/wiki/Bayes_factor"
      }
    ],
    "tag": "5ZEGZVZBTJ",
    "uses": [
      "05FSTXM92W",
      "00NBBSXRQS",
      "0NM6E9VW04"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/5ZEGZVZBTJ/",
  "links": [
    {
      "field": "defines",
      "target": "NSBYE143KS"
    },
    {
      "field": "uses",
      "target": "05FSTXM92W"
    },
    {
      "field": "uses",
      "target": "00NBBSXRQS"
    },
    {
      "field": "uses",
      "target": "0NM6E9VW04"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/5ZEGZVZBTJ.md",
  "msc": [
    "62F15",
    "62F03"
  ],
  "name": "Bayes factor",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/5ZE/5ZEGZVZBTJ.md",
  "status": null,
  "tag": "5ZEGZVZBTJ",
  "uri": "m2://5ZEGZVZBTJ",
  "url": "https://tamnd.github.io/math2/wiki/bayes-factor-definition/",
  "writing": {
    "tag": "5ZEGZVZBTJ",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
