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

    Function dnbinom

    • Probability mass function of the negative binomial distribution (number of failures before the size-th success). Equivalent to R's dnbinom(x, size, prob, mu, log = 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

      Returns VectorResult<T>

      The probability (or log probability).

      TypeError unless exactly one of prob and mu is given.

      dnbinom(3, 5, { prob: 0.5 }); // 0.13671875
      dnbinom(3, 5, { mu: 4 }); // 0.16261401187793145