{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $q$ be a real number.\nLet $Y$ be a random variable with finite [[variance|0477R9PYAE]] and [[expected value|0WQNRCNY3M]] $\\mathbb E Y = q$, used in a plain [[Monte Carlo method|HWP11G3HTN]] for $q$.\nA *variance reduction* for this method is a random variable $Z$ such that:\n\n1. $\\mathbb E Z = q$;\n2. $\\operatorname{Var} Z \u003c \\operatorname{Var} Y$;\n3. independent copies of $Z$ can be generated.\n\nThe Monte Carlo method then uses the average $\\frac1n \\sum_{i=1}^n Z_i$ of independent copies of $Z$ instead of the average of copies of $Y$.\n\n## Remarks\n\nExample: $q = \\int_0^1 e^u\\, du = e - 1$ and $Y = e^U$ with $U$ uniform on $(0, 1)$, so $\\operatorname{Var} Y = \\frac{e^2 - 1}{2} - (e - 1)^2 \\approx 0.2420$.\nTake $Z = \\frac12 \\bigl(e^U + e^{1 - U}\\bigr)$.\nClause 1 holds because $1 - U$ is also uniform, clause 3 is clear, and a direct computation gives $\\operatorname{Var} Z = \\frac{e^2 - 1 + 2e}{4} - (e - 1)^2 \\approx 0.0039$, so clause 2 holds.\nNon-example: $Z = 1 + U + \\frac12 U^2$, the Taylor polynomial of $e^U$, has variance about $0.189 \u003c 0.2420$, but $\\mathbb E Z = \\frac53 \\ne e - 1$, so clause 1 fails and the estimate is biased.\nA fair comparison also counts the cost.\nIf one copy of $Z$ costs $c$ times as much as one copy of $Y$, the reduction pays off when $c \\operatorname{Var} Z \u003c \\operatorname{Var} Y$.\nIn the example $c = 2$ and $2 \\cdot 0.0039 \u003c 0.2420$.\nSome techniques, such as stratified sampling, change the whole estimator rather than one sample.\nFor them one compares the variances of two estimators of the same cost.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "A01GEGWKVB",
    "kind": "definition",
    "msc": [
      "65C05"
    ],
    "name": "Variance reduction",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Variance_reduction"
      }
    ],
    "tag": "M2JF5D7DP2",
    "uses": [
      "HWP11G3HTN",
      "0WQNRCNY3M",
      "0477R9PYAE"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/M2JF5D7DP2/",
  "links": [
    {
      "field": "defines",
      "target": "A01GEGWKVB"
    },
    {
      "field": "uses",
      "target": "HWP11G3HTN"
    },
    {
      "field": "uses",
      "target": "0WQNRCNY3M"
    },
    {
      "field": "uses",
      "target": "0477R9PYAE"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/M2JF5D7DP2.md",
  "msc": [
    "65C05"
  ],
  "name": "Variance reduction",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/M2J/M2JF5D7DP2.md",
  "status": null,
  "tag": "M2JF5D7DP2",
  "uri": "m2://M2JF5D7DP2",
  "url": "https://tamnd.github.io/math2/wiki/variance-reduction-definition/",
  "writing": {
    "tag": "M2JF5D7DP2",
    "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
      }
    ]
  }
}
