{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "tutorial:stats:discrete_nbinom",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The negative binomial random variable with parameters "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "p\\in\\left(0,1\\right)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can be defined as the number of "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "extra"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " independent trials (beyond "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " ) required to accumulate a total of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " successes where the probability of a success on each trial is "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "p."
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " Equivalently, this random variable is the number of failures encountered while accumulating "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " successes during independent trials of an experiment that succeeds with probability "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "p."
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " Thus,"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Recall that "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "I_{p}\\left(a,b\\right)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the incomplete beta integral."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Implementation: "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "scipy.stats.nbinom",
              "domain": null,
              "role": null,
              "inventory": null
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Negative Binomial Distribution"
        }
      ],
      "level": 0,
      "target": "discrete-nbinom"
    }
  ],
  "local_refs": []
}