{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $Y$ and $C$ be random variables with finite variance, where $\\mu = \\mathbb E C$ is known and $\\operatorname{Var} C \u003e 0$.\nFor a real number $\\beta$ let $Z_\\beta = Y - \\beta (C - \\mu)$.\nThen:\n\n1. $\\mathbb E Z_\\beta = \\mathbb E Y$ for every $\\beta$;\n2. $\\operatorname{Var} Z_\\beta = \\operatorname{Var} Y - 2\\beta \\operatorname{Cov}(Y, C) + \\beta^2 \\operatorname{Var} C$;\n3. this variance is smallest for $\\beta^* = \\operatorname{Cov}(Y, C) / \\operatorname{Var} C$, and $\\operatorname{Var} Z_{\\beta^*} = (1 - \\rho^2) \\operatorname{Var} Y$, where $\\rho$ is the [[correlation coefficient|0DNN9B6Q2F]] of $Y$ and $C$.\n\n## Remarks\n\nClause 1 holds because $\\mathbb E(C - \\mu) = 0$, and clause 2 is the expansion of the [[variance|0477R9PYAE]] of a difference.\nClause 3 minimises the quadratic in $\\beta$; substituting $\\beta^*$ gives $\\operatorname{Var} Y - \\operatorname{Cov}(Y, C)^2 / \\operatorname{Var} C = (1 - \\rho^2)\\operatorname{Var} Y$.\nExample: to estimate $\\mathbb E e^U = e - 1$ for $U$ uniform on $(0, 1)$, use $C = U$ with $\\mu = \\frac12$.\nHere $\\operatorname{Cov}(e^U, U) = 1 - \\frac{e - 1}{2} \\approx 0.1409$ and $\\operatorname{Var} U = \\frac{1}{12}$, so $\\beta^* \\approx 1.690$ and $\\operatorname{Var} Z_{\\beta^*} \\approx 0.0039$, against $\\operatorname{Var} e^U \\approx 0.2420$.\nIn practice $\\beta^*$ is estimated from the same samples, by least squares regression of $Y$ on $C$; this introduces a bias of order $1/n$, which is usually negligible.\nIf $C$ is uncorrelated with $Y$, then $\\rho = 0$ and no gain is possible.\n\n## Explanations\n\n### L1 human\n\nSuppose a quantity $Y$ is hard to average, but a related quantity $C$ has an exactly known average.\nOn each sample, see how far $C$ is from its known average, and correct $Y$ by a multiple of that error.\nIf $Y$ and $C$ move together, the correction removes much of the noise in $Y$.\nThe better $C$ tracks $Y$, the larger the gain: a correlation of $0.99$ cuts the variance by a factor of about $50$.\n\n### L2 human\n\nControl variates is a [[variance reduction|A01GEGWKVB]] technique that turns side knowledge, the exact mean of $C$, into accuracy.\nIn option pricing, the price of a similar option with a closed-form value is a classic control.\nWith several controls $C_1, \\ldots, C_k$ the optimal coefficients solve a linear least squares problem, and the variance becomes $(1 - R^2)\\operatorname{Var} Y$, with $R^2$ the squared multiple correlation.\nThe multilevel Monte Carlo method can be seen as a recursive use of control variates, with coarse approximations as controls for fine ones.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "A01GEGWKVB"
    ],
    "kind": "statement",
    "msc": [
      "65C05"
    ],
    "name": "Control variates",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q3554721",
      "wikipedia": "Control variates"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Control_variates"
      }
    ],
    "tag": "VPMRHXP6NM",
    "uses": [
      "A01GEGWKVB",
      "0477R9PYAE",
      "0KBFAWYRTE",
      "0DNN9B6Q2F",
      "0WQNRCNY3M"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/VPMRHXP6NM/",
  "links": [
    {
      "field": "about",
      "target": "A01GEGWKVB"
    },
    {
      "field": "uses",
      "target": "A01GEGWKVB"
    },
    {
      "field": "uses",
      "target": "0477R9PYAE"
    },
    {
      "field": "uses",
      "target": "0KBFAWYRTE"
    },
    {
      "field": "uses",
      "target": "0DNN9B6Q2F"
    },
    {
      "field": "uses",
      "target": "0WQNRCNY3M"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/VPMRHXP6NM.md",
  "msc": [
    "65C05"
  ],
  "name": "Control variates",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/VPM/VPMRHXP6NM.md",
  "status": null,
  "tag": "VPMRHXP6NM",
  "uri": "m2://VPMRHXP6NM",
  "url": "https://tamnd.github.io/math2/wiki/control-variates/",
  "writing": {
    "tag": "VPMRHXP6NM",
    "kind": "statement",
    "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
      }
    ]
  }
}
