
Last chance! 50% off unlimited learning
Sale ends in
m
, n
and k
(named $Np$, $N-Np$, and
$n$, respectively in the reference below) is given by
rhyper
Hyper(m, n, k)
.
This object is a hypergeometric distribution."DiscreteDistribution"
, directly.
Class "UnivariateDistribution"
, by class "DiscreteDistribution"
.
Class "Distribution"
, by class "DiscreteDistribution"
.HyperParameter-class
DiscreteDistribution-class
Naturals-class
rhyper
H=Hyper(m=3,n=3,k=3) # H is a hypergeometric distribution with m=3,n=3,k=3.
r(H)(1) # one random number generated from this distribution, e.g. 2
d(H)(1) # Density of this distribution is 0.45 for x=1.
p(H)(1) # Probability that x<1 is 0.5.
q(H)(.1) # x=1 is the smallest value x such that p(H)(x)>=0.1.
m(H) # m of this distribution is 3.
m(H)=2 # m of this distribution is now 2.
Run the code above in your browser using DataLab