On Moment Generating Functions and Variance

Relmiw

New member
Joined
Feb 12, 2012
Messages
7
Just a warning, I may use improper terms here. If you think I'm explaining something wrong, it's quite possible that I am. Just let me know.
I'm trying to calculate the second moment for a binomial distribution. E(y^2), where Y ~ Binom.
I have two different methods, both of which I believe should work, but I'm getting different results. Could someone help me find which one I've done incorrectly?

V(Y) = E(y^2) - E(y)^2
==> npq = E(y^2) - (np)^2
==> E(y^2) = np(q + np)

The second method I'm using is with the second moment of the moment generating function.
My thinking is that if I take the MGF for the binomial distribution, take its derivative, and set t = 0, I should get E(y^2)

mgf = (p*e^t + q)^n
mgf(first derivative) = n*p*e^t*(p*e^t + q)^(n-1)
mgf(first derivative, t = 0) = n*p*(p + q)^(n-1)
mgf(first derivative, t = 0) = n*p

Obviously these both can't be right. I'm thinking the first one is correct, but where did I mess up?
 
I didn't check your work real closely, yet. Let's try a little exercise, first.

Find \(\displaystyle \frac{d(mgf)}{dt}\) rather than \(\displaystyle \frac{d(mgf)}{dn}\)
 
I didn't check your work real closely, yet. Let's try a little exercise, first.

Find \(\displaystyle \frac{d(mgf)}{dt}\) rather than \(\displaystyle \frac{d(mgf)}{dn}\)

Didn't I take the derivative with respect to t already?
I would think d(mgf)/dn would be

(p*e^t + q)^n * log((p*e^t + q)^n)
 
Ohh, I get it. Solving for t = 1 on the first derivative is the first moment. This is the expected value of y, which is of course p*n
I should be taking the second derivative for E(y^2)
 
Top