-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Family: Negative Binomial (Pascal)
Naming: NegativeBinomial (negative binomial distribution in the “number of failures before r-th success” parametrization).
Task
Implement the negative binomial family as a ParametricFamily, add all parameterizations and analytical characteristics, and register the family in the registry.
Base parameterization
- Base parameters:
(r, p):r > 0(shape / number of successes, not necessarily integer if using the general form),0 < p < 1(success probability).
Interpretation: X is the number of failures before the r-th success.
Support: k in {0, 1, 2, …}.
Other parameterizations and relations
- Shape–mean
(r, μ):- Parameters:
r > 0,μ > 0(mean). - Relations to base:
μ = r * (1 - p) / pp = r / (r + μ).
- Parameters:
All characteristics should be defined in terms of (r, p).
Analytical characteristics (in terms of r, p)
For integer k >= 0:
-
pmf(k):- General (Gamma–function) form:
pmf(k) = Γ(k + r) / (Γ(r) * k!) * (1 - p)^k * p^r.
Ifris integer, this isC(k + r - 1, k) * (1 - p)^k * p^r.
- General (Gamma–function) form:
-
cdf(k):cdf(k) = sum_{j=0}^k pmf(j).
It can also be expressed via the regularized incomplete beta function.
-
ppf(u)for0 < u < 1:ppf(u)is the smallest integerk >= 0such thatcdf(k) >= u.
-
cf(t):cf(t) = (p / (1 - (1 - p) * exp(i * t)))^r.
-
mean:mean = r * (1 - p) / p.
-
var:var = r * (1 - p) / p^2.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status