Why Affine Transformations Matter
A change of units, a shift in a measurement origin, or a reversal of direction often replaces a random variable \(X\) by \(Y=a+bX\), where \(a\) and \(b\) are constants. The transformation affects more than the numerical values of the moments: it also changes where the moment-generating function is finite. Tracking both effects is useful whenever an MGF is used to describe a transformed measurement or to calculate its moments.
The key is to substitute \(a+bX\) directly into the defining expectation. A shift contributes an exponential factor, while rescaling changes the argument of the original MGF. The same substitution gives an exact rule for the domain, including the reversal of its order when \(b\) is negative.
The Affine Transformation Rule
The domain statement is part of the transformation rule, not an extra assumption. A finite exponential factor \(e^{at}\) cannot turn an infinite expectation into a finite one or vice versa. The argument \(bt\), however, must belong to the original domain.
Proof. For any real \(t\), the defining integrand for \(Y\) satisfies $$ e^{tY}=e^{t(a+bX)}=e^{at}e^{(bt)X}. $$ The number \(e^{at}\) is finite and strictly positive. Therefore \(E[e^{tY}]\) is finite exactly when \(E[e^{(bt)X}]\) is finite. This proves \(D_Y=\{t:bt\in D_X\}\) when \(b\ne0\), and taking the expectation gives \(M_Y(t)=e^{at}M_X(bt)\) on that domain. When \(b=0\), \(Y=a\) with probability one, so \(e^{tY}=e^{at}\) is a finite constant for every real \(t\). Hence \(D_Y=\mathbb{R}\) and \(M_Y(t)=e^{at}\). \(\square\)
If \(D_X\) is an interval with endpoints \(\alpha\) and \(\beta\), the interval’s order is preserved when \(b>0\) and reversed when \(b<0\). For example, if \(D_X=(\alpha,\beta)\), then $$ D_Y= \begin{cases} (\alpha/b,\ \beta/b), & b>0,\\ (\beta/b,\ \alpha/b), & b<0. \end{cases} $$ The same mapping applies to included or excluded endpoints: use \(D_Y=\{t:bt\in D_X\}\) to determine endpoint membership exactly. A shift \(a\) does not affect the domain; the scale \(b\) does.
Worked Example: A Negative Scale Reverses the Domain
Let \(X\) have an exponential distribution with rate \(2\), so its density is \(f_X(x)=2e^{-2x}\) for \(x\ge 0\). Find the MGF and domain of \(Y=3-4X\), then calculate its mean and variance.
For \(X\), direct integration gives $$ M_X(s)=\int_0^\infty e^{sx}2e^{-2x}\,dx =2\int_0^\infty e^{-(2-s)x}\,dx =\frac{2}{2-s},\qquad s<2. $$ If \(s\ge 2\), the integrand does not have a finite integral over \([0,\infty)\). Thus \(D_X=(-\infty,2)\).
Here \(a=3\) and \(b=-4\). The transformed domain consists of the \(t\) for which \(-4t<2\), which is equivalent to \(t>-1/2\). On this domain, $$ M_Y(t)=e^{3t}M_X(-4t) =e^{3t}\frac{2}{2+4t} =\frac{e^{3t}}{1+2t},\qquad t>-\frac12. $$
The negative scale reverses the domain’s direction: \(X\)'s domain extends without bound to the left, whereas \(Y\)'s extends without bound to the right. The MGF is finite at \(t=0\), as required, and \(M_Y(0)=1\).
An exponential random variable with rate \(2\) has mean \(1/2\) and variance \(1/4\). Therefore $$ E[Y]=3-4\left(\frac12\right)=1,\qquad \operatorname{Var}(Y)=(-4)^2\left(\frac14\right)=4. $$
Moments After Shifting and Rescaling
When \(X\) has an MGF finite on a neighborhood of zero, its derivatives at zero give its raw moments. Substituting \(bt\) into \(M_X\) and differentiating the affine transformation formula gives a direct expression for each moment of \(Y\).
Proof. Because the MGF of \(X\) is finite on a neighborhood of zero, MGF differentiation is valid there, and \(M_X^{(j)}(0)=E[X^j]\) for each nonnegative integer \(j\). In a sufficiently small neighborhood of \(t=0\), the affine transformation rule gives \(M_Y(t)=e^{at}M_X(bt)\). Apply the product rule \(k\) times and evaluate at zero: $$ M_Y^{(k)}(0) =\sum_{j=0}^{k}\binom{k}{j} \left.\frac{d^{\,k-j}}{dt^{\,k-j}}e^{at}\right|_{t=0} \left.\frac{d^{\,j}}{dt^{\,j}}M_X(bt)\right|_{t=0} =\sum_{j=0}^{k}\binom{k}{j}a^{k-j}b^jE[X^j]. $$ Since \(M_Y^{(k)}(0)=E[Y^k]\), this proves the raw-moment formula. For \(k=1\) it gives \(E[Y]=a+bE[X]\). For \(k=2\), it gives \(E[Y^2]=a^2+2abE[X]+b^2E[X^2]\). Thus $$ \operatorname{Var}(Y) =E[Y^2]-(E[Y])^2 =b^2\bigl(E[X^2]-(E[X])^2\bigr) =b^2\operatorname{Var}(X). $$ \(\square\)
The raw-moment formula also follows by expanding \(Y^k=(a+bX)^k\) with the binomial theorem and taking expectations. That algebraic argument only needs the relevant moments to exist; the MGF-derivative argument additionally uses finiteness of the MGF on a neighborhood of zero. The mean and variance formulas show two useful effects: shifting changes the mean but not the variance, while rescaling multiplies the variance by the square of the scale.
Worked Example: Shifting and Rescaling a Bernoulli Variable
Let \(X\sim\operatorname{Bernoulli}(0.3)\), so \(P(X=1)=0.3\) and \(P(X=0)=0.7\). For \(Y=10+2X\), find the MGF, its domain, the mean, and the variance.
Since \(X\) takes only the values \(0\) and \(1\), $$ M_X(s)=0.7e^{0s}+0.3e^s=0.7+0.3e^s. $$ This is finite for every real \(s\), so \(D_X=\mathbb{R}\). With \(a=10\) and \(b=2\), the affine rule gives $$ M_Y(t)=e^{10t}M_X(2t) =e^{10t}(0.7+0.3e^{2t}),\qquad D_Y=\mathbb{R}. $$
The Bernoulli mean and variance are \(E[X]=0.3\) and \(\operatorname{Var}(X)=0.3(0.7)=0.21\). Hence $$ E[Y]=10+2(0.3)=10.6,\qquad \operatorname{Var}(Y)=2^2(0.21)=0.84. $$
Check these results from the two possible values of \(Y\): it equals \(10\) with probability \(0.7\) and \(12\) with probability \(0.3\). Thus \(E[Y]=0.7(10)+0.3(12)=10.6\), and \(E[Y^2]=0.7(100)+0.3(144)=113.2\). Therefore \(\operatorname{Var}(Y)=113.2-(10.6)^2=113.2-112.36=0.84\), in agreement with the transformation formula.
Worked Example: A Normal Variable Under an Affine Transformation
Suppose \(X\sim N(2,9)\), where the second parameter is the variance, and let \(Y=-1+\tfrac12X\). Find the MGF and domain of \(Y\), together with its mean and variance.
The MGF of \(X\) is \(M_X(s)=\exp(2s+9s^2/2)\), finite for every real \(s\). Thus \(D_X=\mathbb{R}\), and \(D_Y=\mathbb{R}\) as well. Substituting \(a=-1\) and \(b=1/2\), $$ M_Y(t)=e^{-t}M_X(t/2) =e^{-t}\exp\left(2\frac{t}{2}+\frac{9}{2}\left(\frac{t}{2}\right)^2\right) =\exp\left(\frac{9t^2}{8}\right). $$
The mean and variance follow either from the moment formulas or by differentiation: $$ E[Y]=-1+\frac12(2)=0,\qquad \operatorname{Var}(Y)=\left(\frac12\right)^2 9=\frac94. $$ The MGF also checks these values. Its first derivative at zero is \(0\), and its second derivative at zero is \(9/4\). Since the mean is zero, that second raw moment equals the variance.
Constant Transformations and Common Pitfalls
When \(b=0\), \(Y\) is the constant \(a\), regardless of the distribution or MGF domain of \(X\). For instance, if \(Y=5+0X=5\), then \(M_Y(t)=e^{5t}\) for every real \(t\), and \(E[Y]=5\), \(\operatorname{Var}(Y)=0\). The domain cannot be found by dividing by \(b\); use the constant case directly.
A common mistake is to shift the endpoints of the MGF domain by \(a\), as if \(D_Y\) were \(D_X+a\). The shift appears as the factor \(e^{at}\), which is finite and positive for every real \(t\), so it does not alter finiteness. Another mistake is to rescale the endpoints without checking the sign of \(b\). For negative \(b\), multiplication reverses inequalities. The reliable procedure is to solve \(bt\in D_X\) rather than guess how the interval changes.
These rules let you transfer MGF calculations between variables without recomputing an expectation from scratch. They also give a quick check on moment calculations: the mean must include the shift, while the variance must have \(b^2\), not \(b\). Keeping the domain alongside the formula prevents using an MGF expression where its defining expectation is infinite.
Check Your Understanding
Use the affine transformation rule and show the domain steps in each answer.
- If \(D_X=(-3,5)\) and \(Y=2+3X\), what is \(D_Y\)?
- If \(D_X=(-\infty,4)\) and \(Y=1-2X\), what is \(D_Y\)?
- Given \(E[X]=4\) and \(\operatorname{Var}(X)=7\), find the mean and variance of \(Y=-3+5X\).
- For \(Y=a\) with probability one, write its MGF and its domain.
- Explain why shifting \(X\) by \(a\) does not move the endpoints of its MGF domain.