View source: R/hypergeometric_distribution.R
| hypergeometric_distribution | R Documentation |
Functions to compute the probability density function, cumulative distribution function, and quantile function for the Hypergeometric distribution.
hypergeometric_distribution(r, n, N)
hypergeometric_pdf(x, r, n, N)
hypergeometric_lpdf(x, r, n, N)
hypergeometric_cdf(x, r, n, N)
hypergeometric_lcdf(x, r, n, N)
hypergeometric_quantile(p, r, n, N)
r |
number of successes in the population (r >= 0) |
n |
number of draws (n >= 0) |
N |
population size (N >= r) |
x |
quantile (non-negative integer) |
p |
probability (0 <= p <= 1) |
A single numeric value with the computed probability density, log-probability density, cumulative distribution, log-cumulative distribution, or quantile depending on the function called.
Boost Documentation for more details on the mathematical background.
# Hypergeometric distribution with r = 5, n = 10, N = 20
dist <- hypergeometric_distribution(5, 10, 20)
# Apply generic functions
cdf(dist, 4)
logcdf(dist, 4)
pdf(dist, 4)
logpdf(dist, 4)
hazard(dist, 4)
chf(dist, 4)
mean(dist)
median(dist)
mode(dist)
range(dist)
quantile(dist, 0.2)
standard_deviation(dist)
support(dist)
variance(dist)
skewness(dist)
kurtosis(dist)
kurtosis_excess(dist)
# Convenience functions
hypergeometric_pdf(3, 5, 10, 20)
hypergeometric_lpdf(3, 5, 10, 20)
hypergeometric_cdf(3, 5, 10, 20)
hypergeometric_lcdf(3, 5, 10, 20)
hypergeometric_quantile(0.5, 5, 10, 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.