Tutorials › Stochastic Processes › MGFs Of Standard Distributions And Affine Transforms

Generating Functions and Transforms · Tutorial 34 of 994

MGFs Of Standard Distributions And Affine Transforms

Learn to derive standard MGFs, identify where they are finite, and transform them under changes of location and scale.

Intermediate 10 min read

What You'll Learn

  • Derive the MGF formulas for Bernoulli, binomial, Poisson, exponential, and normal distributions.
  • State the parameter restrictions and finiteness domains for each formula.
  • Apply the affine-transform rule, including its constant-variable case.
  • Calculate transformed MGFs and verify them by direct substitution or integration.
  • Recognize why an exponential MGF diverges at and beyond its boundary.

Standard MGFs and Their Domains

A moment generating function packages information about a random variable into a function of a real parameter. The formula itself is often short; the important details are how it follows from the distribution and where the expectation is finite. Those details matter when an MGF is used to calculate moments or to transform a random variable.

Let \(X\) be a real-valued random variable on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). Its moment generating function is \(M_X(t)=\mathbb{E}[e^{tX}]\), for real \(t\) such that this expectation is finite. Its finiteness domain is \(D_X=\{t\in\mathbb{R}:\mathbb{E}[e^{tX}]<\infty\}\). Since the integrand is nonnegative, the expectation is always defined as an extended value, possibly \(+\infty\); only values in \(D_X\) are finite MGF values.

Theorem (MGFs of standard distributions): For \(X\) with the stated distribution and parameters, the following formulas hold:
  • If \(X\) is Bernoulli with success probability \(0\le p\le1\), then \(M_X(t)=1-p+pe^t\), for every real \(t\).
  • If \(X\) is binomial with parameters \(n\in\{0,1,2,\ldots\}\) and \(0\le p\le1\), then \(M_X(t)=(1-p+pe^t)^n\), for every real \(t\).
  • If \(X\) is Poisson with parameter \(\lambda\ge0\), then \(M_X(t)=\exp(\lambda(e^t-1))\), for every real \(t\).
  • If \(X\) is exponential with rate \(\lambda>0\), then \(M_X(t)=\frac{\lambda}{\lambda-t}\), for \(t<\lambda\), and the expectation is infinite for \(t\ge\lambda\).
  • If \(X\) is normal with mean \(\mu\in\mathbb{R}\) and variance \(\sigma^2>0\), then \(M_X(t)=\exp(\mu t+\frac12\sigma^2t^2)\), for every real \(t\). The same formula includes the degenerate case \(\sigma^2=0\), when \(X=\mu\) almost surely.

Proof. For a Bernoulli variable, the values \(0\) and \(1\) have probabilities \(1-p\) and \(p\). Thus \(\mathbb{E}[e^{tX}]=(1-p)e^0+pe^t=1-p+pe^t\), which is finite for every real \(t\), including \(p=0\) and \(p=1\).

For a binomial variable, its probability mass at \(k\in\{0,\ldots,n\}\) is \(\binom{n}{k}p^k(1-p)^{n-k}\), with the endpoint cases \(p=0,1\) interpreted by their degenerate distributions. Summing over its finite support and applying the binomial theorem gives \(M_X(t)=\sum_{k=0}^n e^{tk}\binom{n}{k}p^k(1-p)^{n-k}=(1-p+pe^t)^n\). A finite sum of finite terms is finite for every real \(t\); this also covers \(n=0\).

For a Poisson variable, sum its probability mass function over all nonnegative integers: \(M_X(t)=\sum_{k=0}^{\infty}e^{tk}e^{-\lambda}\lambda^k/k! =e^{-\lambda}\sum_{k=0}^{\infty}(\lambda e^t)^k/k! =e^{-\lambda}\exp(\lambda e^t)\). The exponential series converges for every finite real argument, so the result is \(\exp(\lambda(e^t-1))\) for all real \(t\). At \(\lambda=0\), \(X=0\) almost surely and this expression equals \(1\).

For an exponential variable with rate \(\lambda>0\), its density is \(\lambda e^{-\lambda x}\) for \(x\ge0\). Therefore \(M_X(t)=\int_0^\infty \lambda e^{-(\lambda-t)x}\,dx\). If \(t<\lambda\), the integral is \(\lambda/(\lambda-t)\), since the exponential decays and its integral is \(1/(\lambda-t)\). If \(t=\lambda\), the integrand is the positive constant \(\lambda\), so the integral is infinite. If \(t>\lambda\), the integrand grows with \(x\), and its integral is also infinite. This proves the formula and its exact domain.

