rStats.js v1.3.0
    Preparing search index...

    Function pnbinom

    • Distribution function of the negative binomial distribution (number of failures before the size-th success). Equivalent to R's pnbinom(q, size, prob, mu, lower.tail = TRUE, log.p = FALSE).

      The distribution is parameterized by size and exactly one of prob or mu. With mu, size = Infinity gives the Poisson distribution.

      Type Parameters

      Parameters

      • q: T

        Quantile(s): a number, number[] or Float64Array. The result has the same shape.

      • size: number

        Target number of successes (need not be an integer).

      • options: NegBinomialParams & TailOptions

        prob or mu (see NegBinomialParams; exactly one is required), lowerTail and logP (see TailOptions).

      Returns VectorResult<T>

      The probability (or log probability).

      TypeError unless exactly one of prob and mu is given.

      pnbinom(3, 5, { prob: 0.5 }); // 0.36328125
      pnbinom(3, 5, { mu: 4 }); // 0.4899473063232853