Tutorials › Statistical Theory I - Probability and Distribution Theory › Choosing PGFs or MGFs for Count-Moment Problems

Moments and Generating Functions · Tutorial 519 of 994

Choosing PGFs or MGFs for Count-Moment Problems

Choose the generating function that matches the moment you need, and verify that its derivatives are legitimate before using them.

Intermediate 10 min read

What You'll Learn

  • Distinguish raw moments from factorial moments for nonnegative integer-valued variables
  • Use PGF derivatives at the boundary to obtain factorial moments, including when an MGF does not exist near zero
  • Use an MGF to obtain raw moments when the required exponential integrability condition holds
  • Convert factorial moments into raw moments and check the resulting variance for consistency
  • Compare PGF and MGF calculations for binomial and geometric counts

Choosing the Right Generating Function

For a count \(N\), the choice between a probability generating function and a moment generating function is not just a matter of notation. A probability generating function (PGF) is naturally adapted to factorial moments, while an MGF is naturally adapted to raw moments. The PGF can remain useful even when the MGF is infinite for every positive argument.

The practical choice is to match the function to the quantity being requested, then check that the relevant derivatives and expectations are finite. This matters especially at the PGF’s boundary \(s=1\), and when a count has a heavy tail.

Definition: A count variable \(N\) is a random variable taking values in \(\{0,1,2,\ldots\}\). Its probability generating function is \(G(s)=E[s^N]\) for \(0\leq s\leq 1\). Its moment generating function is \(M(t)=E[e^{tN}]\) for real \(t\) where the expectation is finite. The \(r\)th falling factorial is \((N)_r=N(N-1)\cdots(N-r+1)\), with \((N)_0=1\). The \(r\)th raw moment is \(E[N^r]\); the \(r\)th factorial moment is \(E[(N)_r]\).

Since \(N\) is nonnegative, \(G(s)\) is finite for \(0\leq s\leq 1\). In contrast, an MGF is finite for \(t\leq 0\), but it may be infinite for every \(t>0\). When it is finite on a neighborhood of zero, differentiating the MGF at zero yields raw moments. Differentiating the PGF inside \(0<s<1\), then taking \(s\) up to 1, yields factorial moments.

PGF Derivatives Give Factorial Moments

Theorem: For an integer \(r\geq 1\) and \(0<s<1\), \(G^{(r)}(s)=E[(N)_r s^{N-r}\mathbf{1}_{\{N\geq r\}}]\). Consequently, \(\lim_{s\uparrow 1}G^{(r)}(s)=E[(N)_r]\), with the limit allowed to be \(+\infty\). If the factorial moment is finite, the boundary value \(G^{(r)}(1-)\), defined as this limit, equals \(E[(N)_r]\).

To prove the theorem, write the PGF as the power series \(G(s)=\sum_{n=0}^{\infty}P(N=n)s^n\). For \(0<s<1\), termwise differentiation is valid inside the radius of convergence, which is at least 1. Differentiating \(r\) times gives

$$ G^{(r)}(s)=\sum_{n=r}^{\infty}(n)_rP(N=n)s^{n-r}. $$

This is the stated expectation. As \(s\uparrow1\), each summand increases to \((n)_rP(N=n)\). The monotone convergence theorem therefore gives the limit, whether the resulting sum is finite or infinite. \(\square\)

The restriction to a boundary limit is useful: the PGF exists at \(s=1\), but it is not automatically legitimate to differentiate its power series there. The theorem specifies what the interior derivatives approach and precisely how that limit relates to the factorial moment.

Worked Example: A Binomial Count

Let \(N\sim\operatorname{Bin}(5,0.3)\), the number of successes in five independent trials, each with success probability \(0.3\). Its PGF is \(G(s)=(0.7+0.3s)^5\).

Differentiate once: \(G'(s)=5(0.3)(0.7+0.3s)^4\), so \(E[N]=G'(1)=5(0.3)=1.5\).

Differentiate twice: \(G''(s)=5\cdot4(0.3)^2(0.7+0.3s)^3\), so \(E[(N)_2]=G''(1)=20(0.09)=1.8\).

