phyperBin: HyperGeometric Distribution via Approximate Binomial...

phyperBinR Documentation

HyperGeometric Distribution via Approximate Binomial Distribution

Description

Compute hypergeometric cumulative probabilities via (good) binomial distribution approximations. The arguments of these functions are exactly those of R's own phyper().

Usage

phyperBin.1(q, m, n, k, lower.tail = TRUE, log.p = FALSE)
phyperBin.2(q, m, n, k, lower.tail = TRUE, log.p = FALSE)
phyperBin.3(q, m, n, k, lower.tail = TRUE, log.p = FALSE)
phyperBin.4(q, m, n, k, lower.tail = TRUE, log.p = FALSE)

Arguments

q

vector of quantiles representing 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 must be in 0,1,\dots, m+n.

lower.tail

logical; if TRUE (default), probabilities are P[X \le x], otherwise, P[X > x].

log.p

logical; if TRUE, probabilities p are given as log(p).

Details

TODO

Value

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

Author(s)

Martin Maechler

See Also

phyper, pbinom

Examples

## The 1st function is
function (q, m, n, k, lower.tail = TRUE, log.p = FALSE)
  pbinom(q, size = k, prob = m/(m + n), lower.tail = lower.tail,
         log.p = log.p)

DPQ documentation built on Sept. 11, 2024, 8:37 p.m.