Why Crossing Matters
A conditional quantile curve describes an ordered part of an outcome distribution at each covariate value. If \(\tau_1<\tau_2\), the conditional \(\tau_1\)-quantile cannot exceed the conditional \(\tau_2\)-quantile at the same covariates. Yet separately estimated quantile regression curves can violate this ordering. Such quantile crossing is not just a visual inconvenience: it makes the fitted curves incompatible with a single conditional distribution.
Crossing can arise because each quantile is estimated separately, with its own sampling variation and fitted coefficient vector. It can also reflect a restrictive model form: separate linear approximations may fit different parts of a conditional distribution but fail to preserve their order throughout the covariate range. The diagnostic question is therefore not simply whether two curves cross somewhere on a plot. It is whether, and where, the estimated quantiles violate the required ordering over the covariate domain relevant to the analysis.
For linear quantile regression, the estimated curve at level \(\tau\) is commonly written \(\widehat Q(\tau\mid x)=x'\widehat\beta_\tau\), where \(x\) is the chosen regressor vector, including an intercept if the model has one. This is a model for a conditional quantile, not a claim that changes in \(x\) cause changes in the outcome. The basic crossing condition for two fitted levels is immediate:
The left-hand condition specifies the required order of the quantile levels; the right-hand condition says the estimated lower quantile is numerically above the estimated higher quantile at that covariate value. Equality is not crossing, though it can indicate that fitted curves touch.
Diagnosing Crossing Over a Covariate Domain
A useful diagnosis starts by naming the range of covariates where the fitted model will be interpreted or used. Checking only the sample mean of a regressor can miss violations elsewhere; checking far outside the observed support can instead emphasize extrapolations with little empirical basis. For each ordered pair of fitted quantile levels, calculate the difference \(D(x)=\widehat Q(\tau_2\mid x)-\widehat Q(\tau_1\mid x)\). A negative value is a crossing, zero is a touch, and a positive value is correctly ordered.
In practice, evaluate these differences over a grid of covariate values covering the target domain, or over a suitable grid of design points when there are several regressors. Report more than a yes-or-no flag when possible: the region with negative differences, the most negative difference, and the proportion of grid points with a violation help describe the severity and location of crossing. Grid summaries are diagnostics, not universal guarantees. A fine grid can reveal problems between observed covariate values, but it does not prove that a nonlinear fitted curve is ordered at every point between grid values.
Worked Example: Locating a Crossing Threshold
Suppose two separately fitted conditional quantiles for an outcome measured in thousands of dollars are \(\widehat Q(0.25\mid x)=5+2x\) and \(\widehat Q(0.75\mid x)=9+x\), where \(x\) is years of experience and the analysis domain is \(0\leq x\leq 6\). Find where their ordering fails.
The fitted difference, higher quantile minus lower quantile, is \[ D(x)=(9+x)-(5+2x)=4-x. \] Thus \(D(x)<0\) when \(x>4\), equals zero at \(x=4\), and is positive when \(x<4\). For instance, at \(x=3\), the fitted values are \(11\) and \(12\) thousand dollars, respectively, so they are ordered. At \(x=5\), they are \(15\) and \(14\) thousand dollars, so the estimated 25th percentile is one thousand dollars above the estimated 75th percentile. Crossing occurs on \(4<x\leq6\) in the stated domain.
Because the difference is affine in this one-dimensional model, the algebra identifies the threshold exactly; a grid is not needed to find it. In a model with several covariates, the crossing region is defined by the set of covariate vectors for which the corresponding difference is negative.
For a linear model with a single regressor, the difference between two fitted quantiles is also linear, so solving for its zero can locate a crossing boundary directly. For multiple regressors, a grid or domain-specific optimization can map the region. If the covariate domain is a compact polytope and the difference is affine, checking its values at the domain's vertices is sufficient to verify its sign throughout that polytope: every point in the polytope is a convex combination of vertices, and an affine function at that point is the same combination of its vertex values. That shortcut does not apply to general nonlinear differences.
Worked Example: Summarizing a Grid Diagnosis
Suppose the same two fitted curves are evaluated at experience values \(x=0,2,4,5,6\). Use \(D(x)=\widehat Q(0.75\mid x)-\widehat Q(0.25\mid x)=4-x\).
The differences, in thousands of dollars, are \(4,2,0,-1,-2\), respectively. There are two strictly negative differences among the five grid points, so 2/5, or 40%, of these points show crossing. The largest violation on this grid is two thousand dollars at \(x=6\). At \(x=4\), the curves touch but are not out of order.
This 40% is a share of the selected grid points, not a share of people, nor a probability that the model is wrong. Its value depends on how the grid was chosen. A densely spaced grid over the target range could describe the location more finely, while the algebraic threshold \(x>4\) gives the exact region for these linear curves.
Repair 1: Monotone Rearrangement
Monotone rearrangement repairs a set of fitted values by sorting them in increasing order across quantile levels at each fixed covariate value. For a discrete ordered grid of levels \(\tau_1<\cdots<\tau_J\), calculate \(\widehat Q(\tau_j\mid x)\) for all \(j\), sort those \(J\) values, and assign the smallest to \(\tau_1\), the next-smallest to \(\tau_2\), and so on. The result is nondecreasing on the grid at that \(x\). Repeat separately at each covariate value where predictions are needed.
For a continuous range of quantile levels, the increasing rearrangement is the nondecreasing function obtained by sorting the values of the original curve over that range, with respect to a specified weighting over quantile levels. It is not generally the same as replacing each crossed pair by its average. Rearrangement changes the assignment of predicted values to quantile levels, while preserving the distribution of those values across the rearranged range. Its pointwise implementation does not generally correspond to one common vector of linear regression coefficients across all covariate values.
Worked Example: Rearranging Three Fitted Quantiles
At a particular covariate value, suppose the raw fitted values for \(\tau=0.25,0.50,0.75\) are \(12,11,15\), respectively, in thousands of dollars. The first two values are out of order.
Sort the values: \(11\leq12\leq15\). Assign them in that order to the ordered quantile levels. The rearranged fitted values are therefore \(11,12,15\) thousand dollars at \(\tau=0.25,0.50,0.75\). The repaired grid is nondecreasing, and it contains the same three predicted numbers as before; the value-to-level assignments have changed.
This example also shows why rearrangement is a repair of predictions, not a refit of the original quantile regression objective. It does not, by itself, establish that the rearranged values minimize the sum of check losses or retain the original linear coefficient interpretation.
Repair 2: Constrained Quantile Estimation
Constrained estimation addresses ordering during estimation rather than sorting predictions afterward. For levels \(\tau_1<\cdots<\tau_J\), one standard approach jointly estimates coefficient vectors by minimizing the sum of the quantile check losses, subject to noncrossing inequalities. The check loss is \(\rho_\tau(u)=u\{\tau-\mathbf{1}(u<0)\}\), where \(u\) is a residual. With observed outcomes \(Y_i\) and regressors \(x_i\), a sample-design constraint is \(x_i'\beta_{\tau_j}\leq x_i'\beta_{\tau_{j+1}}\) for each observation \(i\) and each adjacent pair of levels.
The constraints here guarantee ordering at the observed design points. They do not necessarily guarantee ordering at every point in a broader prediction domain. To guarantee ordering over a specified domain, impose the inequalities there, using a finite set of constraints when appropriate. For linear fitted quantiles on a compact polytope, it is enough to impose each adjacent-level inequality at every vertex of the polytope. The inequalities are linear in the coefficients, and the check-loss objective is convex and piecewise linear, so this formulation can be represented as a constrained optimization problem.
Worked Example: Making the Constraint Explicit
Return to the fitted curves \(\widehat Q(0.25\mid x)=5+2x\) and \(\widehat Q(0.75\mid x)=9+x\) on \(0\leq x\leq6\). Write them as \(a_{25}+b_{25}x\) and \(a_{75}+b_{75}x\). To constrain the pair over this interval, require \(a_{25}+b_{25}x\leq a_{75}+b_{75}x\) throughout the domain.
For these linear curves, it is sufficient to impose the inequality at \(x=0\) and \(x=6\). The raw fitted coefficients give \(5\leq9\) at zero, so the constraint holds there. At six, they give \(5+2(6)=17\) and \(9+6=15\), so \(17\leq15\) fails. A constraint imposed only at \(x=0\) would therefore miss the crossing.
For illustration, consider the prediction-level projection that minimizes the sum of squared changes to the two raw predictions at each of the two endpoints, subject to their being ordered there. At \(x=6\), the raw pair is \((17,15)\). The closest ordered pair under equal squared-error weights is \((16,16)\): its changes are \((-1,+1)\), and any ordered pair must close the two-unit gap, which is achieved with the smallest sum of squared changes by splitting the adjustment equally. At \(x=0\), the pair \((5,9)\) is already ordered and remains unchanged. The straight lines through the adjusted endpoints are \(5+(11/6)x\) and \(9+(7/6)x\). Their difference, higher minus lower, is \(4-(2/3)x\), which is nonnegative on \(0\leq x\leq6\).
This calculation illustrates the geometry of ordering constraints; it is a squared-distance projection of predictions, not the constrained check-loss estimator. Constrained quantile estimation instead minimizes the stated sum of check losses under the inequalities. Its coefficients need not equal the projection values in this illustration.
Choosing and Interpreting a Repair
The two approaches answer related but distinct questions. Rearrangement is a direct way to obtain ordered predictions from fitted curves already in hand. It is convenient when prediction at many covariate values is the main goal, but it may not preserve the original regression form or the original sample fitting criterion. Constrained estimation builds the ordering requirement into a joint fit and can retain a specified parametric form, but it changes the optimization problem and may move several fitted curves to satisfy the restrictions.
| Feature | Monotone rearrangement | Constrained estimation |
|---|---|---|
| When ordering is imposed | After fitting, on predicted values | During estimation, through explicit inequalities |
| What is guaranteed | Order on the rearranged quantile grid at each evaluated covariate value | Order at the locations where constraints are imposed |
| Regression coefficients | May not correspond to one common coefficient vector across levels | Estimates coefficient vectors under the chosen model and constraints |
| Main consideration | Simple prediction repair; the fitted objective is not re-optimized | Joint optimization; results depend on the constraint domain |
Whichever method is used, state the domain where ordering is intended, which quantile levels are included, and where the guarantee applies. Inference should also reflect the estimator actually used: uncertainty calculations for separately fitted curves do not automatically describe the sampling behavior of rearranged or constrained estimates. The aim is not to conceal a misspecified model, but to produce coherent quantile predictions and make the repair transparent.
Common Mistakes
- Checking only at the average covariate value. Correct ordering at one point does not imply ordering across the analysis domain. Evaluate the full relevant range or use a valid domain-wide argument.
- Treating touching curves as crossing. Equality satisfies the nondecreasing requirement. A strict reversal, not a tie, is a crossing.
- Assuming a grid proves global order. A grid diagnoses the points it contains. For a general nonlinear difference, it cannot rule out a violation between grid values.
- Calling rearrangement a constrained quantile regression refit. Sorting predictions does not minimize the original check-loss objective under constraints. State clearly which repair produced the reported estimates.
- Assuming sample-point constraints guarantee order everywhere. They guarantee order only where imposed, unless additional structure justifies a broader conclusion.
Check Your Understanding
Try these questions without looking back.
- For two ordered quantile levels, what sign of the higher-minus-lower fitted difference indicates crossing?
- For the fitted curves \(3+x\) and \(7+0.5x\), find the covariate values at which the lower fitted quantile exceeds the higher one.
- At one covariate value, raw fitted values at three increasing quantile levels are \(8,6,10\). What values does discrete monotone rearrangement assign to those levels?
- Why can constraints imposed only at observed covariate values fail to guarantee ordering over a larger prediction domain?
- In one sentence, distinguish rearrangement from constrained quantile estimation in terms of when ordering is imposed.