Catalog/stat-negative-binomial-probability

Statistics

Negative binomial prob API

Computes negative-binomial probabilities for the number of failures before the r-th success (exact/at-most/at-least) with mean and variance. Answers 'What is the probability of k failures before r successes?', 'What is the negative binomial PMF/CDF?'.

Price$0.04per request
MethodPOST
Route/v1/stats/negative-binomial-probability
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
statisticsnegative-binomialdistributionprobabilitypmfoverdispersiondiscretesuccesses
API URLhttps://x402.hexl.dev/v1/stats/negative-binomial-probability
Integration docs
Example request
{
  "r": 3,
  "p": 0.5,
  "k": 2
}
Example response
{
  "r": 3,
  "p": 0.5,
  "k": 2,
  "mode": "exact",
  "probability": 0.1875,
  "exact": 0.1875,
  "atMost": 0.5,
  "atLeast": 0.6875,
  "mean": 3,
  "variance": 6,
  "rating": "plausible",
  "interpretation": "NegBinom(r=3, p=0.5): P(failures = 2) = 0.1875."
}
Input schema
{
  "type": "object",
  "required": [
    "r",
    "p",
    "k"
  ],
  "properties": {
    "r": {
      "type": "integer",
      "examples": [
        3
      ]
    },
    "p": {
      "type": "number",
      "examples": [
        0.5
      ]
    },
    "k": {
      "type": "integer",
      "examples": [
        2
      ]
    },
    "cumulative": {
      "type": "string",
      "enum": [
        "exact",
        "atMost",
        "atLeast"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}