Why Evaluate a Function Under a Conditional Law?
A conditional distribution describes how \(X\) behaves once the value of \(Y\) is known. Often the quantity of interest is not \(X\) itself, but a function \(g(X)\): for example, a deductible-adjusted payment, a rounded measurement, or a nonlinear score. The direct approach is to evaluate \(g\) at each possible value of \(X\), then average those results using the conditional probabilities or density of \(X\) given \(Y=y\).
This approach avoids an unnecessary intermediate step. One need not first derive the distribution of \(g(X)\). The key is to use the conditional law of \(X\), including its support and its weights, rather than the marginal law of \(X\).
For a discrete conditioning variable, the conditional mass function is defined when \(P(Y=y)>0\), by \(p_{X\mid Y}(x\mid y)=P(X=x,Y=y)/P(Y=y)\). For continuous variables, conditional densities are obtained from the joint and marginal densities wherever the marginal density of \(Y\) is positive. A conditional density at a particular \(y\) is understood through the chosen conditional-density model; values on zero-probability conditioning points cannot be determined from ordinary conditioning on an event of positive probability alone.
Why the Weighted-Sum and Integral Formulas Hold
The formula is the ordinary definition of an average applied to the conditional law. Conditioning changes the weights assigned to the possible values of \(X\), but it does not change how a function is evaluated: first calculate \(g(x)\), then average those values with the conditional weights.
Given \(Y=y\), the mutually exclusive outcomes \(X=x\) have conditional probabilities \(p_{X\mid Y}(x\mid y)\), which sum to 1. The expected value of a quantity taking value \(g(x)\) on outcome \(X=x\) is therefore the sum of each value multiplied by its probability: \(\sum_x g(x)p_{X\mid Y}(x\mid y)\).
For a small interval of width \(dx\) near \(x\), the conditional probability is approximately \(f_{X\mid Y}(x\mid y)\,dx\). The contribution to the average is approximately \(g(x)f_{X\mid Y}(x\mid y)\,dx\). Summing these contributions over the support in the limit gives \(\int g(x)f_{X\mid Y}(x\mid y)\,dx\).
The weights in either calculation must describe \(X\mid Y=y\). Replacing them with marginal probabilities or a marginal density answers a different question.
The formulas work for functions that are nonlinear or piecewise-defined. The function may change the values being averaged, but there is no need to calculate the probability distribution of those changed values first. This is particularly useful when \(g\) has thresholds, caps, or several pieces.
Worked Example: A Discrete Deductible-and-Limit Payment
A hypothetical policy has a deductible of $1,000 and a payment limit of $2,000 per claim. Let \(X\) be the claim severity in thousands of dollars. Conditional on a particular risk class \(Y=2\), suppose \(X\) has the following conditional law: \(P(X=0\mid Y=2)=0.25\), \(P(X=2\mid Y=2)=0.50\), and \(P(X=4\mid Y=2)=0.25\). Find the expected insurer payment in thousands of dollars. Assume there is no interest adjustment; no mortality assumption is relevant to this claim-payment calculation.
Method. Evaluate the payment function for each conditional value of \(X\), then take the probability-weighted sum. With amounts measured in thousands, the payment per loss is \(g(x)=\min(\max(x-1,0),2)\).
At \(X=0\), the loss is below the deductible, so \(g(0)=\min(0,2)=0\). At \(X=2\), the amount above the deductible is 1, so \(g(2)=\min(1,2)=1\). At \(X=4\), the amount above the deductible is 3, but the limit caps payment at 2, so \(g(4)=\min(3,2)=2\).
The conditional probabilities sum to \(0.25+0.50+0.25=1\). Therefore,
The expected payment is $1,000. This result lies between the smallest and largest possible payments, $0 and $2,000, as it should. The common mistake is to apply the deductible but forget the payment limit: that would assign a payment of 3, rather than 2, when \(X=4\), producing an incorrect average of 1.25 thousand dollars.
Continuous Conditional Laws
For a continuous conditional law, the integral uses the conditional density and its conditional support. When \(g\) is piecewise-defined, split the integral at every point where its formula changes. This is not a transformation-of-variables calculation: the goal is an average, not the density or distribution function of \(g(X)\).
Worked Example: A Threshold Function Under a Conditional Uniform Law
Suppose that, for positive \(y\), the conditional distribution of \(X\) given \(Y=y\) is uniform on \((0,y)\). Thus its conditional density is \(f_{X\mid Y}(x\mid y)=1/y\) for \(0<x<y\), and zero otherwise. Given \(Y=4\), calculate \(E[(X-1)_+\mid Y=4]\), where \((z)_+=\max(z,0)\).
Check the conditional law. At \(y=4\), the density is \(1/4\) on \(0<x<4\), and its integral is \(\int_0^4(1/4)\,dx=1\). The function is zero for \(x\leq1\) and equals \(x-1\) for \(x>1\). Hence
The conditional expectation is 1.125. The common mistake is to integrate \(x-1\) over the full interval from 0 to 4. On \(0<x<1\), the positive-part function is zero, not negative; the integral must respect that piece of the definition.
The conditional density may be nonconstant, so values of \(X\) need not receive equal weight. A density is not itself a probability at a point; the probability of a region is found by integrating the density over that region. In an expectation integral, the density weights the function values in precisely this way.
Worked Example: A Nonlinear Function Under a Triangular Conditional Density
For \(y>0\), suppose \(X\mid Y=y\) has density \(f_{X\mid Y}(x\mid y)=2x/y^2\) for \(0<x<y\), and zero otherwise. Given \(Y=2\), find \(E[\sqrt{X}\mid Y=2]\). Also compare it with \(\sqrt{E[X\mid Y=2]}\). There is no interest-rate or mortality component in this probability model.
Check the density and substitute the conditioning value. Its integral over the conditional support is \(\int_0^y 2x/y^2\,dx=[x^2/y^2]_0^y=1\). At \(y=2\), the density is \(x/2\) for \(0<x<2\). Apply the expectation integral directly:
The comparison requires calculating the conditional mean of \(X\) first:
Rounded to four decimal places, the two quantities are 1.1314 and 1.1547, respectively, so they are not equal. The wrong calculation would replace \(E[\sqrt{X}\mid Y=2]\) with \(\sqrt{E[X\mid Y=2]}\). The correction is to apply the square-root function to each possible \(X\) inside the expectation integral, as in the first calculation.
Checks and Common Exam Traps
Before finalizing a calculation, verify that the conditional law is the one requested, that its support is correct, and that the conditional probabilities sum to 1 or the conditional density integrates to 1. Then check that the function has been evaluated on every part of that support. In particular, thresholds and caps can change the formula for \(g(x)\) within the support.
- Using a marginal law. \(E[g(X)\mid Y=y]\) uses the law of \(X\mid Y=y\), not the unconditional law of \(X\).
- Applying the function after averaging. In general, \(E[g(X)\mid Y=y]\) is not \(g(E[X\mid Y=y])\). The worked nonlinear example shows this difference numerically.
- Ignoring part of a piecewise function. Write down the intervals on which each formula applies before integrating.
- Forgetting the conditional support. A density formula only applies on its stated support; integrating outside it can introduce incorrect contributions.
- Failing to check existence. If the weighted sum or integral of \(|g(X)|\) is infinite, the expectation need not be a finite number.
Check Your Understanding
For each problem, calculate the requested conditional expectation directly from the stated conditional law.
- Given \(Y=1\), \(X\) takes values \(-1,0,2\) with conditional probabilities \(0.20,0.30,0.50\), respectively. Find \(E[(X+1)^2\mid Y=1]\). (Answer: 4.8)
- A hypothetical claim count \(N\), given a risk category \(Y=3\), takes values \(0,1,3\) with probabilities \(0.40,0.40,0.20\). A payment is \(g(N)=\max(N-1,0)\). Find the expected payment count given \(Y=3\). (Answer: 0.4)
- Given \(Y=6\), \(X\) is uniform on \((0,6)\). Find \(E[(X-2)_+\mid Y=6]\). (Answer: \(4/3\))
- Given \(Y=2\), \(X\) has density \(3x^2/8\) on \(0<x<2\). Find \(E[1/(1+X)\mid Y=2]\), to four decimal places. (Answer: \(3\ln(3)/8\approx0.4120\))
- Given \(Y=5\), \(X\) has density \(2x/25\) on \(0<x<5\). A hypothetical payment in thousands of dollars is \(g(X)=\min(\max(X-1,0),2)\). Find its conditional expectation, in thousands of dollars. (Answer: \(124/75\approx1.6533\) thousand dollars)