Because \((N)_2=N(N-1)=N^2-N\), \(N^2=(N)_2+N\). Therefore \(E[N^2]=1.8+1.5=3.3\), and \(\operatorname{Var}(N)=E[N^2]-(E[N])^2=3.3-1.5^2=3.3-2.25=1.05\). The variance is nonnegative, as required.

Here the PGF makes factorial moments immediate. The MGF \(M(t)=(0.7+0.3e^t)^5\) is also finite for every real \(t\), so it can be used to obtain raw moments directly. The better choice depends on which moment the problem asks for.

Converting Factorial Moments to Raw Moments

The PGF does not give raw moments directly, but the two kinds of moments are related by polynomial identities. The first few are

$$ N^2=(N)_2+N,\qquad N^3=(N)_3+3(N)_2+N. $$

More generally, let \(S(k,j)\) denote a Stirling number of the second kind, the number of ways to partition \(k\) labelled objects into \(j\) nonempty unlabelled groups. Then

Theorem: For every nonnegative integer \(k\) and every nonnegative integer \(N\), \(N^k=\sum_{j=0}^{k}S(k,j)(N)_j\), where \(S(0,0)=1\) and \(S(k,0)=0\) for \(k>0\). Consequently, \(E[N^k]=\sum_{j=0}^{k}S(k,j)E[(N)_j]\), with equality also valid for nonnegative extended expectations.

For a proof, fix an integer \(n\geq0\). The number of functions from a set of \(k\) labelled objects to a set of \(n\) possible values is \(n^k\). Count these functions by the size \(j\) of their image. First choose the \(j\) image values and then assign the \(k\) objects onto all \(j\) chosen values. There are \(\binom{n}{j}j!S(k,j)=(n)_jS(k,j)\) such functions. Summing over \(j\) proves \(n^k=\sum_{j=0}^{k}S(k,j)(n)_j\). Substituting the count variable \(N\) gives the pointwise identity. Taking expectations proves the stated moment identity because all terms are nonnegative. \(\square\)

For example, the \(k=2\) identity recovers the variance from two PGF derivatives: \(\operatorname{Var}(N)=E[(N)_2]+E[N]-(E[N])^2\). This is also a quick consistency check: proposed first and second factorial moments cannot imply a negative variance.

When an MGF Is the Convenient Choice

If \(M(t)\) is finite on an open interval containing zero, then its \(r\)th derivative at zero equals \(E[N^r]\), for each nonnegative integer \(r\). For a nonnegative count, it is enough that \(M(a)<\infty\) for some \(a>0\): for \(t\leq0\), \(e^{tN}\leq1\), and for \(0<t<a\), \(e^{tN}\leq e^{aN}\). Thus the MGF is finite on an interval around zero. Under this condition, differentiation under the expectation is justified: on a smaller interval, \(N^r e^{tN}\) is bounded by a constant times \(e^{aN}\), which is integrable. This is the relevant finiteness check when using an MGF for raw moments.

Worked Example: A Geometric Count

Let \(N\) have the geometric distribution on \(\{0,1,2,\ldots\}\) with \(P(N=k)=p(1-p)^k\), where \(p=1/4\). Write \(q=1-p=3/4\). Summing the geometric series gives \(G(s)=p/(1-qs)\) for \(0\leq s\leq1\).

The MGF is \(M(t)=p/(1-qe^t)\) when \(qe^t<1\), or \(t<-\log q=\log(4/3)\). In particular, it is finite on a neighborhood of zero, so its derivatives there give raw moments. Differentiation gives \(M'(t)=pqe^t/(1-qe^t)^2\), hence \(E[N]=M'(0)=pq/(1-q)^2=q/p=3\).

A second differentiation gives \(M''(0)=q/p+2q^2/p^2=3+2(0.75)^2/(0.25)^2=3+18=21\). Therefore \(\operatorname{Var}(N)=21-3^2=12\).

