{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "0HYP606RYF"
    },
    {
      "field": "uses",
      "target": "0NQ5798SB1"
    },
    {
      "field": "uses",
      "target": "0RFMMBHFTV"
    }
  ],
  "body": "\n## Definition\n\nLet $n \\ge 2$ and let $X_1, \\dots, X_n$ be real random variables with [[sample mean|0QNRBHWV35]] $\\bar{X}_n$.\nThe sample variance is the [[statistic|036756NFD6]]\n$$S_n^2 = \\frac{1}{n - 1} \\sum_{i=1}^{n} \\left(X_i - \\bar{X}_n\\right)^2.$$\nThe sample standard deviation is $S_n = \\sqrt{S_n^2}$.\n\n## Remarks\n\nIf the $X_i$ are i.i.d. with [[variance|007QED3E0Y]] $\\sigma^2 \u003c \\infty$, then $E[S_n^2] = \\sigma^2$. So $S_n^2$ is an unbiased estimator of $\\sigma^2$.\nThe divisor $n - 1$ instead of $n$ is Bessel's correction. The version with divisor $n$ has expectation $\\frac{n-1}{n} \\sigma^2$, so it has the [[bias|01BD2TFFP4]] $-\\sigma^2/n$.\nThe reason is that $\\sum_i (X_i - \\bar{X}_n)^2 \\le \\sum_i (X_i - \\mu)^2$: the deviations from $\\bar{X}_n$ are on average smaller than those from the true mean $\\mu$.\nFor i.i.d. $\\mathcal{N}(\\mu, \\sigma^2)$ variables, $(n - 1) S_n^2 / \\sigma^2$ has the chi-squared distribution with $n - 1$ degrees of freedom, and it is independent of $\\bar{X}_n$.\n\n\n\n## Explanations\n\n### L1 human\n\nThe sample variance is the average squared distance of the data from their mean, but with the divisor $n - 1$.\nFor the data $4$, $7$, $10$, the mean is $7$, the squared deviations add up to $18$, and the sample variance is $18/2 = 9$.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "defines": "0NHXGY2C5J",
    "kind": "definition",
    "msc": [
      "62F10"
    ],
    "name": "Sample variance",
    "sources": [
      {
        "locator": "Formulation",
        "url": "https://en.wikipedia.org/wiki/Bessel's_correction"
      }
    ],
    "tag": "0JN9P4A944",
    "uses": [
      "0QNRBHWV35",
      "007QED3E0Y",
      "036756NFD6",
      "01BD2TFFP4"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/0JN9P4A944/",
  "links": [
    {
      "field": "defines",
      "target": "0NHXGY2C5J"
    },
    {
      "field": "uses",
      "target": "0QNRBHWV35"
    },
    {
      "field": "uses",
      "target": "007QED3E0Y"
    },
    {
      "field": "uses",
      "target": "036756NFD6"
    },
    {
      "field": "uses",
      "target": "01BD2TFFP4"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0JN9P4A944.md",
  "msc": [
    "62F10"
  ],
  "name": "Sample variance",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0JN/0JN9P4A944.md",
  "status": null,
  "tag": "0JN9P4A944",
  "uri": "m2://0JN9P4A944",
  "url": "https://math2.tamnd.com/wiki/sample-variance-definition/",
  "writing": {
    "tag": "0JN9P4A944",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
