St · Statistics & Probability

How to Find a Joint Moment-Generating Function

Published By the 9to5Science editorial team

At a glance

  1. 1. Start with the definition

    For random variables X and Y, use M(s,t) = E[exp(sX + tY)].

  2. 2. Use the joint distribution

    Sum over joint probabilities for discrete variables, or integrate the joint density for continuous variables.

  3. 3. Keep dependence

    Do not multiply marginal moment-generating functions unless X and Y are independent.

  4. 4. State where it exists

    Give the values of s and t for which the expectation is finite, especially near the origin.

  5. 5. Check derivatives

    Differentiate at (0,0) to recover moments such as E[X], E[Y], and E[XY].

Advertisement

A joint moment-generating function (MGF) packages information about two or more random variables. For XX and YY, it uses both variables at once, so it reflects their dependence as well as their individual distributions. The method is direct: take the expectation of an exponential involving each variable, using the joint distribution.

Definition

The joint MGF of XX and YY is

MX,Y(s,t)=E[esX+tY],M_{X,Y}(s,t)=\mathbb{E}\left[e^{sX+tY}\right],

for real ss and tt where this expectation is finite. For a discrete pair with joint probability mass function pX,Y(x,y)p_{X,Y}(x,y),

MX,Y(s,t)=∑x∑yesx+typX,Y(x,y).M_{X,Y}(s,t)=\sum_x\sum_y e^{sx+ty}p_{X,Y}(x,y).

For a continuous pair with joint density fX,Y(x,y)f_{X,Y}(x,y),

MX,Y(s,t)=∫−∞∞∫−∞∞esx+tyfX,Y(x,y) dx dy,M_{X,Y}(s,t)=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} e^{sx+ty}f_{X,Y}(x,y)\,dx\,dy,

provided the integral is finite. If the density is supported only on part of the plane, you can integrate over that support instead.

The joint MGF equals 11 at (s,t)=(0,0)(s,t)=(0,0), since E[1]=1\mathbb{E}[1]=1. It is usually most useful when it is finite in a neighborhood of the origin; this allows derivatives there to recover moments.

A step-by-step method

  1. Identify the joint distribution. Use the joint probability table or joint density, not just the two marginal distributions.
  2. Substitute into the definition. Multiply each joint probability or density by esx+tye^{sx+ty}.
  3. Sum or integrate. Simplify the expression, retaining any restrictions on the support.
  4. Check the domain. Determine which s,ts,t make the sum or integral finite.
  5. Check special values or derivatives. At the origin the result should be 11. If needed, differentiate to obtain moments.

For example, the derivatives satisfy

∂M∂s∣(0,0)=E[X],∂M∂t∣(0,0)=E[Y],∂2M∂s ∂t∣(0,0)=E[XY],\left.\frac{\partial M}{\partial s}\right|_{(0,0)}=\mathbb{E}[X],\qquad \left.\frac{\partial M}{\partial t}\right|_{(0,0)}=\mathbb{E}[Y],\qquad \left.\frac{\partial^2 M}{\partial s\,\partial t}\right|_{(0,0)}=\mathbb{E}[XY],

when the MGF is finite in a neighborhood of the origin. Higher derivatives give higher mixed moments.

Worked example: a discrete pair

Suppose (X,Y)(X,Y) has the following three possible outcomes:

(X,Y)(X,Y)Probability
(0,0)(0,0)1/21/2
(1,0)(1,0)1/41/4
(0,2)(0,2)1/41/4

Apply the definition by adding one term for each outcome:

MX,Y(s,t)=12es⋅0+t⋅0+14es⋅1+t⋅0+14es⋅0+t⋅2=12+14es+14e2t.\begin{aligned} M_{X,Y}(s,t) &=\frac12 e^{s\cdot 0+t\cdot 0} +\frac14 e^{s\cdot 1+t\cdot 0} +\frac14 e^{s\cdot 0+t\cdot 2}\\ &=\frac12+\frac14e^s+\frac14e^{2t}. \end{aligned}

This MGF is finite for every real s,ts,t, because it is a finite sum. At the origin it gives 1/2+1/4+1/4=11/2+1/4+1/4=1, as expected.

The marginals are P(X=1)=1/4P(X=1)=1/4 and P(Y=2)=1/4P(Y=2)=1/4. Their MGFs are MX(s)=3/4+(1/4)esM_X(s)=3/4+(1/4)e^s and MY(t)=3/4+(1/4)e2tM_Y(t)=3/4+(1/4)e^{2t}. The product of these marginal MGFs is not the joint MGF. In fact, XX and YY cannot both be nonzero in this distribution, so they are dependent. The joint formula preserves that information.

As a derivative check, E[X]=1/4\mathbb{E}[X]=1/4 and E[Y]=1/2\mathbb{E}[Y]=1/2. Also E[XY]=0\mathbb{E}[XY]=0, because every listed outcome has at least one coordinate equal to zero. Thus Cov⁡(X,Y)=E[XY]−E[X]E[Y]=−1/8\operatorname{Cov}(X,Y)=\mathbb{E}[XY]-\mathbb{E}[X]\mathbb{E}[Y]=-1/8.

When can you multiply the marginal MGFs?

If XX and YY are independent, then esX+tY=esXetYe^{sX+tY}=e^{sX}e^{tY} and independence gives

MX,Y(s,t)=MX(s)MY(t).M_{X,Y}(s,t)=M_X(s)M_Y(t).

For instance, if XX and YY are independent exponential random variables with rates 22 and 33, respectively, then

MX,Y(s,t)=22−s33−t,s<2, t<3.M_{X,Y}(s,t)=\frac{2}{2-s}\frac{3}{3-t},\qquad s<2,\ t<3.

Here each factor comes from the corresponding one-variable MGF. Independence is essential to this shortcut. Conversely, if the joint MGF exists in a neighborhood of the origin and factors there as MX(s)MY(t)M_X(s)M_Y(t), that factorization implies independence.

Common mistakes

  • Using only the marginals: Marginal distributions do not generally determine the joint distribution. Different dependence patterns can have the same marginals but different joint MGFs.
  • Multiplying without independence: The expression MX(s)MY(t)M_X(s)M_Y(t) is valid for independent variables, not for an arbitrary pair.
  • Dropping the joint support: For a continuous pair, the density may be nonzero only in a restricted region. Integrating over the whole plane is harmless only if the density is correctly zero outside that region.
  • Ignoring convergence: A formal integral is not a finite MGF at every s,ts,t. State the domain where it converges; some distributions do not have an MGF on any open neighborhood of the origin.
  • Confusing an MGF with a characteristic function: An MGF uses real exponential arguments s,ts,t. A characteristic function instead uses imaginary arguments and exists for every probability distribution.

Once you have the joint MGF, use its partial derivatives at the origin to find moments, or compare it with a known joint MGF when identifying a distribution.

References

  1. A First Course in Probability — Sheldon Ross
  2. Introduction to Mathematical Statistics — Robert V. Hogg, Joseph W. McKean, and Allen T. Craig

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.