4.5 - Means and variances from PGFs

4.5 - Means and variances from PGFs

Differentiating a PGF changes its coefficients into weighted probabilities. You will see why the first derivative gives the mean, why the second derivative needs a correction, and how the two derivatives give the variance and determine unknown parameters.

The first derivative at one

Why should a derivative tell you the average value of a random variable? For a distribution with PGF GX(t)=14+12t+14t2G_X(t)=\tfrac14+\tfrac12t+\tfrac14t^2, differentiation brings each exponent down beside its probability:

GX′(t)=12+12t.G_X'(t)=\tfrac12+\tfrac12t.

At t=1t=1, the remaining powers become one. The result GX′(1)=1G_X'(1)=1 is exactly the weighted sum 0(14)+1(12)+2(14)0(\tfrac14)+1(\tfrac12)+2(\tfrac14).

For the general PGF, differentiate term by term:

GX(t)=p0+p1t+p2t2+p3t3+⋯GX′(t)=p1+2p2t+3p3t2+⋯GX′(1)=p1+2p2+3p3+⋯=E(X)\begin{aligned} G_X(t)&=p_0+p_1t+p_2t^2+p_3t^3+\cdots \\ G_X'(t)&=p_1+2p_2t+3p_3t^2+\cdots \\ G_X'(1)&=p_1+2p_2+3p_3+\cdots=\mathrm E(X) \end{aligned}

For infinite distributions, the relevant moment must exist. The standard PGFs used here can be differentiated near t=1t=1, so their derivatives there are finite.

Mean from a PGF

E(X)=GX′(1).\mathrm E(X)=G_X'(1).

Differentiate with respect to tt first, then substitute t=1t=1.

In the formula booklet.

Putting t=1t=1 first gives the constant GX(1)=1G_X(1)=1, which has lost the information that differentiation needs.

Worked example 1: a sparse polynomial

Question. Find the mean of XX, given

GX(t)=0.2+0.3t+0.5t3.G_X(t)=0.2+0.3t+0.5t^3.

Plan. Differentiate the PGF, then evaluate the derivative at one.

GX′(t)=0.3+1.5t2E(X)=GX′(1)=0.3+1.5=1.8\begin{aligned} G_X'(t)&=0.3+1.5t^2 \\ \mathrm E(X)&=G_X'(1)=0.3+1.5=1.8 \end{aligned}

Answer. E(X)=1.8\mathrm E(X)=1.8.

Check. Reading the distribution directly gives E(X)=0(0.2)+1(0.3)+3(0.5)=1.8\mathrm E(X)=0(0.2)+1(0.3)+3(0.5)=1.8. A non-integer mean is possible even though every outcome is an integer.

Now shift all outcomes up by one, leaving their probabilities unchanged. The mean should rise by one too.

Worked example 2: a shifted distribution

Question. Find the mean of YY, given

GY(t)=0.2t+0.3t2+0.5t4.G_Y(t)=0.2t+0.3t^2+0.5t^4.

Plan. Use the derivative at one and compare the result with the shift in possible values.

GY′(t)=0.2+0.6t+2t3E(Y)=GY′(1)=0.2+0.6+2=2.8\begin{aligned} G_Y'(t)&=0.2+0.6t+2t^3 \\ \mathrm E(Y)&=G_Y'(1)=0.2+0.6+2=2.8 \end{aligned}

Answer. E(Y)=2.8\mathrm E(Y)=2.8.

Check. Directly from the coefficients, the outcomes are 1,2,41,2,4, so the mean is 1(0.2)+2(0.3)+4(0.5)=2.81(0.2)+2(0.3)+4(0.5)=2.8. Equivalently, each outcome in Worked example 1 has increased by one, and 1.8+1=2.81.8+1=2.8.

The derivative method becomes particularly useful when a PGF has a compact factorised form and a long expansion. Keep that form and use the product or chain rule accurately.

Watch out

GX(1)=1G_X(1)=1 checks normalisation. GX′(1)G_X'(1) gives the mean. The prime changes the question being answered.

Try a distribution whose possible values have a different gap.

The second factorial moment

Differentiating twice does not bring down the square of each exponent. It brings down two successive factors:

GX′′(t)=2p2+3(2)p3t+4(3)p4t2+⋯GX′′(1)=∑r=0∞r(r−1)pr\begin{aligned} G_X''(t)&=2p_2+3(2)p_3t+4(3)p_4t^2+\cdots \\ G_X''(1)&=\sum_{r=0}^{\infty}r(r-1)p_r \end{aligned}

This is the expected value of X(X−1)X(X-1), called the second factorial moment. Since X2=X(X−1)+XX^2=X(X-1)+X, you recover the second ordinary moment by adding the mean.

Second moment from a PGF

Provided the second moment is finite,

GX′′(1)=E(X(X−1))E(X2)=GX′′(1)+GX′(1)\begin{aligned} G_X''(1)&=\mathrm E\bigl(X(X-1)\bigr) \\ \mathrm E(X^2)&=G_X''(1)+G_X'(1) \end{aligned}

The factorial-moment interpretation and this separate second-moment identity are not listed in the formula booklet; they explain the supplied variance formula.

For example, if X=1X=1, its contribution to X(X−1)X(X-1) is zero, while its contribution to X2X^2 is one. That missing contribution is part of what the added mean restores.

Worked example 3: four binomial trials

Question. A random variable XX has PGF GX(t)=(1+t)4/16G_X(t)=(1+t)^4/16. Find E(X(X−1))\mathrm E(X(X-1)) and E(X2)\mathrm E(X^2).

Plan. Differentiate twice, and add the first derivative at one to obtain the second ordinary moment.

GX′(t)=4(1+t)316GX′′(t)=12(1+t)216GX′(1)=2,GX′′(1)=3E(X2)=3+2=5\begin{aligned} G_X'(t)&=\frac{4(1+t)^3}{16} \\ G_X''(t)&=\frac{12(1+t)^2}{16} \\ G_X'(1)&=2,\qquad G_X''(1)=3 \\ \mathrm E(X^2)&=3+2=5 \end{aligned}

Answer. E(X(X−1))=3\mathrm E(X(X-1))=3 and E(X2)=5\mathrm E(X^2)=5.

Check. Expand the PGF to read probabilities 1,4,6,4,11,4,6,4,1, divided by 1616, on 0,1,2,3,40,1,2,3,4. Then

E(X2)=1(4)+4(6)+9(4)+16(1)16=8016=5.\mathrm E(X^2)=\frac{1(4)+4(6)+9(4)+16(1)}{16} =\frac{80}{16}=5.

Increase the number of trials by one, keeping the success probability at one half. The distinction between the two second moments remains the same.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account