Why Asymmetric Loss Targets a Quantile
A conditional mean is naturally associated with squared-error loss: large positive and negative residuals are penalized symmetrically, and the expected loss is minimized at the mean. To target another feature of a conditional outcome distribution, the loss must change. Check loss does this by assigning different costs to overprediction and underprediction. Its asymmetry is controlled by a chosen quantile level \(\tau\), where \(0<\tau<1\).
Let \(Y\) be an outcome and let \(q\) be a proposed threshold. A positive residual \(Y-q\) means that \(q\) underpredicts the outcome; a negative residual means that \(q\) overpredicts it. At a high quantile level, underprediction is penalized more heavily, so minimizing expected loss tends to move the threshold upward. This intuition can be made exact using the generalized-inverse definition of a quantile and the subgradient of the loss.
Thus, for the residual \(u=Y-q\), a positive residual incurs loss \(\tau u\), while a negative residual incurs loss \((1-\tau)|u|\). When \(\tau=0.5\), the loss is half the absolute error and treats deviations on the two sides equally. When \(\tau=0.8\), underprediction costs four times as much per unit as overprediction: the respective weights are \(0.8\) and \(0.2\).
The Population Quantile Condition
Consider the expected check loss \(L(q)=E[\rho_\tau(Y-q)]\), assuming \(E[|Y|]\) is finite so this expectation is well-defined and finite for finite \(q\). The function is convex in \(q\), since check loss is convex in its residual and the residual is affine in \(q\). Convexity means a zero subgradient characterizes a global minimum.
Away from a point where \(Y=q\), the derivative of the individual loss with respect to \(q\) is \(1(Y<q)-\tau\). At \(Y=q\), the loss has a corner: its subgradient with respect to \(q\) is the interval \([-\tau,1-\tau]\). Taking expectations gives the population subgradient interval \([F(q-)-\tau,F(q)-\tau]\), where \(F(q-)=P(Y<q)\). A minimum occurs exactly when this interval contains zero.
This is the quantile condition, including when the distribution has a jump. In a continuous distribution at the quantile, \(F(q-)=F(q)\), so the condition reduces to \(F(q)=\tau\). For a general distribution, it is not correct to require that exactly a fraction \(\tau\) of the outcomes be at or below the quantile. The generalized-inverse definition and the inequality above cover atoms as well as continuous distributions.
Worked Example: A Quantile With an Atom
Suppose \(Y\) equals 0 with probability 0.5 and 1 with probability 0.5. Find the 0.75-quantile and verify how check loss selects it.
The CDF is 0 for \(q<0\), 0.5 for \(0\leq q<1\), and 1 for \(q\geq1\). Therefore \(q_{0.75}=\inf\{q:F(q)\geq0.75\}=1\). At this threshold, \(F(1-)=0.5\leq0.75\leq1=F(1)\). Notice that \(P(Y\leq1)=1\), not 0.75; the quantile condition does not require equality when there is an atom.
For a direct loss calculation, \(L(q)=0.5\rho_{0.75}(-q)+0.5\rho_{0.75}(1-q)\). At \(q=0\), this is \(0.5(0)+0.5(0.75)=0.375\). At \(q=1\), it is \(0.5(0.25)+0.5(0)=0.125\). For \(0\leq q\leq1\), the loss is \(0.5(0.25q)+0.5(0.75(1-q))=0.375-0.25q\), which decreases to its minimum at 1. The high cost of underprediction favors the higher threshold.
The same argument applies conditionally. Given covariates \(X=x\), minimize \(E[\rho_\tau(Y-q)\mid X=x]\). A minimizing threshold satisfies \(F(q-\mid x)\leq\tau\leq F(q\mid x)\), where \(F(\cdot\mid x)\) is the conditional CDF. Under continuity at the conditional quantile, this becomes \(P(Y\leq q\mid X=x)=\tau\). With atoms, the inequality is the appropriate statement.
From Conditional Quantiles to a Regression Objective
In linear quantile regression, the proposed conditional quantile at covariate vector \(x\) is \(x'\beta_\tau\). The vector \(x\) may include an intercept, and \(\beta_\tau\) is allowed to depend on the chosen level \(\tau\). The model’s substantive restriction is that the conditional quantile of interest is represented by this linear index. Minimizing the sample loss defines an estimator even if the restriction is only an approximation; interpreting the fitted index as the conditional quantile requires the specification to be appropriate.
For a nonzero residual \(u_i=Y_i-X_i'\beta\), the subgradient of \(\rho_\tau(u_i)\) with respect to \(u_i\) is \(\tau-1(u_i<0)\). At a zero residual it can be any number in \([\tau-1,\tau]\). Applying the chain rule to \(u_i=Y_i-X_i'\beta\) changes the sign and multiplies by \(X_i\). Since the objective is convex, a coefficient vector minimizes it if and only if its vector subgradient can include zero.
This is the quantile score condition. Observations below the fitted threshold contribute \(\tau-1\), observations above it contribute \(\tau\), and observations exactly on it contribute an intermediate value allowed by the subgradient. The interval at zero matters: replacing it with an arbitrary strict indicator can incorrectly rule out a minimizer. The condition is a convex optimality condition for the sample objective; by itself, it does not establish that every conditional quantile is linear in \(X\).
Worked Example: Checking a Sample Median by Subgradients
Take five hypothetical outcomes \(1,3,4,6,10\), with an intercept-only model and \(\tau=0.5\). The proposed fitted value is \(q=4\). The residuals \(Y_i-q\) are \(-3,-1,0,2,6\).
At \(\tau=0.5\), check loss is half the absolute residual. The objective at \(q=4\) is \(0.5(3+1+0+2+6)=6\). At \(q=3\), it is \(0.5(2+0+1+3+7)=6.5\); at \(q=5\), it is \(0.5(4+2+1+1+5)=6.5\).
For the intercept-only score, the two observations below 4 contribute \(-0.5\) each, and the two above 4 contribute \(0.5\) each. Their contributions sum to zero; the observation tied at 4 can contribute any value from \(-0.5\) to \(0.5\), including zero. Thus zero belongs to the total subgradient, confirming that 4 minimizes the convex objective. The calculation is consistent with the empirical median.
Reading the Score in a Covariate Model
With covariates, the score condition is weighted by each observation’s vector \(X_i\). It requires the weighted subgradient contributions to balance in every coefficient direction. If \(X_i\) includes an intercept, the intercept component balances the contributions overall; other components impose corresponding balances across covariate patterns. This explains how the fitted conditional threshold responds to the predictors.
A population analogue, when differentiation and expectation are justified, is a zero expected subgradient \(E[Xs]=0\), with \(s=\tau-1(Y-X'\beta_\tau<0)\) away from zero residuals and an allowed value in \([\tau-1,\tau]\) at zero. When the conditional distribution has no mass at the fitted threshold, this reduces to \(E[X\{\tau-1(Y<X'\beta_\tau)\}]=0\). Such a moment condition is useful for understanding the fit, but it is generally weaker than the full conditional statement \(F(X'\beta_\tau\mid X)\) meeting the quantile condition at each covariate value.
Worked Example: Two Conditional Median Fits
Suppose a hypothetical sample has a binary covariate \(D\), and the outcomes are \(2,4,8\) when \(D=0\), and \(3,7,9\) when \(D=1\). Fit an intercept and a group indicator at \(\tau=0.5\), so the proposed quantile is \(\beta_0+\beta_1D\).
The middle outcome in group \(D=0\) is 4, and the middle outcome in group \(D=1\) is 7. Thus \(\beta_0=4\) and \(\beta_1=7-4=3\), giving fitted thresholds 4 and 7. The total check loss in group 0 is \(0.5(|2-4|+|4-4|+|8-4|)=3\). In group 1 it is \(0.5(|3-7|+|7-7|+|9-7|)=3\), for a total objective of 6.
For each group, one observation is below its fitted threshold, one is tied, and one is above. The below and above contributions to the intercept score cancel: \(-0.5+0.5=0\). For the slope component, only the \(D=1\) observations contribute, and those contributions also cancel. Assigning zero to each tied observation is allowed by the subgradient intervals, so both components of the score can be zero. Because the objective separates into the two groups for this binary design, the group medians minimize their respective losses.
Why the Subgradient Form Matters
Check loss has a corner at zero rather than a single derivative. A conventional smooth first-order equation is therefore not enough to characterize all minimizers. The subgradient condition handles observations exactly on the fitted threshold and supplies a correct global optimality criterion because the objective is convex. Computational methods use this convex structure, but the score condition itself is the key mathematical statement.
The quantile level also changes the fitted target, not merely the reported scale of the loss. A coefficient at \(\tau=0.9\) describes the specified upper conditional quantile under the linear specification; it need not equal the coefficient at \(\tau=0.5\), and it is not a mean effect. Nor does minimizing asymmetric loss imply a causal interpretation. The interpretation depends on the model, covariates, and research design.
- Pitfall: treating a quantile as an exact probability statement despite an atom. The claim that a 0.75-quantile must have exactly 75% of outcomes at or below it fails for discrete outcomes. Use \(F(q-)\leq\tau\leq F(q)\); equality \(F(q)=\tau\) follows under suitable continuity at the quantile.
- Pitfall: differentiating through a zero residual as if the loss were smooth. At zero, use the full subgradient interval. An allowed value from that interval may be necessary for the score to equal zero.
- Pitfall: interpreting the sample score as proof of a correct conditional model. It characterizes a minimizer of the chosen sample objective. It does not, on its own, show that a linear index equals the conditional quantile for every \(X\).
Check Your Understanding
Use the definitions and score conditions to answer the following.
- For \(\tau=0.8\), what are the per-unit check-loss weights for an underprediction and an overprediction?
- A distribution has \(F(q-)=0.4\) and \(F(q)=0.9\). For which values of \(\tau\) does \(q\) satisfy the quantile condition?
- Why can an observation with zero residual not be assigned only the derivative from one side when checking the score condition?
- In a linear quantile-regression objective, what does the intercept component of the subgradient condition balance?
- Why does a zero sample score not by itself prove that the fitted index is the true conditional quantile at every covariate value?