Skip to content

Conditional Variance Given a Random Variable

Definition

For E[Y2]<∞\mathbb{E}[Y^2]<\infty, conditional variance is

Var⁡(Y∣X)=E[(Y−E[Y∣X])2∣X]=E[Y2∣X]−(E[Y∣X])2.\operatorname{Var}(Y\mid X) =\mathbb{E}[(Y-\mathbb{E}[Y\mid X])^2\mid X] =\mathbb{E}[Y^2\mid X]-(\mathbb{E}[Y\mid X])^2.

These identities hold almost surely.

Apply the definition of Variance and Standard Deviation within the law conditional on XX: subtract the Conditional Expectation Given a Random Variable and average its squared residual under that same conditional law.


Interpretation

Conditional variance measures how much spread in YY remains once the value of XX is known. Like the conditional expectation E[Y∣X]\mathbb{E}[Y\mid X], it is itself a random variable: a function of XX, not a single number.

The conditional mean line E(Y given X = x) = x with a band of one standard deviation, the square root of x, around it; the band is narrow at x = 1 and wider at x = 4.

The diagram shows Y∣X=x∼Pois⁡(x)Y\mid X=x\sim\operatorname{Pois}(x). The band around the conditional mean line E[Y∣X=x]=x\mathbb{E}[Y\mid X=x]=x has half-width Var⁡(Y∣X=x)=x\sqrt{\operatorname{Var}(Y\mid X=x)}=\sqrt{x}: ±1\pm1 at x=1x=1 and ±2\pm2 at x=4x=4, so larger xx gives more spread. Evaluating at the random XX gives the random variable Var⁡(Y∣X)=X\operatorname{Var}(Y\mid X)=X, as in the first Example.

Var⁡(Y∣X=x)\operatorname{Var}(Y\mid X=x) is the spread within group xx (right); averaged over XX it gives E[Var⁡(Y∣X)]\mathbb{E}[\operatorname{Var}(Y\mid X)].

Read the definition in two steps. First fix X=xX=x and compute an ordinary variance under the conditional distribution of YY given X=xX=x: for discrete XX this is the conditional variance given the event {X=x}\{X=x\}, a number v(x)v(x); for continuous XX the conditional PDF takes over this role. Then substitute the random XX to get Var⁡(Y∣X)=v(X)\operatorname{Var}(Y\mid X)=v(X). The squared deviations are measured from E[Y∣X]\mathbb{E}[Y\mid X], the centre of each group, not from the overall mean EY\mathbb{E}Y. The second formula is the familiar "mean of the square minus square of the mean", applied inside the conditional distribution.

Averaging v(X)v(X) over XX gives E[Var⁡(Y∣X)]\mathbb{E}[\operatorname{Var}(Y\mid X)], the within-group part of Eve's law. A common slip is to expect Var⁡(Y)=E[Var⁡(Y∣X)]\operatorname{Var}(Y)=\mathbb{E}[\operatorname{Var}(Y\mid X)]: this misses the spread of the group centres themselves, Var⁡(E[Y∣X])\operatorname{Var}(\mathbb{E}[Y\mid X]).


Key Results

  • Var⁡(Y∣X)≥0\operatorname{Var}(Y\mid X)\ge0 almost surely.
  • For real constants a,ba,b, Var⁡(a+bY∣X)=b2Var⁡(Y∣X)\operatorname{Var}(a+bY\mid X)=b^2\operatorname{Var}(Y\mid X).

Examples

  • If Y∣X∼Pois⁡(X)Y\mid X\sim\operatorname{Pois}(X) with E[X2]<∞\mathbb{E}[X^2]<\infty, then Var⁡(Y∣X)=X\operatorname{Var}(Y\mid X)=X.
  • If Y∣X∼Bin⁡(n,X)Y\mid X\sim\operatorname{Bin}(n,X) with 0≤X≤10\le X\le1, then Var⁡(Y∣X)=nX(1−X)\operatorname{Var}(Y\mid X)=nX(1-X).

Prerequisites

Sources

Symbols: infinity, square root

Last updated: 22 October 2026 19:04