BiasedUrn-package {BiasedUrn} | R Documentation |

## Biased Urn Model Distributions

### Description

Statistical models of biased sampling in the form of univariate and multivariate noncentral hypergeometric distributions, including Wallenius' noncentral hypergeometric distribution and Fisher's noncentral hypergeometric distribution (also called extended hypergeometric distribution).

These are distributions that you can get when taking colored balls from an urn without replacement, with bias. The univariate distributions are used when there are two colors of balls. The multivariate distributions are used when there are more than two colors of balls.

The (central) univariate and multivariate hypergeometric distribution
can be obtained by setting `odds`

= 1.

Please see `vignette("UrnTheory")`

for a definition of these distributions and how
to decide which distribution to use in a specific case.

### Details

Package: | BiasedUrn |

Type: | Package |

Version: | 2.0.12 |

Date: | 2024-06-16 |

License: | GPL-3 |

**Univariate functions in this package**

Wallenius' noncentral hypergeometric | Fisher's noncentral hypergeometric | |

Probability mass function | dWNCHypergeo | dFNCHypergeo |

Cumulative distribution function | pWNCHypergeo | pFNCHypergeo |

Quantile function | qWNCHypergeo | qFNCHypergeo |

Random variate generation function | rWNCHypergeo | rFNCHypergeo |

Calculate mean | meanWNCHypergeo | meanFNCHypergeo |

Calculate variance | varWNCHypergeo | varFNCHypergeo |

Calculate mode | modeWNCHypergeo | modeFNCHypergeo |

Estimate odds from mean | oddsWNCHypergeo | oddsFNCHypergeo |

Estimate number from mean and odds | numWNCHypergeo | numFNCHypergeo |

Minimum x | minHypergeo | minHypergeo |

Maximum x | maxHypergeo | maxHypergeo |

**Multivariate functions in this package**

Wallenius' noncentral hypergeometric | Fisher's noncentral hypergeometric | |

Probability mass function | dMWNCHypergeo | dMFNCHypergeo |

Random variate generation function | rMWNCHypergeo | rMFNCHypergeo |

Calculate mean | meanMWNCHypergeo | meanMFNCHypergeo |

Calculate variance | varMWNCHypergeo | varMFNCHypergeo |

Calculate mean and variance | momentsMWNCHypergeo | momentsMFNCHypergeo |

Estimate odds from mean | oddsMWNCHypergeo | oddsMFNCHypergeo |

Estimage number from mean and odds | numMWNCHypergeo | numMFNCHypergeo |

Minimum x | minMHypergeo | minMHypergeo |

Maximum x | maxMHypergeo | maxMHypergeo |

### Note

The implementation cannot run safely in multiple threads simultaneously

### Author(s)

Agner Fog

Maintainer: Agner Fog <agner@agner.org>

### References

Fog, A. 2008a. Calculation methods for Wallenius' noncentral hypergeometric distribution. *Communications in Statisticsâ€”Simulation and Computation* **37**, 2 doi:10.1080/03610910701790269

Fog, A. 2008b. Sampling methods for Wallenius' and Fisher's noncentral hypergeometric distributions. *Communications in Statisticsâ€”Simulation and Computation* **37**, 2 doi:10.1080/03610910701790236

### See Also

`BiasedUrn-Univariate`

.

`BiasedUrn-Multivariate`

.

`vignette("UrnTheory")`

`demo(CompareHypergeo)`

`demo(ApproxHypergeo)`

`demo(OddsPrecision)`

`demo(SampleWallenius)`

`dhyper`

`fisher.test`

### Examples

```
dWNCHypergeo(12, 25, 32, 20, 2.5)
```

*BiasedUrn*version 2.0.12 Index]