Theorem: Second Derivative of PGF of Negative Binomial Distribution/Type 1

Let $X$ be a discrete random variable with the type $1$ negative binomial distribution with parameters $n$ and $p$.
Then the second derivative of the PGF of $X$ {{WRT|Differentiation}} $s$ is:
:$\dfrac {\d^2} {\d s^2} \map {\Pi_X} s = \paren {\dfrac {p s} {1 - q s} }^{n + 2} \paren {\dfrac {n \paren {n - 1} + 2 n q s} {\paren {p s^2}^2} }$

Proof:
The Probability Generating Function of Negative Binomial Distribution (Type 1) is:
:$\map {\Pi_X} s = \paren {\dfrac {p s} {1 - q s} }^n$
We have that for a given negative binomial distribution, $n, p$ and $q$ are constant.
From First Derivative of PGF of Negative Binomial Distribution (Type 1):
{{begin-eqn}}
{{eqn | l = \frac \d {\d s} \map {\Pi_X} s
      | r = n p \paren {\dfrac {\paren {p s}^{n - 1} } {\paren {1 - q s}^{n + 1} } }
      | c = 
}}
{{eqn | r = \frac n {p s^2} \paren {\frac {p s} {1 - q s} }^{n + 1}
      | c = 
}}
{{end-eqn}}
Thus we have:
{{begin-eqn}}
{{eqn | l = \frac {\d^2} {\d s^2} \map {\Pi_X} s
      | r = \map {\frac \d {\d s} } {\frac n {p s^2} \paren {\frac {p s} {1 - q s} }^{n + 1} }
      | c =
}}
{{eqn | r = \frac n {p s^2} \map {\frac \d {\d s} } {\paren {\frac {p s} {1 - q s} }^{n + 1} } + \map {\frac \d {\d s} } {\frac n {p s^2} } \paren {\frac {p s} {1 - q s} }^{n + 1}
      | c = Product Rule for Derivatives
}}
{{eqn | r = \frac n {p s^2} \paren {\frac {n + 1} {p s^2} \paren {\frac {p s} {1 - q s} }^{n + 2} } + \map {\frac \d {\d s} } {\frac n {p s^2} } \paren {\frac {p s} {1 - q s} }^{n + 1}
      | c = First Derivative of PGF of Negative Binomial Distribution (Type 1)
}}
{{eqn | r = \frac n {p s^2} \paren {\frac {n + 1} {p s^2} \paren {\frac {p s} {1 - q s} }^{n + 2} } + \paren {\frac {- 2 n} {p s^3} } \paren {\frac {p s} {1 - q s} }^{n + 1}
      | c = Power Rule for Derivatives where $n = -2$
}}
{{eqn | r = \frac {n \paren {n + 1} } {p^2 s^4} \paren {\frac {p s} {1 - q s} }^{n + 2} + \paren {\frac {- 2 n} {p s^3} } \paren {\frac {p s} {1 - q s} }^{n + 1}
      | c = dismayingly messy algebra
}}
{{eqn | r = \paren {\frac {p s} {1 - q s} }^{n + 1} \paren {\frac {n \paren {n + 1} } {p s^3} \paren {\frac 1 {1 - q s} } + \paren {\frac {- 2 n} {p s^3} } }
      | c =
}}
{{eqn | r = \paren {\frac {p s} {1 - q s} }^{n + 1} \paren {\frac {n \paren {n + 1} - 2 n \paren {1 - q s} } {p s^3 \paren {1 - q s} } }
      | c =
}}
{{eqn | r = \paren {\frac {p s} {1 - q s} }^{n + 1} \paren {\frac {n^2 + n - 2 n + 2 n q s} {p s^3 \paren {1 - q s} } }
      | c =
}}
{{eqn | r = \paren {\frac {p s} {1 - q s} }^{n + 1} \paren {\frac {n^2 - n + 2 n q s} {p s^3 \paren {1 - q s} } }
      | c =
}}
{{eqn | r = \paren {\frac {p s} {1 - q s} }^{n + 1} \paren {\frac {n \paren {n - 1} + 2 n q s} {p s^3 \paren {1 - q s} } }
      | c =
}}
{{eqn | r = \paren {\frac {p s} {1 - q s} }^{n + 2} \paren {\frac {n \paren {n - 1} + 2 n q s} {p^2 s^4} }
      | c = multiplying top and bottom by $p s$ and gathering terms
}}
{{eqn | r = \paren {\frac {p s} {1 - q s} }^{n + 2} \paren {\frac {n \paren {n - 1} + 2 n q s} {\paren {p s^2}^2} }
      | c = final tidy up
}}
{{end-eqn}}
{{qed}}
{{proofread}}
Category:Second Derivative of PGF of Negative Binomial Distribution
Category:Negative Binomial Distribution (Type 1)
Category:Derivatives of PGFs
9l8bessii21u4ji805u7almi3lxeild