{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe compare the likelihood-ratio region with another region through one pointwise inequality, and then integrate it.\n\n1. Let $f_0(x) = L(\\theta_0 \\mid x)$ and $f_1(x) = L(\\theta_1 \\mid x)$ be the [[likelihoods|05FSTXM92W]]. They are [[probability mass functions|0WF4EJP91W]] or [[densities|04YG690N5V]] of the data $X$ under $\\theta_0$ and $\\theta_1$. Write $\\int g$ for the sum over $x$ or the integral in $x$ of a function $g$.\n2. A [[hypothesis test|087P03NEND]] rejects $H_0$ when $X$ lies in a rejection region $R$. Its size is $P_{\\theta_0}(X \\in R) = \\int 1_R f_0$, and its power at $\\theta_1$ is $P_{\\theta_1}(X \\in R) = \\int 1_R f_1$, as for [[type I and type II errors|0R41PVFA39]].\n3. Let $R^* = \\set{x : f_0(x) \\le \\eta f_1(x)}$. Where $f_1(x) \u003e 0$, this is the condition $\\Lambda(x) \\le \\eta$. Where $f_1(x) = 0$ and $f_0(x) \u003e 0$, the point is not in $R^*$. There $\\Lambda(x) = +\\infty \u003e \\eta$, so the test does not reject either.\n4. Let $N = \\set{x : f_0(x) = f_1(x) = 0}$. Then $\\int 1_N f_0 = \\int 1_N f_1 = 0$. So the convention for $\\Lambda$ on $N$ changes no probability, and the likelihood-ratio test has size $\\alpha = \\int 1_{R^*} f_0$ and power $\\int 1_{R^*} f_1$.\n5. Let $R$ be the rejection region of another test with size $\\int 1_R f_0 \\le \\alpha$. Let $h(x) = \\left(1_{R^*}(x) - 1_R(x)\\right) \\left(\\eta f_1(x) - f_0(x)\\right)$.\n6. Claim: $h(x) \\ge 0$ for every $x$. If $x \\in R^*$, then $1_{R^*}(x) - 1_R(x) \\ge 0$, and $\\eta f_1(x) - f_0(x) \\ge 0$ by the definition of $R^*$.\n7. If $x \\notin R^*$, then $1_{R^*}(x) - 1_R(x) \\le 0$, and $\\eta f_1(x) - f_0(x) \u003c 0$. In both cases the product is at least $0$.\n8. The function $h$ is bounded in absolute value by $\\eta f_1 + f_0$, which has finite integral $\\eta + 1$. So $\\int h$ exists, and $\\int h \\ge 0$ by step 6 and 7.\n9. Expand the product: $\\int h = \\eta \\left(\\int 1_{R^*} f_1 - \\int 1_R f_1\\right) - \\left(\\int 1_{R^*} f_0 - \\int 1_R f_0\\right)$.\n10. The second bracket equals $\\alpha - \\int 1_R f_0 \\ge 0$, since the size of $R$ is at most $\\alpha$.\n11. By steps 8 to 10, $\\eta \\left(\\int 1_{R^*} f_1 - \\int 1_R f_1\\right) \\ge \\alpha - \\int 1_R f_0 \\ge 0$.\n12. Since $\\eta \u003e 0$, $\\int 1_{R^*} f_1 \\ge \\int 1_R f_1$. That is, $P_{\\theta_1}(X \\in R^*) \\ge P_{\\theta_1}(X \\in R)$.\n13. So no test of size at most $\\alpha$ has a larger power at $\\theta_1$ than the likelihood-ratio test. Since the likelihood-ratio test itself has size $\\alpha$, it is a most powerful test of size $\\alpha$.\n\n## Idea\n\nThe likelihood-ratio region collects exactly the points where $f_1$ is large compared with $f_0$, at the exchange rate $\\eta$. Any other region of no larger size must trade some of these points for points where $f_1$ is smaller relative to $f_0$. One pointwise inequality, integrated, shows that this trade cannot raise the power.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "62F03"
    ],
    "name": "Proof of the Neyman–Pearson lemma",
    "proves": "0EE19CFEEF",
    "sources": [
      {
        "locator": "Proof",
        "url": "https://en.wikipedia.org/wiki/Neyman–Pearson_lemma"
      }
    ],
    "tag": "5F4JG2980G",
    "uses": [
      "087P03NEND",
      "05FSTXM92W",
      "0R41PVFA39",
      "0WF4EJP91W",
      "04YG690N5V"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/5F4JG2980G/",
  "links": [
    {
      "field": "proves",
      "target": "0EE19CFEEF"
    },
    {
      "field": "uses",
      "target": "087P03NEND"
    },
    {
      "field": "uses",
      "target": "05FSTXM92W"
    },
    {
      "field": "uses",
      "target": "0R41PVFA39"
    },
    {
      "field": "uses",
      "target": "0WF4EJP91W"
    },
    {
      "field": "uses",
      "target": "04YG690N5V"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/5F4JG2980G.md",
  "msc": [
    "62F03"
  ],
  "name": "Proof of the Neyman–Pearson lemma",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/5F4/5F4JG2980G.md",
  "status": null,
  "tag": "5F4JG2980G",
  "uri": "m2://5F4JG2980G",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-neyman-pearson-lemma/",
  "writing": {
    "tag": "5F4JG2980G",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
