Tutorials › VEE Mathematical Statistics › MGFs of Shifted and Scaled Variables

VEE Mathematical Statistics · Moment Generating Functions · Tutorial 234 of 880

MGFs of Shifted and Scaled Variables

Learn how shifting and scaling a random variable changes its MGF, its moments, and the set of arguments for which the MGF exists.

Intermediate 10 min read

What You'll Learn

  • Apply the MGF formula for a shifted and scaled random variable
  • Track how an affine transformation changes an MGF’s domain
  • Find means and variances from the transformed MGF
  • Transform Bernoulli, exponential, and normal MGFs
  • Avoid confusing the scale factor in the variable with the MGF argument

Why Shifts and Scales Matter

A random variable may be recorded in a new unit, centered by subtracting a constant, or adjusted by adding a fixed amount. These are all affine transformations: a new variable of the form \(Y=aX+b\). Knowing the MGF of \(X\) lets us find the MGF of \(Y\) directly, without first deriving a new probability function. The transformation also gives a quick route to the mean and variance, provided the MGF exists near zero.

The essential detail is that the scale factor \(a\) multiplies the argument of the original MGF. The shift \(b\), by contrast, contributes an exponential factor outside it. Keeping those roles separate prevents a common substitution error.

Definition: The moment generating function of a random variable \(X\) is \(M_X(t)=E[e^{tX}]\) for values of \(t\) for which this expectation is finite. If \(Y=aX+b\), where \(a\) and \(b\) are constants, then
$$ M_Y(t)=M_{aX+b}(t)=e^{bt}M_X(at). $$
This formula applies wherever the expectation on the left is finite. If \(a=0\), then \(Y=b\) is constant and \(M_Y(t)=e^{bt}\) for every real \(t\).

Why the Affine-Transformation Formula Holds

Use the definition of an MGF and substitute \(Y=aX+b\) inside the exponential. The factor involving \(b\) is constant with respect to \(X\), so it can be taken outside the expectation.

$$ \begin{aligned} M_Y(t) &=E[e^{tY}]\\ &=E[e^{t(aX+b)}]\\ &=E[e^{atX+bt}]\\ &=e^{bt}E[e^{(at)X}]\\ &=e^{bt}M_X(at). \end{aligned} $$

This derivation also explains the domain condition. If \(a\ne 0\), the transformed MGF is finite at \(t\) exactly when \(M_X(at)\) is finite. Thus, if the domain of \(M_X\) is \(D_X\), the domain for \(M_Y\) is the set of \(t\) such that \(at\in D_X\). The factor \(e^{bt}\) is finite for every real \(t\), so the shift does not restrict the domain. When \(a=0\), \(Y\) is constant and its MGF is finite for all real \(t\).

Theorem: If \(M_X\) is finite in an open interval containing zero, then the transformed MGF is finite in an open interval containing zero as well. If \(\mu=E[X]\) and \(\sigma^2=\operatorname{Var}(X)\), its derivatives at zero give
$$ E[aX+b]=a\mu+b,\qquad \operatorname{Var}(aX+b)=a^2\sigma^2. $$
The variance uses \(a^2\), not \(a\): changing the sign of a scale reverses values around the shift but cannot make a variance negative.

Deriving the Mean and Variance from the Transformed MGF

The MGF derivative formulas give \(M_X'(0)=E[X]\) and \(M_X''(0)=E[X^2]\) when the MGF exists in an open interval around zero. Differentiate \(M_Y(t)=e^{bt}M_X(at)\) using the product and chain rules:

$$ M_Y'(t)=e^{bt}\left[bM_X(at)+aM_X'(at)\right]. $$

