Learn R Programming

boostmath (version 1.0.0)

hypergeometric_distribution: Hypergeometric Distribution Functions

Description

Functions to compute the probability density function, cumulative distribution function, and quantile function for the Hypergeometric distribution.

Usage

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)

Value

A single numeric value with the computed probability density, log-probability density, cumulative distribution, log-cumulative distribution, or quantile depending on the function called.

Arguments

x

quantile (non-negative integer)

r

number of successes in the population (r >= 0)

n

number of draws (n >= 0)

N

population size (N >= r)

p

probability (0 <= p <= 1)

See Also

Boost Documentation for more details on the mathematical background.

Examples

Run this code
# Hypergeometric distribution with r = 5, n = 10, N = 20
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)

Run the code above in your browser using DataLab