Negative multinomial distribution (source code)

= Negative multinomial distribution
{wiki}

Counts of several categories before a fixed number of stopping-category outcomes have a negative <multinomial distribution>. For one stopping outcome of <probability> $r=1-\alpha-\beta$, the two-count mass <function> is $r\binom{x+y}{x}\alpha^x\beta^y$. Its <probability generating function> is $r/(1-\alpha s-\beta t)$ and its <means> are $\alpha/r$ and $\beta/r$.