At \(t=0\), \(M_X(0)=1\), so \(M_Y'(0)=b+aE[X]\). Differentiating once more gives

$$ M_Y''(t)=e^{bt}\left[b^2M_X(at)+2abM_X'(at)+a^2M_X''(at)\right]. $$

Consequently, \(E[Y^2]=b^2+2abE[X]+a^2E[X^2]\). Subtract the square of \(E[Y]\) to obtain

$$ \begin{aligned} \operatorname{Var}(Y) &=b^2+2abE[X]+a^2E[X^2]-(b+aE[X])^2\\ &=a^2\left(E[X^2]-(E[X])^2\right)\\ &=a^2\operatorname{Var}(X). \end{aligned} $$

The cancellation shows precisely why adding \(b\) has no effect on variance, while scaling by \(a\) multiplies variance by \(a^2\).

Applying the Rule to Common MGFs

The same transformation rule works with discrete or continuous variables. The base MGF and its domain must be stated before substitution.

Base variable and MGFAffine transformationTransformed MGF
\(B\sim\operatorname{Bernoulli}(p)\), \(M_B(t)=1-p+pe^t\), all real \(t\)\(Y=aB+b\)\(e^{bt}(1-p+pe^{at})\), all real \(t\)
\(X\sim\operatorname{Exponential}(\lambda)\), rate \(\lambda>0\), \(M_X(t)=\lambda/(\lambda-t)\), \(t<\lambda\)\(Y=aX+b,\ a>0\)\(e^{bt}\lambda/(\lambda-at)\), \(t<\lambda/a\)
\(X\sim\operatorname{Exponential}(\lambda)\), rate \(\lambda>0\)\(Y=aX+b,\ a<0\)\(e^{bt}\lambda/(\lambda-at)\), \(t>\lambda/a\)
\(X\sim N(\mu,\sigma^2)\), \(M_X(t)=e^{\mu t+\sigma^2t^2/2}\), all real \(t\)\(Y=aX+b\)\(e^{(b+a\mu)t+a^2\sigma^2t^2/2}\), all real \(t\)

For the exponential rows, the sign of \(a\) determines which side of the domain boundary is allowed. The condition is always \(\lambda-at>0\). For example, if \(a<0\), dividing that inequality by \(a\) reverses its direction, giving \(t>\lambda/a\). These domains include zero, as required for an MGF.

Worked Example: An Affine Transformation of a Bernoulli Variable

Let \(B\sim\operatorname{Bernoulli}(0.25)\), so \(P(B=1)=0.25\) and \(P(B=0)=0.75\). Define the hypothetical score \(Y=80+400B\), measured in points. Find its MGF, mean, and variance.

Method. Apply the affine-transformation formula to the Bernoulli MGF \(M_B(t)=0.75+0.25e^t\), which is finite for every real \(t\). Here \(a=400\) and \(b=80\), so

$$ M_Y(t)=e^{80t}M_B(400t) =e^{80t}\left(0.75+0.25e^{400t}\right),\qquad -\infty<t<\infty. $$

The possible scores are \(80\) when \(B=0\) and \(480\) when \(B=1\). The mean and variance are

$$ E[Y]=80+400(0.25)=80+100=180, \qquad \operatorname{Var}(Y)=400^2(0.25)(0.75)=160{,}000(0.1875)=30{,}000. $$

As a check from the MGF, \(M_Y'(0)=80+400(0.25)=180\). Its second derivative at zero is \(E[Y^2]=0.75(80^2)+0.25(480^2)=4{,}800+57{,}600=62{,}400\), so the variance is \(62{,}400-180^2=30{,}000\).

Common mistake avoided: Substituting \(t+400\) into \(M_B\) would not represent the scale \(400B\). The correct substitution is \(400t\); the separate shift contributes \(e^{80t}\).

Worked Example: A Reflected and Shifted Exponential Variable

Let \(X\sim\operatorname{Exponential}(4)\), with rate \(\lambda=4\) per unit of measurement. Thus \(M_X(t)=4/(4-t)\) for \(t<4\), \(E[X]=1/4\), and \(\operatorname{Var}(X)=1/16\). Define \(Y=5-2X\). Find its MGF and its first two moments.

Method. This is an affine transformation with \(a=-2\), \(b=5\). Substitute \(-2t\) for the original MGF argument:

$$ M_Y(t)=e^{5t}M_X(-2t) =e^{5t}\frac{4}{4-(-2t)} =e^{5t}\frac{4}{4+2t}. $$

For the domain, require the original argument \(-2t\) to be less than \(4\). Therefore \(-2t<4\), which gives \(t>-2\). The MGF is finite on \((-2,\infty)\), including zero.

The mean and variance follow from the affine moment formulas:

$$ E[Y]=5-2\left(\frac14\right)=5-\frac12=4.5, \qquad \operatorname{Var}(Y)=(-2)^2\left(\frac1{16}\right)=\frac14=0.25. $$

As a derivative check, write \(M_Y(t)=e^{5t}(1+t/2)^{-1}\). At zero, the second factor has value \(1\), first derivative \(-1/2\), and second derivative \(1/2\). Hence \(M_Y'(0)=5-1/2=4.5\), and \(M_Y''(0)=25+2(5)(-1/2)+1/2=20.5\). Thus \(\operatorname{Var}(Y)=20.5-(4.5)^2=0.25\).

Common mistake avoided: Reversing the domain inequality incorrectly would give \(t<-2\), which excludes zero. Starting with \(-2t<4\) and dividing by the negative scale factor reverses the inequality, so the correct condition is \(t>-2\).

Worked Example: Shifting and Scaling a Normal Variable

Let \(X\sim N(12,9)\), so its mean is \(12\), its variance is \(9\), and \(M_X(t)=e^{12t+9t^2/2}\) for every real \(t\). Set \(Y=2X-3\). Find the transformed MGF, mean, and variance.

Method. Substitute \(2t\) into the MGF and multiply by the factor for the shift \(b=-3\):

$$ \begin{aligned} M_Y(t) &=e^{-3t}M_X(2t)\\ &=e^{-3t}\exp\left(12(2t)+\frac{9(2t)^2}{2}\right)\\ &=\exp\left(21t+18t^2\right),\qquad -\infty<t<\infty. \end{aligned} $$

The linear coefficient is \(2(12)-3=21\), and the quadratic coefficient is \(2^2(9)/2=18\). Therefore \(E[Y]=21\) and \(\operatorname{Var}(Y)=2^2(9)=36\). In the normal MGF form \(e^{\mu_Yt+\sigma_Y^2t^2/2}\), the exponent is \(21t+36t^2/2\), which checks both moments. The domain remains all real numbers because the original normal MGF is finite for all real arguments.

Common mistake avoided: Scaling the variance by \(2\) would give \(18\), which is incorrect. A scale of \(2\) multiplies the variance by \(2^2=4\), giving \(36\).

Common Errors and a Reliable Process

Affine MGF problems are short, but several errors can alter the result even when the algebra is otherwise correct. Use this sequence to keep the transformation and its domain straight.

1
State the base model.
Write the distribution, parameters, base MGF, and the base MGF's domain.
2
Identify the constants.
Match the new variable to \(Y=aX+b\), keeping the scale \(a\) and shift \(b\) distinct.
3
Transform the MGF.
Use \(e^{bt}M_X(at)\), not \(e^{at}M_X(bt)\).
4
Transform the domain.
Impose the original domain condition on \(at\); if dividing an inequality by a negative \(a\), reverse its direction.
5
Check the moments.
Use \(E[Y]=aE[X]+b\) and \(\operatorname{Var}(Y)=a^2\operatorname{Var}(X)\), then compare with derivatives if useful.

A shift changes the location of all possible values, but it does not change their spread. A negative scale reflects the variable around the shift, so its mean changes according to the signed \(a\), while its variance still uses \(a^2\). For an exponential variable, a negative scale also changes which side of the MGF domain boundary is allowed. These distinctions make affine transformations useful both for calculation and for checking whether a proposed MGF is plausible.

Key takeaway: For \(Y=aX+b\), the shift appears as \(e^{bt}\), the scale appears as the argument \(at\), the mean becomes \(aE[X]+b\), and the variance becomes \(a^2\operatorname{Var}(X)\). The transformed MGF's domain must also satisfy the base MGF's domain condition at \(at\).

Check Your Understanding

For each problem, find the requested MGF and moments, and state the MGF domain where requested.

  1. Let \(B\sim\operatorname{Bernoulli}(0.30)\) and \(W=50+200B\). Find \(M_W(t)\), \(E[W]\), and \(\operatorname{Var}(W)\). (Answer: \(M_W(t)=e^{50t}(0.70+0.30e^{200t})\), all real \(t\); \(E[W]=110\), \(\operatorname{Var}(W)=8{,}400\).)
  2. Let \(X\sim\operatorname{Exponential}(5)\) with rate \(5\), and let \(U=4X-2\). Find its MGF and domain, mean, and variance. (Answer: \(M_U(t)=e^{-2t}5/(5-4t)\), \(t<1.25\); \(E[U]=-1.2\), \(\operatorname{Var}(U)=0.64\).)
  3. Let \(X\sim N(-2,16)\) and \(V=3-X\). Find \(M_V(t)\), \(E[V]\), and \(\operatorname{Var}(V)\). (Answer: \(M_V(t)=e^{5t+8t^2}\), all real \(t\); \(E[V]=5\), \(\operatorname{Var}(V)=16\).)
  4. Let \(X\sim\operatorname{Exponential}(3)\) with rate \(3\), and set \(Y=2-3X\). Find the MGF domain and the mean and variance. Explain why the domain inequality points in that direction. (Answer: \(M_Y(t)=e^{2t}/(1+t)\), \(t>-1\); \(E[Y]=1\), \(\operatorname{Var}(Y)=1\). The base condition is \(-3t<3\); division by \(-3\) reverses the inequality.)
  5. Let \(B\sim\operatorname{Bernoulli}(0.40)\) and \(Z=10-5B\). Find \(M_Z(t)\), \(E[Z]\), and \(\operatorname{Var}(Z)\), and verify the mean from the two possible values. (Answer: \(M_Z(t)=e^{10t}(0.60+0.40e^{-5t})\), all real \(t\); \(E[Z]=8\), \(\operatorname{Var}(Z)=6\). The values are \(10\) with probability \(0.60\) and \(5\) with probability \(0.40\), giving mean \(0.60(10)+0.40(5)=8\).)
Clinical Biostats