Skip to content
Glacius
ProbabilityConcept reference

Conditional expectation

A conditional mean is an expectation under a conditional distribution.

On this page 7 sections
  1. Overview
  2. Average within an observed case
  3. Use the conditional probabilities
  4. A group average is still an average
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01Average within an observed case#

A conditional mean is an expectation under a conditional distribution. Once a case has been observed, use the probabilities within that case to weight the remaining possible values.

Write py(x)=P(X=xY=y)p_y(x)=P(X=x\mid Y=y) for the conditional probabilities. Weight each possible value by its conditional probability:

E[XY=y]=xxpy(x)\begin{gathered}E[X\mid Y=y]\\=\sum_x x\,p_y(x)\end{gathered}

Different observed values of YY can produce different means. Before observing YY, the expression E[XY]E[X\mid Y] is a rule that maps each case to its conditional mean.

02Use the conditional probabilities#

Suppose XX takes values 0,40,4. Given Y=aY=a, their conditional probabilities are 0.75,0.250.75,0.25. The conditional mean is 0(0.75)+4(0.25)=10(0.75)+4(0.25)=1.

Given Y=bY=b, suppose the probabilities are 0.25,0.750.25,0.75. The conditional mean is now 33. The outcomes are the same; the conditional weights changed.

Check your reasoning

Given Y=a, X takes values 0,6 with probabilities 0.75,0.25. Find E[X | Y=a].

  1. A1.5
  2. B3
  3. C4.5
Show answer and explanation
1.5

Use the within-case weights: 0×0.75+6×0.25.

03A group average is still an average#

A conditional mean of 11 does not say the next XX will equal 11: only zero and four can occur in this example. It is the weighted average under the stated observation.

A regression model may predict an outcome's conditional mean from input features. This lesson assumes the conditional distribution is supplied; learning that distribution or fitting a prediction function is a separate task.

Check your reasoning

Conditional probabilities for values 0,10 are 0.9,0.1. A draft uses their unweighted average 5. Correct mean?

  1. A5
  2. B1
  3. C9
Show answer and explanation
1

Unequal conditional weights must be preserved.

If a joint table is supplied instead, first obtain the conditional probabilities using the earlier normalization rule. Joint masses are not ready-made conditional weights. The conditioning case must have positive probability for that finite-table calculation.

Key takeaway

Compute a conditional mean from a conditional mass function.

  • Compute a conditional mean from a conditional mass function.

Sources & further reading

  1. [1]
  2. [2]
    Harvard Stat 110, Strategic Practice 10 (2011)stat110.hsites.harvard.edu · Article
  3. [3]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Conditional expectation.” Math behind ML. /learn/p-conditional-mean