Learn R Programming

hint (version 0.1-0)

sim.hypint: Simulating Intersection Sizes

Description

This function simulates the drawing of balls from two urns to generate distributions of intersection sizes.

Usage

sim.hypint(n, a, b, sims = 10000, Na = rep(1, n), Nb = rep(1, n))

Arguments

n
An integer specifying the number of categories in the urns.
a
An integer specifying the number of balls drawn from the first urn.
b
An integer specifying the number of balls drawn from the second urn.
sims
An integer specifying the number of replicate draws for the simulation. Defaults to 10,000.
Na
A vector of integers specifying the number of balls in each category for the first urn.
Nb
A vector of integers specifying the number of balls in each category for the second urn.

Value

  • An integer vector of length sims giving intersection sizes for all replicates of the simulation.

Details

The simulation allows any number of balls in each of the n categories via the Na and Nb arguments.

References

Kalinka, A.T. (2013). The probability of drawing intersections: extending the hypergeometric distribution. http://arxiv.org/abs/1305.0717{arXiv.1305.0717}

See Also

Hyperintersection, hint.test.

Examples

Run this code
nn <- sim.hypint(108, 54, 73, sims = 10)

Run the code above in your browser using DataLab