4.4 Conditional variance
Definition 4.4.1. The conditional variance of \(X\) given \(Y\) is \[ \Var (X \mid Y) = E\Bigl [\bigl (X - E(X \mid Y)\bigr )^2 \Bigm | Y\Bigr ] = E(X^2 \mid Y) - \bigl (E(X \mid Y)\bigr )^2 . \] Like \(E(X \mid Y)\), it is a random variable, a function of \(Y\).
Result 4.4.2 (Conditional variance formula). For random variables \(X\) and \(Y\), \[ \Var (X) = E\bigl (\Var (X \mid Y)\bigr ) + \Var \bigl (E(X \mid Y)\bigr ) . \]
Proof. Taking expectations in \(\Var (X \mid Y) = E(X^2 \mid Y) - \bigl (E(X \mid Y)\bigr )^2\) and using Result 4.2.1, \[ E\bigl (\Var (X \mid Y)\bigr ) = E(X^2) - E\bigl [\bigl (E(X \mid Y)\bigr )^2\bigr ] . \qquad (1) \] Also, since \(E\bigl (E(X \mid Y)\bigr ) = E(X)\), \[ \Var \bigl (E(X \mid Y)\bigr ) = E\bigl [\bigl (E(X \mid Y)\bigr )^2\bigr ] - \bigl (E(X)\bigr )^2 . \qquad (2) \] Adding (1) and (2), the middle terms cancel: \[ E\bigl (\Var (X \mid Y)\bigr ) + \Var \bigl (E(X \mid Y)\bigr ) = E(X^2) - \bigl (E(X)\bigr )^2 = \Var (X) . \] □
Example 4.4.3. Suppose that by time \(t\) the number of passengers who have checked in for a flight is a Poisson random variable with mean \(\mu t\). The check-in counter closes at a time \(X\) that is uniformly distributed on \((0, T)\), independently of the arrivals. Find the mean and variance of the number of passengers who have checked in when the counter closes.
Solution. Let \(N(t)\) be the number checked in by time \(t\), so the quantity of interest is \(N(X)\). Given \(X = t\), \(N(X) = N(t)\) is Poisson with mean \(\mu t\), because \(X\) is independent of the arrivals, so \[ E\bigl (N(X) \mid X = t\bigr ) = \mu t , \qquad \Var \bigl (N(X) \mid X = t\bigr ) = \mu t . \] That is, \(E(N(X) \mid X) = \mu X\) and \(\Var (N(X) \mid X) = \mu X\). By Result 4.2.1, \[ E\bigl (N(X)\bigr ) = E(\mu X) = \mu E(X) = \frac {\mu T}{2} , \] and by the conditional variance formula, with \(\Var (X) = T^2/12\), \begin {align*} \Var \bigl (N(X)\bigr ) &= E\bigl (\Var (N(X) \mid X)\bigr ) + \Var \bigl (E(N(X) \mid X)\bigr ) \\ &= E(\mu X) + \Var (\mu X) \\ &= \frac {\mu T}{2} + \mu ^2\frac {T^2}{12} = \frac {\mu T}{12}(6 + \mu T) . \end {align*}
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.