From a Conditional Distribution to a Target
A conditional response distribution describes the possible values of \(Y\) at a given feature value \(x\). Often, however, a prediction or scientific summary is a single number rather than a whole distribution. The choice of number matters: a conditional mean describes the center under squared-error loss, while a conditional median describes a center under absolute-error loss. A conditional quantile describes a specified point in the distribution, such as its 90th percentile.
Write \(F_x(y)=P(Y\leq y\mid X=x)\) for the conditional distribution function of the response. When a conditional density or mass function exists, write it as \(f(y\mid x)\). The targets below are calculated from this conditional law, not from the marginal distribution of \(Y\). For feature values \(x\) at which a conditional law is specified, each target is a functional of that law.
The generalized-inverse convention is important when the conditional law has point masses. A quantile need not be a value where the distribution function equals \(\tau\): it is the first response value at which the distribution function reaches or exceeds \(\tau\). The defining inequalities are \(F_x(q_\tau(x)-)\leq\tau\leq F_x(q_\tau(x))\).
Other Conditional Functionals
The conditional mean and variance summarize location and spread, respectively. When the relevant moments exist, define
The mean requires a finite first absolute moment, \(E[|Y|\mid X=x]<\infty\); the variance requires a finite second moment. A conditional median and quantile require no moments. This distinction matters for heavy-tailed laws, where a median may be well-defined even if a mean is not.
A mode is another possible summary: for a discrete law, it is a response value with greatest conditional probability; for a density, it is a point where the density attains its maximum. Unlike quantiles, a density mode can depend on the chosen density representation and need not be unique. It is not generally a measure of central location. In practice, the appropriate functional is determined by the question and the consequences of prediction errors.
Worked Example: Functionals of a Discrete Conditional Law
At a feature value \(x\), suppose the conditional response takes values \(-1\), \(2\), and \(5\), with probabilities \(0.2\), \(0.5\), and \(0.3\), respectively. Calculate its mean, variance, median, and selected quantiles.
The conditional distribution function is \(0\) below \(-1\), \(0.2\) from \(-1\) up to \(2\), \(0.7\) from \(2\) up to \(5\), and \(1\) from \(5\) onward. The mean is
The second moment is \(E[Y^2\mid X=x]=1(0.2)+4(0.5)+25(0.3)=0.2+2+7.5=9.7\). Therefore,
For the median, the distribution function first reaches \(0.5\) at \(2\): \(F_x(2-)=0.2\) and \(F_x(2)=0.7\). Thus \(q_{0.5}(x)=2\), which is also the unique median. Since \(F_x(-1)=0.2\) and \(F_x(2)=0.7\), \(q_{0.25}(x)=2\) and \(q_{0.5}(x)=2\). Since the distribution function does not reach \(0.8\) until \(5\), \(q_{0.8}(x)=5\).
Quantiles and Their Loss Function
Quantiles are not just descriptive cutoffs. They are optimal predictions for an asymmetric absolute-error criterion. Define the pinball loss at level \(\tau\) by \(\rho_\tau(u)=u(\tau-\mathbf{1}\{u<0\})\), where \(\mathbf{1}\{\cdot\}\) is one when its condition holds and zero otherwise. For an overprediction \(a-Y<0\), this loss charges at rate \(1-\tau\); for an underprediction \(a-Y>0\), it charges at rate \(\tau\).
Proof. For fixed \(y\), as a function of \(a\), \(\rho_\tau(y-a)\) is continuous and piecewise linear. Its slope, except at \(a=y\), is \(\mathbf{1}\{y<a\}-\tau\). Consequently, for \(a>b\),
The integrand is bounded, so expectation and integration can be interchanged on the finite interval \([b,a]\). Taking expectations gives
The quantile inequalities are \(F(q_\tau-)\leq\tau\leq F(q_\tau)\). If \(t>q_\tau\), monotonicity gives \(F(t-)\geq F(q_\tau)\geq\tau\). Therefore, for \(a>q_\tau\), the integral formula yields \(R(a)-R(q_\tau)\geq0\). If \(t<q_\tau\), then \(F(t)\leq F(q_\tau-)\leq\tau\), so \(F(t-)\leq\tau\). Applying the formula with \(b=a\) and upper endpoint \(q_\tau\) shows \(R(q_\tau)-R(a)\leq0\) whenever \(a<q_\tau\). Thus \(R(q_\tau)\leq R(a)\) for every \(a\), proving the result. \(\square\)
At \(\tau=1/2\), pinball loss is one-half of absolute-error loss: \(\rho_{1/2}(u)=|u|/2\). Hence the median minimizes expected absolute error. In contrast, the mean minimizes expected squared error.
Derivation. Let \(\mu=E[Y]\). Expanding \(Y-a=(Y-\mu)+(\mu-a)\), then using \(E[Y-\mu]=0\), gives
The final term is nonnegative and equals zero precisely when \(a=\mu\), so the mean minimizes squared-error risk. Applying these results to the conditional distribution at \(x\) gives the corresponding conditional targets: the conditional mean minimizes conditional squared-error risk, and a conditional median minimizes conditional absolute-error risk, when the required moments exist. \(\square\)
Continuous Conditional Laws
For a continuous conditional law with strictly increasing distribution function, \(q_\tau(x)\) is the unique solution to \(F_x(q_\tau(x))=\tau\). If a conditional density is available, the distribution function is obtained by integrating that density. In familiar parametric families, quantiles can often be expressed using a standard quantile function.
Worked Example: Normal Conditional Response
Suppose \(Y\mid X=x\sim N(10,4)\), so the conditional mean is \(10\) and the conditional standard deviation is \(\sqrt{4}=2\). For a normal distribution, \(q_\tau(x)=\mu+\sigma\Phi^{-1}(\tau)\), where \(\Phi\) is the standard normal distribution function.
The conditional median is \(10+2\Phi^{-1}(0.5)=10\), and the conditional variance is \(4\). For the 90th percentile, use the unrounded standard normal quantile \(\Phi^{-1}(0.9)\approx1.2815516\):
Using the rounded value \(1.2816\) before multiplying would give a slightly different final digit. Keeping sufficient precision through the calculation gives \(12.5631\) to four decimal places.
Worked Example: Exponential Conditional Response
Suppose the conditional response has an exponential distribution with rate \(2\), so its density is \(f(y\mid x)=2e^{-2y}\) for \(y\geq0\), and zero otherwise. Integrating the density gives \(F_x(y)=1-e^{-2y}\) for \(y\geq0\). To find the \(\tau\)-quantile, solve \(1-e^{-2y}=\tau\):
At \(\tau=0.5\), \(q_{0.5}(x)=-(1/2)\log(0.5)=\log(2)/2\approx0.3466\). At \(\tau=0.8\), \(q_{0.8}(x)=-(1/2)\log(0.2)\approx0.8047\). The mean is \(1/2\), and the variance is \(1/4\). The median is below the mean, reflecting the distribution's right skew.
Interpreting the Target Carefully
A response distribution can support several legitimate targets, and they answer different questions. The mean is sensitive to the magnitude of extreme values; the median is more resistant. A high quantile can describe an upper-tail outcome without claiming that the response is usually near that value. Neither the mean nor a quantile recovers an unobserved “true” response for an individual: each summarizes the conditional law.
For discrete or mixed laws, do not assume that a quantile solves \(F_x(y)=\tau\). The correct condition allows a jump across \(\tau\). Also, do not assume the median is always a unique point. For example, if a conditional response equals \(-2\) or \(4\), each with probability \(1/2\), then every \(m\in[-2,4]\) is a median: for such \(m\), both \(P(Y\leq m\mid X=x)\) and \(P(Y\geq m\mid X=x)\) are at least \(1/2\). Under the lower generalized-inverse convention, the median quantile is \(-2\).
Finally, a conditional distribution is generally specified only up to changes on feature values that occur with probability zero. Its functionals inherit that qualification: targets are determined for feature values where the conditional law is specified, and versions that agree almost surely give the same targets almost surely. This is why a conditional target should be understood as a feature-dependent summary of a conditional response law, rather than an automatically unique value at every conceivable \(x\).
Check Your Understanding
Answer each question using the definitions and calculations above.
- A conditional response takes values \(0\) and \(3\) with probabilities \(0.4\) and \(0.6\). What are its lower median and its 0.25 quantile?
- Why can the equation \(F_x(q_\tau(x))=\tau\) fail for a discrete conditional response?
- What loss function is minimized by a conditional mean, and what moment condition supports the result?
- For the exponential law with rate \(2\), derive the 0.9 quantile from its conditional distribution function.
- Give a conditional response law for which the median is not unique, and identify its lower median.