{
  "__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_betanbinom",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The beta-negative binomial distribution is a negative binomial distribution with a probability of success "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "p",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " that follows a beta distribution. The probability mass function for "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "betanbinom",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", defined for "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "k\\geq 0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", is:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "f(k; n, a, b) = \\binom{n + k - 1}{k} \\frac{B(a + n, b + k)}{B(a, b)}"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "for "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "k"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "{0, 1,...}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", where "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "B(a, b)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the Beta function."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In the limiting case of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n = 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the beta-negative binomial distribution reduces to a beta-geometric distribution with the probability mass function:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "f(k; a, b) = \\frac{B(a + 1, b + k)}{B(a, b)}"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Implementation: "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "scipy.stats.betanbinom",
              "domain": null,
              "role": null,
              "inventory": null
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Beta-Negative Binomial Distribution"
        }
      ],
      "level": 0,
      "target": "discrete-betanbinom"
    }
  ],
  "local_refs": []
}