According to the textbook I use, it states that:
$X$~$Neg.bin(x;k,\theta) = {n-1 \choose k-1}\theta^k(1-\theta)^{n-k}$
Which I have no problem. The problem arises when I try to find the moment generating function. I know the procedure, I just can't compute it. I've seen many other solutions - I could follow them, but my equation is too 'different' from them and their solutions won't easily work in this case.
Can you help me with the computation? also, if possible, can you show me how to derive the mean and variance from the resulting MGF? Thank you in advance
Let $\mathbb P(X=n) = \binom{n-1}{k-1}\theta^k(1-\theta)^{n-k}$ for $n=k,k+1,\ldots$. Then the moment generating function of $X$ is given by \begin{align} M_X(t) :&= \mathbb E[e^{tX}]\\ &= \sum_{n=k}^\infty e^{tn}\cdot\mathbb P(X=n)\\ &= \sum_{n=k}^\infty e^{tn}\binom{n-1}{k-1}\theta^k(1-\theta)^{n-k}\\ &= \theta^k e^{tk} \sum_{n=k}^\infty \binom{n-1}{k-1}((1-\theta)e^t)^{n-k}\\ &= \frac{\theta^k e^{tk}}{(1-(1-\theta)e^t)^k}\\ &= \left(\frac{\theta e^t}{(1-(1-\theta)e^t)}\right)^k, \end{align} where the sum converges for all $t\in\mathbb R$. Recall that the $n^{\mathrm{th}}$ moment of $X$ is given by $\lim_{t\to0}\frac{\mathsf d^n}{\mathsf dt^n}M_t(X)$. Differentiating $M_t$, we have $$ M_X'(t) = \frac{k \theta ^k e^{k t}}{\left((\theta -1) e^t+1\right)^{k+1}}\stackrel{t\to 0}\longrightarrow \frac k\theta = \mathbb E[X], $$ and further $$ M_X''(t) = \frac{k e^{k t} \left(k-(\theta -1) e^t\right)}{((\theta -1) e^t+1)^{k+2}}\stackrel{t\to 0}\longrightarrow \frac{k (-\theta +k+1)}{\theta ^2} = \mathbb E[X^2]. $$ Hence $$ \operatorname{Var}(X) = \mathbb E[X^2] - \mathbb E[X]^2 = \frac{k (-\theta +k+1)}{\theta ^2} - \left(\frac k\theta\right)^2 = \frac{k(1-\theta)}{\theta ^2}. $$