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

    Function dhyper

    • Probability mass function of the hypergeometric distribution (number of white balls among k drawn without replacement from an urn of m white and n black balls). Equivalent to R's dhyper(x, m, n, k, log = FALSE).

      Type Parameters

      Parameters

      • x: T

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

      • m: number

        Number of white balls in the urn.

      • n: number

        Number of black balls in the urn.

      • k: number

        Number of balls drawn.

      • options: DensityOptions = {}

        log (see DensityOptions).

      Returns VectorResult<T>

      The probability (or log probability).

      dhyper(2, 10, 7, 8);          // 0.012957630604689432
      dhyper([0, 1], 10, 7, 8); // [0, 0.00041135335252982303]