Why a Marginally Best Action May Be Wrong
A decision made before seeing any predictors must use the outcome’s marginal distribution. But if predictors are available when the action is chosen, the outcome distribution can differ across predictor values. A single action can therefore be optimal on average and still be inferior for some predictor values. The key distinction is between choosing one constant action and choosing a rule that responds to the observed predictors.
This distinction applies to classification and numerical prediction alike. In classification, the marginally most likely class need not be the best class for every predictor group. Under squared loss, the marginal mean minimizes risk among constant predictions, while the conditional mean can vary with the predictors. The question is not whether a marginal action is optimal among constants; it is whether it remains optimal when predictor-dependent actions are allowed.
Marginal Risk and Conditional Risk
Let \(Y\) be an outcome, \(Z\) the observed predictor, \(\mathcal A\) an action set, and \(L(a,Y)\) the loss from taking action \(a\) when the outcome is \(Y\). A constant action is chosen without using \(Z\). A decision rule \(g\) chooses the action \(g(Z)\) after observing \(Z\). Suppose the losses are integrable for the actions and rules being compared.
A marginally optimal action minimizes \(R(a)\) over constant actions. A conditional minimizer chooses, for each predictor value, an action minimizing \(r(a,Z)\). When the action set is finite, a measurable conditional minimizing rule can be obtained by ordering the actions and breaking ties in favor of the first minimizer. This avoids any ambiguity in defining the rule.
The equality \(R(a)=E[r(a,Z)]\) follows from the defining property of conditional expectation. It says that marginal risk averages conditional risk across predictor values. It does not say that an action minimizing this average must minimize each term being averaged.
Worked Example: The Marginal Majority Class Is Wrong in One Group
Let \(Y\in\{0,1\}\), let \(Z\in\{A,B\}\), and use zero-one loss: \(L(a,Y)=1\) if \(a\ne Y\), and \(0\) otherwise. Suppose \(P(Z=A)=0.25\), \(P(Z=B)=0.75\), with \(P(Y=1\mid Z=A)=0.9\) and \(P(Y=1\mid Z=B)=0.1\).
The marginal probability of class 1 is \(P(Y=1)=0.25(0.9)+0.75(0.1)=0.225+0.075=0.30\). Thus class 0 is the unique marginally most likely class. Its constant-action risk is \(P(Y=1)=0.30\); class 1 has risk \(P(Y=0)=0.70\).
Conditionally, the risk of predicting 0 is \(0.9\) at \(A\) and \(0.1\) at \(B\). The risk of predicting 1 is \(0.1\) at \(A\) and \(0.9\) at \(B\). The conditional rule predicts 1 at \(A\) and 0 at \(B\), so its total risk is \(0.25(0.1)+0.75(0.1)=0.025+0.075=0.10\).
The marginal choice of 0 is best among constant actions, but it is not best at \(A\). Using the predictor reduces risk from \(0.30\) to \(0.10\).
When Conditional Minimization Improves Risk
The comparison can be made precise for a finite action set. Let \(a_*\) be any marginally optimal constant action. At each predictor value, compare its conditional risk with the smallest available conditional risk. The gap is nonnegative; its average is exactly the risk improvement from using a conditional minimizing rule.
Proof. Since \(\mathcal A\) is finite, the conditional risks have a pointwise minimum, and the stated tie-breaking rule gives a measurable minimizer. Define \(\Delta=r(a_*,Z)-\min_{a\in\mathcal A}r(a,Z)\). By the definition of a minimum, \(\Delta\ge 0\) almost surely. Conditional minimization gives \(r(g(Z),Z)=\min_{a\in\mathcal A}r(a,Z)\) almost surely. Taking expectations and using the conditional-expectation identity,
A nonnegative random variable has strictly positive expectation exactly when it is positive with positive probability: if \(P(\Delta>0)>0\), then \(P(\Delta>1/k)>0\) for some positive integer \(k\), so \(E[\Delta]\ge k^{-1}P(\Delta>1/k)>0\). Conversely, if \(\Delta=0\) almost surely, then \(E[\Delta]=0\). This proves both the inequality and its strictness criterion. \(\square\)
The theorem does not assert that the conditional rule is better at every predictor value. It says that it is never worse when it can choose among the same actions, and that the overall improvement is strict precisely when the marginal action fails to be conditionally optimal on a set of positive probability.
Worked Example: Unequal Classification Costs
Keep the two predictor groups and conditional probabilities from the previous example, but now assign loss 2 to a false positive (action 1 when \(Y=0\)), loss 1 to a false negative (action 0 when \(Y=1\)), and loss 0 to a correct classification. The marginal probability of class 1 is still \(0.30\).
For a class-1 probability \(p\), the conditional risk of action 0 is \(p\), while the conditional risk of action 1 is \(2(1-p)\). Action 1 is preferred exactly when \(2(1-p)<p\), or \(p>2/3\).
Marginally, action 0 has risk \(0.30\), and action 1 has risk \(2(0.70)=1.40\), so action 0 is the unique marginal optimum. At \(A\), the risks are \(0.9\) for action 0 and \(2(0.1)=0.2\) for action 1. At \(B\), they are \(0.1\) for action 0 and \(2(0.9)=1.8\) for action 1. Thus the conditional rule chooses 1 at \(A\) and 0 at \(B\), with total risk \(0.25(0.2)+0.75(0.1)=0.05+0.075=0.125\).
The comparison uses costs, not just the most probable class: the threshold is \(2/3\), not \(1/2\). Even so, the marginally optimal action fails conditionally in group \(A\), and using the predictor reduces risk from \(0.30\) to \(0.125\).
Squared Loss: The Marginal Mean Versus the Conditional Mean
For a numerical outcome and squared loss \(L(a,Y)=(Y-a)^2\), the best constant action is the marginal mean, provided \(E[Y^2]<\infty\). When predictors are observed, the corresponding conditional action is the conditional mean. The following derivation shows why these are different decisions and quantifies the possible gain.
Derivation. Since \(Y\) is square-integrable, \(m\) is square-integrable. Write \(Y-g(Z)=(Y-m)+(m-g(Z))\), square, and condition on \(Z\):
The cross term is zero because \(E[Y-m\mid Z]=0\), and \(m-g(Z)\) is determined by \(Z\). Taking expectations proves the identity. Its first term does not depend on \(g\), and its second term is nonnegative and equals zero for \(g=m\); hence \(m\) minimizes risk. For the constant rule \(c=E[Y]=E[m]\), the risk difference is \(E[(m-c)^2]=\operatorname{Var}(m)\). It is strictly positive exactly when the conditional mean is not almost surely constant. \(\square\)
Worked Example: A Mixture of Two Normal Outcomes
Let \(P(Z=0)=P(Z=1)=1/2\), and suppose \(Y\mid Z=0\sim N(0,1)\) while \(Y\mid Z=1\sim N(4,1)\). Use squared loss. The conditional means are 0 and 4, and each conditional variance is 1.
The marginal mean is \(E[Y]=(1/2)(0)+(1/2)(4)=2\), so the best constant prediction is 2. Conditional on \(Z=0\), its squared-error risk is \(1+(0-2)^2=5\); conditional on \(Z=1\), it is \(1+(4-2)^2=5\). Its total risk is therefore 5.
The conditional-mean rule predicts 0 when \(Z=0\) and 4 when \(Z=1\). Its risk in either group is the conditional variance, 1, so its total risk is 1. The improvement is \(5-1=4\), which agrees with \(\operatorname{Var}(m)\): the random conditional mean \(m\) takes 0 and 4 with equal probabilities, has mean 2, and has variance \((1/2)(0-2)^2+(1/2)(4-2)^2=4\).
When the Marginal Choice Does Not Fail
Predictors do not automatically improve a decision. If a marginally optimal action is also conditionally optimal almost surely, a conditional rule cannot reduce risk strictly. In the finite-action theorem, this is exactly the case \(\Delta=0\) almost surely. Under squared loss, it occurs when the conditional mean equals the marginal mean almost surely. The predictor may still contain information about other features of the outcome; for this loss, what matters for the optimal action is the conditional mean.
This distinction matters when interpreting an analysis: a marginal decision answers what to do without predictor information, while a conditional decision answers what to do after observing it. Comparing the two is meaningful only when the timing and information available at decision time are clear.
Common Mistake
A reliable check is to ask two separate questions: what action minimizes risk when predictors are unavailable, and what action minimizes conditional risk when they are observed? The answers can coincide, but that must follow from the conditional risks rather than from the marginal optimum alone.
Check Your Understanding
Use the distinction between marginal and conditional risk to answer the following.
- In the zero-one-loss example, why is class 0 marginally optimal even though it is not conditionally optimal in group \(A\)?
- For the unequal-cost example, derive the conditional probability threshold for choosing action 1.
- State the condition under which the finite-action theorem gives a strict reduction in risk.
- Under squared loss, what is the risk difference between the best constant prediction and the conditional-mean rule?
- If the conditional mean is almost surely constant, can using it strictly improve squared-error risk over the best constant rule? Explain.