{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $X_1, X_2, \\dots$ be [[independent and identically distributed|00MRN0FARV]] random variables with a density $f$ with respect to a $\\sigma$-finite measure.\nLet $f_0 \\ne f_1$ be two densities, and consider the [[hypotheses|087P03NEND]] $H_0 \\colon f = f_0$ and $H_1 \\colon f = f_1$.\nThe ratio of the [[likelihoods|0VW9E4QXR6]] after $n$ observations is\n$$\\Lambda_n = \\prod_{i=1}^{n} \\frac{f_1(X_i)}{f_0(X_i)}, \\qquad \\Lambda_0 = 1.$$\nLet $0 \u003c A \u003c 1 \u003c B$ be constants.\nThe *sequential probability ratio test* with boundaries $A$ and $B$ is the [[sequential procedure|9CWYNB9003]] such that:\n\n1. It stops at the [[stopping time|WND87FBAKC]] $N = \\min \\set{n \\ge 1 : \\Lambda_n \\le A \\text{ or } \\Lambda_n \\ge B}$.\n2. It rejects $H_0$ if $\\Lambda_N \\ge B$ and accepts $H_0$ if $\\Lambda_N \\le A$.\n\n## Remarks\n\nExample: for coin tosses $X_i \\in \\set{0, 1}$, let $f_0$ be the Bernoulli law with parameter $1/2$ and $f_1$ the one with parameter $2/3$.\nThen each head multiplies $\\Lambda_n$ by $4/3$ and each tail by $2/3$.\nWith $A = 1/4$ and $B = 4$, the test stops the first time the running product leaves the interval $(1/4, 4)$.\n\nNon-example: comparing $\\Lambda_{100}$ with a single threshold after exactly $100$ tosses is a fixed-sample likelihood ratio test, not an SPRT, because the stopping rule of clause 1 is not used.\n\nSince $f_0 \\ne f_1$, the time $N$ is finite with probability one under both hypotheses and has finite expectation.\nIn logarithms, $\\log \\Lambda_n$ is a [[random walk|04VZE3FZXF]] with the two absorbing barriers $\\log A \u003c 0 \u003c \\log B$.\nLet $\\alpha$ and $\\beta$ be the error probabilities of [[type I and type II|03N8C8ZR4B]].\nWald's inequalities are $B \\le (1 - \\beta)/\\alpha$ and $A \\ge \\beta/(1 - \\alpha)$, and in practice the boundaries $B = (1 - \\beta)/\\alpha$ and $A = \\beta/(1 - \\alpha)$ are used as approximations.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "SXR93CAP1R",
    "kind": "definition",
    "msc": [
      "62L10",
      "62F03"
    ],
    "name": "Sequential probability ratio test",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Sequential_probability_ratio_test"
      }
    ],
    "tag": "4PBC71YCTK",
    "uses": [
      "9CWYNB9003",
      "087P03NEND",
      "00MRN0FARV",
      "0VW9E4QXR6",
      "WND87FBAKC",
      "03N8C8ZR4B",
      "04VZE3FZXF"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/4PBC71YCTK/",
  "links": [
    {
      "field": "defines",
      "target": "SXR93CAP1R"
    },
    {
      "field": "uses",
      "target": "9CWYNB9003"
    },
    {
      "field": "uses",
      "target": "087P03NEND"
    },
    {
      "field": "uses",
      "target": "00MRN0FARV"
    },
    {
      "field": "uses",
      "target": "0VW9E4QXR6"
    },
    {
      "field": "uses",
      "target": "WND87FBAKC"
    },
    {
      "field": "uses",
      "target": "03N8C8ZR4B"
    },
    {
      "field": "uses",
      "target": "04VZE3FZXF"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/4PBC71YCTK.md",
  "msc": [
    "62L10",
    "62F03"
  ],
  "name": "Sequential probability ratio test",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/4PB/4PBC71YCTK.md",
  "status": null,
  "tag": "4PBC71YCTK",
  "uri": "m2://4PBC71YCTK",
  "url": "https://tamnd.github.io/math2/wiki/sequential-probability-ratio-test-definition/",
  "writing": {
    "tag": "4PBC71YCTK",
    "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
      }
    ]
  }
}
