Generating & Characteristic Functions

recovering moments and probabilities from the pgf

Storing a distribution inside the pgf G_X(s) is only useful if you can get the information back out. The lovely thing is that two completely different kinds of facts — the individual probabilities P(X = k), and the moments like the mean and variance — fall out of the very same function, just by differentiating it and reading it at the right point. Think of the pgf as a locked cabinet, and differentiation as two different keys to two different drawers.

First drawer, the probabilities. Since G_X(s) = P(X=0) + P(X=1)s + P(X=2)s^2 + ..., setting s = 0 leaves only the constant term, so G_X(0) = P(X = 0). Differentiate once and set s = 0 and you peel off the next coefficient: P(X = 1) = G_X'(0). In general P(X = k) = G_X^(k)(0)/k!, exactly the Taylor-coefficient rule from calculus. Second drawer, the moments, but read at s = 1 instead of 0. Because differentiating s^k gives k s^(k-1), evaluating G_X'(1) = sum of k P(X = k) = E[X]. Differentiating again, G_X''(1) = E[X(X - 1)], the second factorial moment. From these two you assemble the variance: Var(X) = G_X''(1) + G_X'(1) - (G_X'(1))^2.

So one function quietly holds the entire distribution: derivatives at 0 hand back the probabilities one by one, derivatives at 1 hand back the moments. The mild catch is that the derivatives at 1 give factorial moments E[X(X-1)...(X-k+1)] rather than the raw moments E[X^k] directly, so you do a small algebra step to convert — but for the mean and variance, the two most-wanted numbers, the conversion is short and standard.

For X ~ Poisson(lambda), G_X(s) = e^(lambda(s-1)). Then G_X'(s) = lambda e^(lambda(s-1)), so G_X'(1) = lambda = E[X]. And G_X''(1) = lambda^2 = E[X(X-1)], giving Var(X) = lambda^2 + lambda - lambda^2 = lambda — recovering the famous fact that a Poisson's mean and variance are both lambda.

Derivatives at s = 0 give the probabilities; derivatives at s = 1 give the (factorial) moments.

Derivatives at 1 give factorial moments E[X(X-1)...], not the raw moments E[X^k] directly — convert with a small algebra step. The variance formula Var(X) = G''(1) + G'(1) - (G'(1))^2 already does this for you.

Also called
pgf derivativesfactorial moments from the pgf從 pgf 還原機率