{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $X_1, \\dots, X_n$ be [[i.i.d.|0AJN7WHBJZ]] real random variables with [[empirical distribution function|A05WR6TEK5]] $F_n$.\nLet $F_0$ be a fixed continuous [[cumulative distribution function|0MXMS3AE13]].\nThe *Cramér–von Mises statistic* is\n$$T = n \\int_{-\\infty}^{\\infty} \\big(F_n(x) - F_0(x)\\big)^2 \\, dF_0(x).$$\nThe *Cramér–von Mises test* of $H_0 \\colon$ \"the $X_i$ have distribution function $F_0$\" rejects $H_0$ when $T$ is large.\nThe critical value comes from the null law of $T$.\n\n## Remarks\n\nWith the [[order statistics|58NHGZDSRE]] $X_{(1)} \\le \\dots \\le X_{(n)}$, the integral can be computed exactly:\n$$T = \\frac{1}{12 n} + \\sum_{i=1}^{n} \\Big( \\frac{2i - 1}{2n} - F_0(X_{(i)}) \\Big)^2.$$\nUnder $H_0$ the law of $T$ does not depend on $F_0$, since $F_0(X_i)$ is uniform on $[0, 1]$.\nAs $n \\to \\infty$ it converges to the law of $\\int_0^1 B(t)^2 \\, dt$ for a [[Brownian bridge|3MCVMBAGD1]] $B$.\n\nExample: $n = 1$, $X_1 = 0.5$ and $F_0(x) = x$ on $[0, 1]$.\nThe integral is $\\int_0^{1/2} x^2 \\, dx + \\int_{1/2}^{1} (1 - x)^2 \\, dx = 1/24 + 1/24 = 1/12$.\nThe formula gives the same value: $1/12 + (1/2 - 1/2)^2 = 1/12$.\n\nNon-example: $n \\int (F_n - F_0)^2 \\, dx$, with Lebesgue measure in place of $dF_0$, is not the criterion.\nIts null law depends on $F_0$, for example on its scale, so it gives no distribution-free test.\n\nThe Anderson–Darling statistic is a weighted variant of $T$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "G14XJXPKFS",
    "kind": "definition",
    "msc": [
      "62G10",
      "62G30"
    ],
    "name": "Cramér–von Mises criterion",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Cram%C3%A9r%E2%80%93von_Mises_criterion"
      }
    ],
    "tag": "B7HPB2Z6GC",
    "uses": [
      "A05WR6TEK5",
      "087P03NEND",
      "0MXMS3AE13",
      "0AJN7WHBJZ",
      "58NHGZDSRE"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/B7HPB2Z6GC/",
  "links": [
    {
      "field": "defines",
      "target": "G14XJXPKFS"
    },
    {
      "field": "uses",
      "target": "A05WR6TEK5"
    },
    {
      "field": "uses",
      "target": "087P03NEND"
    },
    {
      "field": "uses",
      "target": "0MXMS3AE13"
    },
    {
      "field": "uses",
      "target": "0AJN7WHBJZ"
    },
    {
      "field": "uses",
      "target": "58NHGZDSRE"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/B7HPB2Z6GC.md",
  "msc": [
    "62G10",
    "62G30"
  ],
  "name": "Cramér–von Mises criterion",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/B7H/B7HPB2Z6GC.md",
  "status": null,
  "tag": "B7HPB2Z6GC",
  "uri": "m2://B7HPB2Z6GC",
  "url": "https://tamnd.github.io/math2/wiki/cramer-von-mises-criterion-definition/",
  "writing": {
    "tag": "B7HPB2Z6GC",
    "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
      }
    ]
  }
}
