Loading [MathJax]/jax/input/TeX/config.js
scipy 1.10.1 Pypi GitHub Homepage
Other Docs

NotesBackRef

Wallenius' noncentral hypergeometric distribution models drawing objects of two types from a bin. M is the total number of objects, n is the number of Type I objects, and odds is the odds ratio: the odds of selecting a Type I object rather than a Type II object when there is only one object of each type. The random variate represents the number of Type I objects drawn if we draw a pre-determined N objects from a bin one by one.

%(before_notes)s

Notes

Let mathematical symbols N, n, and M correspond with parameters N, n, and M (respectively) as defined above.

The probability mass function is defined as

p(x; N, n, M) = \binom{n}{x} \binom{M - n}{N-x} \int_0^1 \left(1-t^{\omega/D}\right)^x\left(1-t^{1/D}\right)^{N-x} dt

for x \in [x_l, x_u], M \in {\mathbb N}, n \in [0, M], N \in [0, M], \omega > 0, where x_l = \max(0, N - (M - n)), x_u = \min(N, n),

D = \omega(n - x) + ((M - n)-(N-x)),

and the binomial coefficients are defined as

\binom{n}{k} \equiv \frac{n!}{k! (n - k)!}.

nchypergeom_wallenius uses the BiasedUrn package by Agner Fog with permission for it to be distributed under SciPy's license.

The symbols used to denote the shape parameters (N, n, and M) are not universally accepted; they are chosen for consistency with hypergeom.

Note that Wallenius' noncentral hypergeometric distribution is distinct from Fisher's noncentral hypergeometric distribution, which models take a handful of objects from the bin at once, finding out afterwards that N objects were taken. When the odds ratio is unity, however, both distributions reduce to the ordinary hypergeometric distribution.

%(after_notes)s

A Wallenius' noncentral hypergeometric discrete random variable.

See Also

hypergeom
nchypergeom_fisher
nhypergeom

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.stats._discrete_distns:nchypergeom_fisher_gen scipy.stats._discrete_distns:nchypergeom_wallenius_gen

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

nhypergeomnhypergeomscipy.stats._discrete_distns:nchypergeom_fisher_gen_discrete_distns:nchypergeom_fisher_genhypergeomhypergeom

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/stats/_discrete_distns.py#1727
type: <class 'type'>
Commit: