dhyperBinMolenaar: HyperGeometric (Point) Probabilities via Molenaar's Binomial...

View source: R/hyper-dist.R

dhyperBinMolenaarR Documentation

HyperGeometric (Point) Probabilities via Molenaar's Binomial Approximation

Description

Compute hypergeometric (point) probabilities via Molenaar's binomial approximation, hyper2binomP().

Usage

dhyperBinMolenaar(x, m, n, k, log = FALSE)

Arguments

x

(vector of) the number of white balls drawn without replacement from an urn which contains both black and white balls.

m

the number of white balls in the urn.

n

the number of black balls in the urn.

k

the number of balls drawn from the urn, hence in 0,1,\dots, m+n.

log

logical indication if the logarithm log(P) should be returned (instead of P).

Value

a numeric vector, with the length the maximum of the lengths of x, m, n, k.

Author(s)

Martin Maechler

References

See those in phyperBinMolenaar.

See Also

hyper2binomP(); R's own dhyper() which uses more sophisticated computations.

Examples

## The function is simply defined as
function (x, m, n, k, log = FALSE)
  dbinom(x, size = k, prob = hyper2binomP(x, m, n, k), log = log)

DPQ documentation built on Nov. 3, 2023, 5:07 p.m.