Tutorials › Statistical Theory I - Probability and Distribution Theory › Affine Transformations of Variance

Variance and Covariance Structure · Tutorial 350 of 994

Affine Transformations of Variance

Learn why adding a constant leaves variance unchanged, while multiplying a random variable by a constant multiplies its variance by the constant’s square.

Intermediate 8 min read

What You'll Learn

  • State the finite-second-moment condition for the affine variance rule.
  • Derive the rule from the definition of variance using centered squares.
  • Calculate variance after shifts, rescalings, and sign reversals.
  • Check transformed variances directly in discrete and continuous examples.
  • Distinguish the effects of an additive constant and a multiplicative constant.
  • Identify common errors involving signs, squares, and random coefficients.

Why Affine Transformations Matter

Changing the scale or origin of a random variable is common in statistical work. A temperature may be converted from Celsius to Fahrenheit; a measurement may be expressed in centimeters rather than meters; or a score may be shifted so that a chosen reference value is zero. Such changes affect the numerical values of the variable, but they do not all affect its variability in the same way.

The key distinction is between a shift, which adds a constant, and a rescaling, which multiplies by a constant. This tutorial derives the variance of \(aX+b\) and shows how to use the result while keeping track of signs, units, and the assumptions required.

Definition: Let \(X\) be a random variable with \(E[X^2]<\infty\), and let \(a,b\in\mathbb{R}\) be constants. The random variable \(Y=aX+b\) is an affine transformation of \(X\). The finite-second-moment condition ensures that \(X\), \(Y\), and their variances are well-defined and finite.

Recall that \(\operatorname{Var}(X)=E[(X-E[X])^2]\). Variance measures the average squared distance from the mean, so a shift changes both each value and the mean by the same amount. A rescaling, in contrast, multiplies each distance from the mean by the scale factor.

The Affine Variance Rule

Theorem: If \(E[X^2]<\infty\) and \(a,b\) are real constants, then
$$ \operatorname{Var}(aX+b)=a^2\operatorname{Var}(X). $$
In particular, adding a constant does not change variance, and multiplying by a negative constant has the same variance effect as multiplying by its absolute value.

Proof. Since \(E[X^2]<\infty\), \(E[X]\) is finite, and linearity of expectation gives \(E[aX+b]=aE[X]+b\). Subtract this mean from the transformed variable:

$$ (aX+b)-E[aX+b] =aX+b-aE[X]-b =a(X-E[X]). $$

Squaring and taking expectations gives

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

The factor \(a^2\) can be taken outside the expectation because it is a constant. The calculation also shows directly why \(b\) disappears: it cancels when the transformed mean is subtracted. \(\square\)

The result separates the roles of \(a\) and \(b\). The shift \(b\) changes the location of the distribution but not its spread. The multiplier \(a\) changes each deviation from the mean by \(a\), so squared deviations are multiplied by \(a^2\). A sign reversal, \(a=-1\), reflects values around zero but preserves all squared deviations.

Corollary: If \(\sigma_X=\sqrt{\operatorname{Var}(X)}\) and \(\sigma_Y=\sqrt{\operatorname{Var}(aX+b)}\) denote the standard deviations, then
$$ \sigma_Y=|a|\sigma_X. $$
This follows because standard deviation is the nonnegative square root of variance: \(\sqrt{a^2\operatorname{Var}(X)}=|a|\sqrt{\operatorname{Var}(X)}\).

The absolute value in the standard deviation formula is important. A negative multiplier reverses the ordering of values, but standard deviation cannot be negative. Variance has squared units, while standard deviation has the same units as the original variable; after rescaling by \(a\), those units are multiplied by \(|a|\).

Worked Applications

Worked Example: A Shift, Rescaling, and Sign Reversal

Suppose \(X\) has the following distribution:

\(x\)135
\(P(X=x)\)0.20.50.3

Find the variance of \(Y=-2X+7\), first using the rule and then checking directly.

Step 1: Find \(\operatorname{Var}(X)\). The probabilities sum to \(0.2+0.5+0.3=1\). The mean is

$$ E[X]=(1)(0.2)+(3)(0.5)+(5)(0.3)=0.2+1.5+1.5=3.2. $$

Thus

$$ \begin{aligned} \operatorname{Var}(X) &=(1-3.2)^2(0.2)+(3-3.2)^2(0.5)+(5-3.2)^2(0.3)\\ &=4.84(0.2)+0.04(0.5)+3.24(0.3)\\ &=0.968+0.020+0.972=1.96. \end{aligned} $$

Step 2: Apply the affine rule. Here \(a=-2\), so

$$ \operatorname{Var}(Y)=(-2)^2(1.96)=4(1.96)=7.84. $$

Step 3: Check directly. The transformed values are \(5,1,-3\), with the same respective probabilities. Their mean is \(5(0.2)+1(0.5)+(-3)(0.3)=0.6\). Therefore

$$ \begin{aligned} \operatorname{Var}(Y) &=(5-0.6)^2(0.2)+(1-0.6)^2(0.5)+(-3-0.6)^2(0.3)\\ &=19.36(0.2)+0.16(0.5)+12.96(0.3)\\ &=3.872+0.080+3.888=7.84. \end{aligned} $$

The direct calculation agrees. The added 7 has no effect on variance, while the factor \(-2\) multiplies variance by \(4\), not by \(-2\).

Worked Example: Rescaling a Continuous Random Variable

Let \(X\) have the uniform distribution on \([0,2]\), with density \(f(x)=1/2\) for \(0\leq x\leq2\). Find the variance of \(Y=3X-4\).

First calculate the variance of \(X\) from its centered-square definition. The mean is

