Negative binomial exponential family (source code)

= Negative binomial exponential family

For fixed positive integer $r$, the failures-before-the-$r$th-success distribution is a one-parameter exponential family with
$$
\theta=\log(1-p)<0,
\quad
T(x)=x,
\quad
A(\theta)=-r\log(1-e^\theta),
$$
and carrier $h(x)=\binom{x+r-1}{x}$.