HyperGeometric {distributions3} | R Documentation |
Create a HyperGeometric distribution
Description
To understand the HyperGeometric distribution, consider a set of
objects, of which
are of the type I and
are of the type II. A sample with size
(
)
with no replacement is randomly chosen. The number of observed
type I elements observed in this sample is set to be our random
variable
. For example, consider that in a set of 20
car parts, there are 4 that are defective (type I).
If we take a sample of size 5 from those car parts, the
probability of finding 2 that are defective will be given by
the HyperGeometric distribution (needs double checking).
Usage
HyperGeometric(m, n, k)
Arguments
m |
The number of type I elements available. |
n |
The number of type II elements available. |
k |
The size of the sample taken. |
Details
We recommend reading this documentation on https://alexpghayes.github.io/distributions3/, where the math will render with additional detail and much greater clarity.
In the following, let be a HyperGeometric random variable with
success probability
p
= .
Support:
Mean:
Variance:
Probability mass function (p.m.f):
Cumulative distribution function (c.d.f):
Moment generating function (m.g.f):
Not useful.
Value
A HyperGeometric
object.
See Also
Other discrete distributions:
Bernoulli()
,
Binomial()
,
Categorical()
,
Geometric()
,
HurdleNegativeBinomial()
,
HurdlePoisson()
,
Multinomial()
,
NegativeBinomial()
,
Poisson()
,
ZINegativeBinomial()
,
ZIPoisson()
,
ZTNegativeBinomial()
,
ZTPoisson()
Examples
set.seed(27)
X <- HyperGeometric(4, 5, 8)
X
random(X, 10)
pdf(X, 2)
log_pdf(X, 2)
cdf(X, 4)
quantile(X, 0.7)