The PGF gives the factorial moment directly: \(G''(s)=2pq^2/(1-qs)^3\), so \(E[(N)_2]=G''(1)=2q^2/p^2=18\). The conversion check agrees: \(E[N^2]=E[(N)_2]+E[N]=18+3=21\).

When the PGF Works but the MGF Does Not

An MGF’s failure to exist for positive \(t\) does not imply that moments are unavailable. A PGF can still yield factorial moments through its boundary derivatives, provided those moments are finite. The following count has finite first and second raw moments but no positive-argument MGF.

Worked Example: A Heavy-Tailed Count With Finite Second Moment

For integers \(n\geq1\), define \(P(N=n)=1/(\zeta(4)n^4)\), where \(\zeta(r)=\sum_{n=1}^{\infty}n^{-r}\). These probabilities sum to one. For \(r=1,2\), \(E[N^r]=\zeta(4)^{-1}\sum_{n=1}^{\infty}n^{r-4}=\zeta(4-r)/\zeta(4)\), so both moments are finite: \(E[N]=\zeta(3)/\zeta(4)\) and \(E[N^2]=\zeta(2)/\zeta(4)\).

Its second factorial moment is therefore \(E[(N)_2]=E[N^2]-E[N]=[\zeta(2)-\zeta(3)]/\zeta(4)\), also finite. The PGF’s first two boundary derivatives recover these finite moments (the second factorial moment and the mean).

For any \(t>0\), the terms in \(M(t)=\sum_{n=1}^{\infty}e^{tn}/(\zeta(4)n^4)\) do not even tend to zero: \(e^{tn}/n^4\to\infty\). Hence \(M(t)=\infty\) for every positive \(t\). The MGF cannot be differentiated on an interval around zero to obtain raw moments, but the PGF still describes the count and provides its finite factorial moments.

A Practical Decision Rule and Common Pitfall

Use the PGF when the requested quantities are factorial moments, or when an MGF’s positive-argument finiteness is uncertain. Use the MGF for raw moments when it is finite on a neighborhood of zero; it gives \(E[N^r]\) by direct differentiation. If the PGF is used to find raw moments, convert through the factorial-moment identities and check the resulting variance.

1
Identify the target.
For \(E[(N)_r]\), start with the PGF. For \(E[N^r]\), an MGF is direct if its finiteness condition holds.
2
Check the domain.
For an MGF calculation, verify that \(M(t)\) is finite for some positive \(t\), so it is finite near zero. For a PGF calculation at \(s=1\), use the boundary-limit result and check whether the relevant factorial moment is finite.
3
Convert and verify.
Use \(N^2=(N)_2+N\) when needed, then compute \(\operatorname{Var}(N)=E[N^2]-(E[N])^2\). A negative result signals an error or inconsistent proposed moments.

Common pitfall: A solver may assume that every count has an MGF near zero simply because its PGF exists on \([0,1]\), then differentiate \(M(t)\) at zero without checking positive \(t\). This is wrong: a PGF is bounded on that interval, whereas the MGF weights large counts by \(e^{tN}\), which can make its expectation infinite. Check the MGF’s domain before differentiating; if it is not finite near zero, use PGF boundary derivatives for the factorial moments that exist and convert only as far as those moments allow.

Key takeaway: PGFs are tailored to factorial moments, and MGFs are tailored to raw moments when their domain permits differentiation near zero. The functions are related, but their finiteness conditions are not interchangeable.

Check Your Understanding

For each question, identify which generating function is appropriate and state any needed finiteness check.

  1. For a count \(N\), which derivative of its PGF gives \(E[N(N-1)]\), and at what value is the boundary limit taken?
  2. If \(E[N]=3\) and \(E[(N)_2]=18\), calculate \(E[N^2]\) and \(\operatorname{Var}(N)\).
  3. What condition on an MGF allows its derivatives at zero to give raw moments of a nonnegative count?
  4. Why can a PGF yield finite factorial moments even if the MGF is infinite for every positive argument?
  5. For \(N\sim\operatorname{Bin}(5,0.3)\), use the PGF to calculate \(E[(N)_2]\), then recover \(E[N^2]\) from the mean.