Learn R Programming

hint (version 0.1-1)

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, sims = 10000, Na = NULL)

Arguments

n
An integer specifying the number of categories in the urns.
A
A vector of integers specifying the samples to be taken from each urn. The length of the vector equals the number of urns.
sims
An integer specifying the number of replicate draws for the simulation. Defaults to 10,000.
Na
A list of integer vectors specifying the number of balls in each category for each 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 argument.

References

Kalinka, A.T. (2013). The probability of drawing intersections: extending the hypergeometric distribution. arXiv.1305.0717

See Also

Hyperintersection, hint.test.

Examples

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

Run the code above in your browser using DataLab