$$ E[X]=\int_0^2 x\frac12\,dx =\frac12\left[\frac{x^2}{2}\right]_0^2=1. $$

Consequently,

$$ \begin{aligned} \operatorname{Var}(X) &=\int_0^2(x-1)^2\frac12\,dx\\ &=\frac12\left[\frac{(x-1)^3}{3}\right]_0^2\\ &=\frac12\left(\frac13-\left(-\frac13\right)\right)=\frac13. \end{aligned} $$

For \(Y=3X-4\), the constants are \(a=3\) and \(b=-4\). Hence

$$ \operatorname{Var}(Y)=3^2\operatorname{Var}(X) =9\left(\frac13\right)=3. $$

As a direct check, \(E[Y]=3E[X]-4=-1\), and \(Y-E[Y]=3X-3=3(X-1)\). Therefore

$$ \operatorname{Var}(Y) =\int_0^2 [3(x-1)]^2\frac12\,dx =9\operatorname{Var}(X) =3. $$

The shift moves the interval of possible values from \([0,2]\) to \([-4,2]\), but only the factor 3 changes the variance.

Worked Example: Reversing and Shifting a Bernoulli Variable

Let \(X\sim\operatorname{Bernoulli}(1/4)\), so \(P(X=1)=1/4\) and \(P(X=0)=3/4\). Find the variance of \(Z=4-5X\).

For a Bernoulli variable with success probability \(p\), its mean is \(p\) and its variance is \(p(1-p)\). Here

$$ \operatorname{Var}(X)=\frac14\left(1-\frac14\right) =\frac14\cdot\frac34=\frac{3}{16}. $$

The transformation has multiplier \(-5\) and shift \(4\), so

$$ \operatorname{Var}(Z)=(-5)^2\frac{3}{16} =\frac{75}{16}=4.6875. $$

To check, \(Z=4\) when \(X=0\), with probability \(3/4\), and \(Z=-1\) when \(X=1\), with probability \(1/4\). Its mean is

$$ E[Z]=4\left(\frac34\right)+(-1)\left(\frac14\right) =3-\frac14=\frac{11}{4}. $$

The centered values are \(4-11/4=5/4\) and \(-1-11/4=-15/4\). Thus

$$ \begin{aligned} \operatorname{Var}(Z) &=\left(\frac54\right)^2\frac34+ \left(-\frac{15}{4}\right)^2\frac14\\ &=\frac{25}{16}\frac34+\frac{225}{16}\frac14\\ &=\frac{75}{64}+\frac{225}{64} =\frac{300}{64}=\frac{75}{16}. \end{aligned} $$

The direct calculation confirms that the negative sign in the multiplier does not make variance negative.

Degenerate Cases and Equality of Variances

The formula also handles zero multipliers and random variables with zero variance. If \(a=0\), then \(aX+b=b\) is constant, so its variance is zero, exactly as the formula states. If \(X\) itself is constant with probability one, then its variance is zero and every affine transformation of it is also constant.

Proposition: Under the finite-second-moment condition, \(\operatorname{Var}(aX+b)=\operatorname{Var}(X)\) if and only if either \(\operatorname{Var}(X)=0\), or \(a^2=1\).

Proof. By the affine variance rule, equality is equivalent to \(a^2\operatorname{Var}(X)=\operatorname{Var}(X)\), or \((a^2-1)\operatorname{Var}(X)=0\). A product of two real numbers is zero exactly when at least one factor is zero. Thus either \(\operatorname{Var}(X)=0\), or \(a^2-1=0\), which is equivalent to \(a=1\) or \(a=-1\). The shift \(b\) is unrestricted. \(\square\)

For a nonconstant variable, therefore, the only multipliers that preserve variance are \(1\) and \(-1\). More generally, if \(a\neq0\), the variance is multiplied by \(a^2\): factors with \(|a|>1\) increase it, while factors with \(0<|a|<1\) decrease it.

Common Mistakes and Practical Checks

  • Multiplying variance by \(a\) instead of \(a^2\). Each centered value is multiplied by \(a\), but variance averages squared centered values. The resulting factor is \(a^2\).
  • Letting a shift affect variance. The constant \(b\) appears in both the transformed variable and its mean, then cancels in the difference from that mean.
  • Keeping the sign of a negative multiplier. A negative scale reverses deviations, but their squares are nonnegative. For example, a multiplier of \(-3\) multiplies variance by \(9\).
  • Applying the rule when the coefficient is random. The theorem assumes \(a\) and \(b\) are constants. If a coefficient is itself random, the displayed rule does not follow just by treating it as a constant.
  • Confusing variance and standard deviation. Variance scales by \(a^2\); standard deviation scales by \(|a|\). The units provide a useful check: variance has squared units, standard deviation has the original units.
Key takeaway: For a finite-variance random variable and fixed constants \(a,b\), shifting by \(b\) leaves variance unchanged, while rescaling by \(a\) multiplies variance by \(a^2\). The shift controls location; the magnitude of the scale controls spread.

Check Your Understanding

Use the affine variance rule where it applies, and explain your reasoning.

  1. If \(\operatorname{Var}(X)=6\), what is \(\operatorname{Var}(X+9)\)?
  2. If \(\operatorname{Var}(X)=2.5\), find \(\operatorname{Var}(-4X+1)\).
  3. A variable has standard deviation 3. What is the standard deviation of \(0.2X-8\)?
  4. For a nonconstant \(X\), which multipliers \(a\) leave \(\operatorname{Var}(aX+b)\) equal to \(\operatorname{Var}(X)\)? Does the answer depend on \(b\)?
  5. Why is it incorrect to conclude that \(\operatorname{Var}(-2X)= -2\operatorname{Var}(X)\)?