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

    Function dbinom

    • Probability mass function of the binomial distribution. Equivalent to R's dbinom(x, size, prob, log = FALSE).

      Type Parameters

      Parameters

      • x: T

        Value(s) at which to evaluate: a number, number[] or Float64Array. The result has the same shape.

      • size: number

        Number of trials.

      • prob: number

        Probability of success on each trial.

      • options: DensityOptions = {}

        log (see DensityOptions).

      Returns VectorResult<T>

      The probability (or log probability).

      dbinom(3, 10, 0.5);      // 0.1171875
      dbinom([0, 5], 10, 0.5); // [0.0009765625, 0.24609375]