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

    Function qnbinom

    • Quantile function of the negative binomial distribution (number of failures before the size-th success). Equivalent to R's qnbinom(p, 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

      • p: T

        Probability (or log probability with logP): 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 quantile(s).

      TypeError unless exactly one of prob and mu is given.

      qnbinom(0.5, 5, { prob: 0.5 });  // 4
      qnbinom([0.05, 0.95], 5, { mu: 4 }); // [0, 9]