For \(\sigma^2>0\), the normal density gives \[ M_X(t)=\frac{1}{\sqrt{2\pi\sigma^2}}\int_{-\infty}^{\infty} \exp\!\left(tx-\frac{(x-\mu)^2}{2\sigma^2}\right)\,dx. \] Completing the square yields \(tx-\frac{(x-\mu)^2}{2\sigma^2} =-\frac{(x-\mu-\sigma^2t)^2}{2\sigma^2}+\mu t+\frac12\sigma^2t^2\). The factor \(\exp(\mu t+\frac12\sigma^2t^2)\) is constant in \(x\); the remaining integral is a normal density integral centered at \(\mu+\sigma^2t\), so it equals \(1\) after division by \(\sqrt{2\pi\sigma^2}\). This proves the formula and finiteness for each real \(t\). If \(\sigma^2=0\), then \(X=\mu\) almost surely, so \(\mathbb{E}[e^{tX}]=e^{\mu t}\), which is the same expression with \(\sigma^2=0\). \(\square\)

Each of these domains contains an open interval around zero. The exponential case is the one with a finite boundary: its MGF exists for \(t<\lambda\), but not at or beyond \(t=\lambda\). The other four formulas are finite on all of \(\mathbb{R}\). These domain statements are part of the formulas, not optional qualifications.

Location and Scale Transformations

A location change adds a constant; a scale change multiplies by a constant. Both can be handled by one identity. It is useful to state the domain as well as the formula, because rescaling the input also rescales the MGF parameter.

Theorem (Affine transformation rule): Let \(X\) be a real-valued random variable with MGF domain \(D_X\), and let \(Y=a+bX\), for constants \(a,b\in\mathbb{R}\). If \(b=0\), then \(Y=a\) almost surely, \(D_Y=\mathbb{R}\), and \(M_Y(t)=e^{at}\). If \(b\ne0\), then \(D_Y=\{t\in\mathbb{R}:bt\in D_X\}\), and for each \(t\in D_Y\), \(M_Y(t)=e^{at}M_X(bt)\).

Proof. If \(b=0\), then \(Y=a\) for every outcome, so \(e^{tY}=e^{at}\) is a finite constant for each real \(t\). This proves the stated domain and formula. If \(b\ne0\), then for each real \(t\), \(e^{tY}=e^{at}e^{(bt)X}\). The factor \(e^{at}\) is strictly positive and finite. Consequently, the expectation of this product is finite exactly when \(\mathbb{E}[e^{(bt)X}]\) is finite, that is, exactly when \(bt\in D_X\). In that case, taking expectations gives \(M_Y(t)=e^{at}M_X(bt)\). \(\square\)

For \(b\ne0\), the rule says to evaluate the original MGF at \(bt\), not at \(t\), and then multiply by \(e^{at}\). If \(X\) is exponential, for example, the condition \(bt<\lambda\) must be solved for \(t\), with the inequality reversed when \(b<0\). If \(b=0\), the domain is all real numbers even when \(D_X\) is restricted: the transformed variable is constant and no longer depends on \(X\).

Worked Example: Bernoulli and Binomial MGFs

Let \(B\) be Bernoulli with \(p=\tfrac13\), and let \(Z\) be binomial with \(n=3\) and \(p=\tfrac12\). Calculate their MGFs at \(t=\log 3\) and \(t=\log 2\), respectively, and verify the binomial calculation directly.

For \(B\), the Bernoulli formula gives \(M_B(\log 3)=1-\tfrac13+\tfrac13 e^{\log 3}=\tfrac23+1=\tfrac53\). For \(Z\), the binomial formula gives \(M_Z(\log 2)=(\tfrac12+\tfrac12e^{\log 2})^3=(\tfrac12+1)^3=(\tfrac32)^3=\tfrac{27}{8}\).

Check by summing over the binomial support. The probabilities of \(Z=0,1,2,3\) are respectively \(\tfrac18,\tfrac38,\tfrac38,\tfrac18\). Since \(e^{(\log 2)k}=2^k\), \(M_Z(\log 2)=\tfrac18(1)+\tfrac38(2)+\tfrac38(4)+\tfrac18(8)=\tfrac18+\tfrac68+\tfrac{12}8+\tfrac88=\tfrac{27}{8}\), in agreement with the formula. Both MGFs are finite at these parameters and, in fact, for every real parameter.

Worked Example: An Affine Transformation of an Exponential Variable

Let \(X\) have an exponential distribution with rate \(2\), and set \(Y=3-2X\). Find the domain and MGF of \(Y\), and calculate \(M_Y(\tfrac12)\).

Here \(a=3\), \(b=-2\), and \(M_X(s)=\frac{2}{2-s}\) when \(s<2\). The transformed domain condition is \(-2t<2\), or \(t>-1\); the inequality reverses because we divide by a negative number. Thus \(M_Y(t)=e^{3t}M_X(-2t)=e^{3t}\frac{2}{2+2t}=\frac{e^{3t}}{1+t}\), for \(t>-1\). At \(t=\tfrac12\), this gives \(M_Y(\tfrac12)=e^{3/2}/(3/2)=\tfrac23e^{3/2}\).

