Why Conditional Expectation Errors Matter
A conditional expectation can be calculated incorrectly even when the arithmetic is simple. Typical causes are dividing by the wrong probability, including values outside the conditional support, or treating a conditional mean as though it were the overall mean. These errors matter because a conditional expectation describes a particular group or condition; it does not automatically describe the whole population.
The calculations below use discrete and continuous models. In each case, the first checks are the same: identify exactly what is being conditioned on, find the probability or density of that condition, and establish the values over which the conditional distribution is defined.
Three Checks Before Calculating
A reliable calculation begins with the condition, not with the expectation formula. For a discrete model, the denominator is the marginal probability \(P(Y=y)\), found by summing the joint probabilities for that value of \(Y\). For a continuous model, the denominator is the marginal density \(f_Y(y)\), found by integrating the joint density over the possible values of \(X\) at that \(y\). It is not generally a probability at a single point.
Next, establish the conditional support. A joint density may be zero outside a triangle, wedge, or other restricted region; the conditional density must be zero wherever the joint density is zero. Finally, check that the conditional probabilities sum to one, or that the conditional density integrates to one. These normalization checks often expose a wrong denominator or support before the expectation is calculated.
Write down what is known, such as \(Y=y\), before selecting a denominator or support.
Divide the joint probability or density by its marginal, and state where the result is nonzero.
Verify total conditional probability or density is one, then take the conditional mean over that support.
Use the distribution of \(Y\) to average conditional means when the target is \(E[X]\).
Worked Example: A Discrete Conditional PMF
Worked Example: A Discrete Conditional PMF
A hypothetical monitoring study records integer-valued alert score \(X\) and review category \(Y\). The joint probability mass function is given below. Find the conditional pmf of \(X\) given \(Y=1\), calculate \(E[X\mid Y=1]\), and then find \(E[X]\). This is a finite discrete distribution; no interest rate or mortality assumption is involved.
| \(Y\backslash X\) | \(X=0\) | \(X=1\) | \(X=2\) | \(X=3\) | \(X=4\) |
|---|---|---|---|---|---|
| \(Y=0\) | 0.10 | 0 | 0.10 | 0 | 0 |
| \(Y=1\) | 0.10 | 0.20 | 0 | 0.20 | 0 |
| \(Y=2\) | 0 | 0 | 0.15 | 0 | 0.15 |
Method: normalize the joint row for the specified conditioning value. The row total is \(P(Y=1)=0.10+0.20+0+0.20+0=0.50\). Divide every entry in that row by \(0.50\):
The conditional probabilities sum to \(0.20+0.40+0+0.40+0=1\), so the normalization check passes. The conditional support is \(\{0,1,3\}\), since \(X=2\) and \(X=4\) have zero probability in this row. Therefore,
For the overall mean, first compute the marginal probabilities \(P(Y=0)=0.20\), \(P(Y=1)=0.50\), and \(P(Y=2)=0.30\). The conditional means are \(E[X\mid Y=0]=(0(0.10)+2(0.10))/0.20=1\) and \(E[X\mid Y=2]=(2(0.15)+4(0.15))/0.30=3\). Thus,
Check: Directly from the joint pmf, \(E[X]=2(0.10)+1(0.20)+3(0.20)+2(0.15)+4(0.15)=0.20+0.20+0.60+0.30+0.60=1.90\), in agreement. Common mistake avoided: dividing the \(Y=1\) row by the grand total \(1\), rather than by its row total \(0.50\), would leave probabilities summing to \(0.50\), not one.
Support and the Conditional Density
For a continuous pair, the marginal density is obtained by integrating over the support permitted by the fixed conditioning value. Consequently, the bounds can depend on that value. Using the full range of \(X\) when only part of it is compatible with \(Y=y\) changes both the denominator and the conditional expectation.
Worked Example: A Density on a Triangular Support
Let \((X,Y)\) have joint density \(f_{X,Y}(x,y)=2\) when \(0<x<y<1\), and zero elsewhere. Find \(f_{X\mid Y}(x\mid y)\), calculate \(E[X\mid Y=0.6]\), and compare it with \(E[X]\). This is a continuous triangular-support model with density parameter equal to \(2\); no interest rate or mortality assumption is involved.
Method: integrate over the joint support at fixed \(y\). When \(0<y<1\), the restriction \(0<x<y\) gives the marginal density
The conditional density is therefore
and it is zero outside \(0<x<y\). Its integral is \(\int_0^y (1/y)\,dx=1\), as required. At \(y=0.6\), the conditional support is \(0<x<0.6\), not \(0<x<1\). Hence
To find the unconditional mean, first use the marginal density \(f_Y(y)=2y\) and average the conditional mean:
Check: Direct integration over the triangle gives \(E[X]=\int_0^1\int_0^y 2x\,dx\,dy=\int_0^1 y^2\,dy=1/3\). Thus the conditional mean at \(Y=0.6\) is \(0.30\), while the overall mean is \(1/3\). Common mistake avoided: integrating \(x\) from 0 to 1 when \(Y=0.6\) violates the triangular support. A conditional density on that incorrect interval would not represent the stated joint model.
Why Conditional Means Must Be Weighted
The conditional mean \(E[X\mid Y=y]\) describes the subset with \(Y=y\). To recover the overall mean, average those conditional means using how often each value of \(Y\) occurs. For discrete \(Y\), the weights are \(P(Y=y)\); for continuous \(Y\), they are the marginal density \(f_Y(y)\) inside an integral.
For the discrete case, the reason follows directly from the joint pmf. Substitute the conditional pmf into the definition, then rearrange the finite sums:
The second equality uses \(P(X=x\mid Y=y)P(Y=y)=P(X=x,Y=y)\). The continuous version follows by the same substitution and integration over the joint support:
These identities require the expectations to exist; for example, it is sufficient that \(E[|X|]\) is finite. They also show why an unweighted average of conditional means is generally wrong: it treats all conditioning values as equally common, regardless of their probabilities.
Worked Example: Averaging Conditional Means in a Hypothetical Benefit Model
A hypothetical benefit amount \(X\), in dollars, depends on review class \(Y\). Class A occurs with probability \(0.80\); conditional on A, the benefit is \(0\) with probability \(0.25\) and \(10\) with probability \(0.75\). Class B occurs with probability \(0.20\); conditional on B, the benefit is \(0\) or \(20\), each with probability \(0.50\). Find each class-specific mean and the overall mean. No interest rate or mortality assumption applies; these are the specified conditional discrete distributions.
Method: compute the conditional means, then weight by class probabilities. For class A, \(E[X\mid Y=A]=0(0.25)+10(0.75)=7.50\) dollars. For class B, \(E[X\mid Y=B]=0(0.50)+20(0.50)=10.00\) dollars. The overall expectation is
Check: The joint probabilities for the positive outcomes are \(P(X=10,Y=A)=0.80(0.75)=0.60\) and \(P(X=20,Y=B)=0.20(0.50)=0.10\). Thus the direct calculation is \(E[X]=10(0.60)+20(0.10)=6+2=8.00\) dollars. Common mistake avoided: the unweighted average \((7.50+10.00)/2=8.75\) dollars is not the overall mean, because the two classes do not have equal probabilities.
Common Errors and Their Corrections
A conditional expectation calculation should be auditable: a reader should be able to see the condition, the normalization, the support, and the weights. The following errors are especially easy to make under time pressure.
- Wrong denominator. In a discrete conditional pmf, use \(P(Y=y)\), not the grand total or the number of possible \(X\) values. In a continuous conditional density, use \(f_Y(y)\), not \(P(Y=y)\), which is typically zero for a continuous variable.
- Wrong support. When \(Y=y\) is fixed, retain only the \(X\) values allowed by the joint model. In a density calculation, integrate over those bounds, even when the bounds depend on \(y\).
- Confusing a conditional value with an overall mean. \(E[X\mid Y=y]\) is a number for the specified \(y\). \(E[X\mid Y]\) is a random variable that changes with \(Y\). Neither should be called \(E[X]\) without averaging over the distribution of \(Y\).
- Using equal weights without justification. Conditional means are weighted by the probabilities or density of the conditioning variable, not by the number of categories in a list.
- Skipping the final check. Conditional probabilities must total one, and a conditional density must integrate to one. When feasible, calculate \(E[X]\) both from the conditional means and directly from the marginal or joint distribution.
Check Your Understanding
For each problem, identify the condition and support before calculating. Answers are provided at the end of each item.
- A discrete joint pmf has \(P(X=1,Y=0)=0.10\), \(P(X=3,Y=0)=0.30\), \(P(X=0,Y=1)=0.30\), and \(P(X=2,Y=1)=0.30\), with all other joint probabilities zero. Find \(P(X=3\mid Y=0)\) and \(E[X\mid Y=0]\). (Answer: \(0.75\) and \(2.50\), respectively.)
- A joint density is \(f_{X,Y}(x,y)=2\) on \(0<x<y<1\), and zero elsewhere. Find \(f_Y(y)\), the conditional support of \(X\) given \(Y=0.4\), and \(E[X\mid Y=0.4]\). (Answer: \(f_Y(y)=2y\) for \(0<y<1\); support \(0<x<0.4\); conditional mean \(0.20\).)
- A two-class model has \(P(Y=A)=0.70\), \(P(Y=B)=0.30\), \(E[X\mid Y=A]=3\), and \(E[X\mid Y=B]=11\). Calculate \(E[X]\) and explain why the unweighted average is not the answer. (Answer: \(5.4\); the unweighted average \(7\) ignores the unequal class probabilities.)
- A conditional pmf given \(Y=2\) assigns probabilities \(0.25,0.50,0.25\) to \(X=0,2,6\), respectively. Find \(E[X\mid Y=2]\) and verify the normalization. (Answer: probabilities sum to \(1\), and \(E[X\mid Y=2]=0(0.25)+2(0.50)+6(0.25)=2.5\).)
- In a continuous model, \(f_Y(y)=3y^2\) for \(0<y<1\) and \(E[X\mid Y=y]=2y\). Find \(E[X]\) by averaging the conditional mean, and state the weighting density. (Answer: the weighting density is \(3y^2\), and \(E[X]=\int_0^1(2y)(3y^2)\,dy=6/4=1.5\).)