# How should you express a negative binomial distribution in an exponential family form?

When $X$ is $X_1$,…$X_n$, how do you express the following negative binomial distribution in an exponential family form?

Warning: The negative binomial distribution has several alternative formulations for which the formulas below change.

A distribution $f(x;\theta)$ belongs to an exponential family if it can be represented in the form:

The value $\eta$ is called the canonical (natural) parameter of the family, $T(x)$ is a sufficient statistic for $p$, $A(\theta)$ is called the log-partition function (it’s a normalization factor and sometimes called log-normalizer or cumulant generating function), and $h(x)$ is an arbitrary function called base measure or carrier measure which is 1 in many cases (e.g. exponential distribution, gamma distribution, Bernoulli distribution, …). If the negative binomial distribution with known parameter $r$ (if $r$ is unknown, the negative binomial family is not an exponential family) has the following distribution:

Then it can be rewritten in exponential form as:

So the parameter $\theta$ of the distribution is $p$ (i.e. $\theta=p$) and the natural parameter is $\eta=\ln(p)$, the sufficient statistic for $p$ is $T(k)=k$ (i.e. $T(k)=\sum X_{i}$, the sample sum), the log-partition function is $A(\eta)=-r\ln(1-p)$ and $h(k)=\binom{k+r-1}{k}$. See for example the Wikipedia page for a nice overview of the theory and many common distributions. Nice references can also be found here and here.