Check by integration. Using the density of \(X\), \(\mathbb{E}[e^{tY}]=e^{3t}\int_0^\infty 2e^{-2x}e^{-2tx}\,dx =e^{3t}\int_0^\infty 2e^{-(2+2t)x}\,dx\). This integral is finite exactly when \(2+2t>0\), namely \(t>-1\), and then equals \(e^{3t}\frac{2}{2+2t}\). At \(t=\tfrac12\), the rate inside the integral is \(2+2(\tfrac12)=3\), so the integral is \(2/3\) and the result is \(\tfrac23e^{3/2}\), as before. At \(t=-1\) the integrand is the constant \(2e^{-3}\), so the integral diverges; this confirms that the endpoint is excluded.

Worked Example: Shifting and Scaling a Normal Variable

Let \(X\) be normal with mean \(2\) and variance \(4\), and define \(Y=1+3X\). Find the MGF of \(Y\) and evaluate it at \(t=\tfrac16\).

The MGF of \(X\) is \(M_X(s)=\exp(2s+2s^2)\), because \(\frac12\sigma^2s^2=\frac12(4)s^2=2s^2\). Applying the affine rule with \(a=1\) and \(b=3\) gives \(M_Y(t)=e^tM_X(3t)=\exp(t+6t+18t^2)=\exp(7t+18t^2)\). At \(t=\tfrac16\), \(7t=\tfrac76\) and \(18t^2=18/36=\tfrac12\), so \(M_Y(\tfrac16)=\exp(\tfrac76+\tfrac12)=e^{5/3}\). The domain is all real \(t\), since \(3t\) belongs to the all-real domain of the normal MGF.

Check by identifying the transformed normal parameters. A linear transformation of a normal variable has mean \(1+3(2)=7\) and variance \(3^2(4)=36\); this follows directly by taking expectation and variance of \(1+3X\). Its normal MGF is therefore \(\exp(7t+\frac12(36)t^2)=\exp(7t+18t^2)\), matching the affine-rule calculation. Substituting \(t=\tfrac16\) again gives exponent \(\tfrac76+\tfrac12=\tfrac53\).

Common Pitfalls and Practical Checks

A frequent error is to use the exponential-rate formula with the wrong sign. For a rate-\(\lambda\) exponential variable, the density contributes \(e^{-\lambda x}\), while the MGF contributes \(e^{tx}\). Their product is \(e^{-(\lambda-t)x}\), so the denominator is \(\lambda-t\), not \(\lambda+t\). For instance, with rate \(2\), the incorrect calculation \(M_X(1)=2/(2+1)=2/3\) contradicts the defining expectation: \(e^X\ge1\) since \(X\ge0\), so its expectation cannot be less than \(1\). The correct calculation is \(M_X(1)=2/(2-1)=2\), which is greater than \(1\), and the integral \(\int_0^\infty 2e^{-x}\,dx=2\) verifies it.

Another error is to transform the formula but forget the domain. If \(X\) is exponential with rate \(2\) and \(Y=3-2X\), simply writing \(e^{3t}M_X(-2t)\) is incomplete unless \(-2t<2\) is also imposed. The correct domain is \(t>-1\). At and below \(-1\), the defining expectation diverges, even though an algebraic expression such as \(e^{3t}/(1+t)\) can still be written away from \(t=-1\). An algebraic expression outside the expectation's finiteness domain is not an MGF value.

When applying these formulas, check the distribution's parameters, substitute the transformed argument \(bt\), and solve the finiteness condition before simplifying. The affine rule also covers a zero scale: if \(b=0\), \(Y=a\) is constant, so its MGF is \(e^{at}\) for all real \(t\), regardless of the domain of \(X\). For nonzero \(b\), the set condition \(bt\in D_X\) handles positive and negative scales without guessing the direction of an inequality.

Check Your Understanding

For each question, state the relevant parameter restrictions and MGF domain as well as the requested calculation.

  1. For a Bernoulli variable with success probability \(p=\tfrac14\), calculate \(M_X(\log 4)\).
  2. For a Poisson variable with parameter \(\lambda=2\), write its MGF and evaluate it at \(t=\log 2\).
  3. If \(X\) is exponential with rate \(3\), find the domain and MGF of \(Y=2+X\).
  4. If \(X\) is exponential with rate \(3\), find the domain of the MGF of \(Y=1-2X\). Explain why the inequality changes direction.
  5. If \(X\) is normal with mean \(-1\) and variance \(2\), find the MGF of \(Y=4+X\).