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

    Function dgeom

    • Probability mass function of the geometric distribution (number of failures before the first success). Equivalent to R's dgeom(x, 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.

      • prob: number

        Probability of success on each trial.

      • options: DensityOptions = {}

        log (see DensityOptions).

      Returns VectorResult<T>

      The probability (or log probability).

      dgeom(2, 0.3);         // 0.147
      dgeom([0, 1, 2], 0.5); // [0.5, 0.25, 0.125]