
Last chance! 50% off unlimited learning
Sale ends in
m
, n
, and k
.
[Distribution] -- Hypergeometric.udhyper(m, n, k, lb=max(0,k-n), ub=min(k,m))
"unuran.discr"
.m
, n
and k
(named $Np$, $N-Np$, and
$n$, respectively in the reference below) is given by
The domain of the distribution can be truncated to the
interval (lb
,ub
).
## Create distribution object for Hypergeometric distribution
dist <- udhyper(m=15,n=5,k=7)
## Generate generator object; use method DGT (inversion)
gen <- dgtd.new(dist)
## Draw a sample of size 100
x <- ur(gen,100)
Run the code above in your browser using DataLab