My textbook did the derivation for the binomial distribution, but omitted the derivations for the Negative Binomial Distribution.
I know it is supposed to be similar to the Geometric, but it is not only limited to one success/failure. (i.e the way I understand it is that the negative binomial is the sum of independent geometric random variables). For example: $Y_1 +Y_2 +Y_3+\cdots $ where $Y_i$ is a geometric parameter. I can't seem to find online one for the negative binomial and am having trouble with even doing the geometric.
Can anyone show me a derivation of the negative binomial?
Edit: My book calls the negative binomial as the distribution of the number of trials needed to get a specified number r of successes.
The m.g.f. of a sum of independent random variables is just the product of their m.g.f.s, so $$ M_{Y_1+\cdots+Y_r}(t) = \left( M_{Y_1}(t) \right)^r. $$ \begin{align} M_{Y_1}(t) & = \operatorname E(e^{tY_1}) = \sum_{y=1}^\infty e^{ty} \Pr(Y_1=y) \\[10pt] & = \sum_{y=1}^\infty e^{ty} p(1-p)^{y-1} = \frac{p}{1-p} \sum_{y=1}^\infty \left(e^t(1-p)\right)^y \\[10pt] & = \frac{p}{1-p} \cdot \frac{\text{first term}}{1-\text{common ratio}} \\[10pt] & = \frac{p}{1-p}\cdot\frac{e^t(1-p)}{1-e^t(1-p)} \\[10pt] & = \frac{e^tp}{1-e^t(1-p)}. \end{align}
(Then remember to raise the whole thing to the power $r$.)