Why Conditional Quantiles Need a Careful Definition
A conditional CDF describes the distribution of one random variable after information about another has been observed. A conditional quantile answers a related question: given that information, what value marks a specified fraction of the conditional distribution? For example, a conditional median divides the conditional probability around one half.
For a continuous distribution with a strictly increasing CDF, the \(u\)-quantile can often be found by solving \(F(q)=u\). That equation is not a general definition. A discrete CDF jumps over probability levels, and a mixed distribution can have both jumps and continuous portions. The definition must work in all these cases.
When conditioning on an event of positive probability, the conditional CDF is defined by the usual conditional probability. When conditioning on a continuous random variable taking the exact value \(y\), a conditional distribution is specified through a regular conditional law. Such laws are determined only up to sets of conditioning values having probability zero. Thus, at continuous conditioning values, a statement about \(Q_X(u\mid y)\) refers to the chosen conditional-distribution version and is meaningful almost surely in \(Y\); a particular version can be specified to give a pointwise formula.
General Properties of the Definition
The generalized-inverse definition always gives a finite real number for \(0<u<1\), because a CDF tends to zero at \(-\infty\) and to one at \(+\infty\). Its central property is that the CDF at the quantile is at least \(u\), while the probability strictly below the quantile is at most \(u\).
Proof. Since \(F(x)\to 1\) as \(x\to+\infty\), the set \(A=\{x:F(x)\geq u\}\) is nonempty. Since \(F(x)\to 0\) as \(x\to-\infty\) and \(u>0\), there is a finite lower bound below which \(F(x)<u\). Thus \(q=\inf A\) is finite.
For every positive integer \(k\), the definition of the infimum allows a choice \(x_k\in A\) with \(q\leq x_k<q+1/k\). Therefore \(x_k\to q\), with \(x_k\) approaching from the right or equalling \(q\). Right-continuity of a CDF gives \(F(x_k)\to F(q)\). Because \(F(x_k)\geq u\) for every \(k\), taking the limit yields \(F(q)\geq u\).
If \(x<q\), then \(x\notin A\); otherwise \(x\) would be a member of \(A\) smaller than its infimum. Hence \(F(x)<u\) for every \(x<q\). Taking the limit as \(x\uparrow q\) gives \(F(q-)\leq u\). This proves both inequalities. \(\square\)
The inequalities allow for a jump at \(q\): the target probability \(u\) can lie anywhere between the probability strictly below \(q\) and the probability at or below \(q\). For a continuous, strictly increasing CDF, there is no jump and the quantile is the unique solution of \(F(q)=u\). Indeed, continuity and the two inequalities give \(F(q)=u\), while strict increase rules out two distinct solutions.
Worked Example: A Discrete Conditional Median
Suppose the only joint probabilities with \(Y=A\) for a discrete \(X\) and a two-valued variable \(Y\) are \(P(X=0,Y=A)=0.10\), \(P(X=1,Y=A)=0.20\), and \(P(X=2,Y=A)=0.10\). Find the conditional median and the conditional \(0.80\)-quantile of \(X\) given \(Y=A\).
First, \(P(Y=A)=0.10+0.20+0.10=0.40\). Dividing each joint probability by \(0.40\) gives $$ P(X=0\mid Y=A)=0.25,\qquad P(X=1\mid Y=A)=0.50,\qquad P(X=2\mid Y=A)=0.25. $$
The conditional CDF is zero for \(x<0\), equals \(0.25\) for \(0\leq x<1\), equals \(0.75\) for \(1\leq x<2\), and equals \(1\) for \(x\geq2\). At \(u=0.50\), the first value where the CDF is at least \(0.50\) is \(1\), so \(Q_X(0.50\mid A)=1\). At \(u=0.80\), the first such value is \(2\), so \(Q_X(0.80\mid A)=2\).
At the median, \(F_{X\mid Y}(1-\mid A)=0.25\) and \(F_{X\mid Y}(1\mid A)=0.75\). Thus \(0.25\leq0.50\leq0.75\), as the theorem requires. The CDF does not take the value \(0.50\); the quantile is still well-defined.
Calculating Quantiles from Conditional CDFs
For a continuous conditional law, first write the conditional CDF on each part of its support. Then set it equal to \(u\) and solve when the CDF is continuous and strictly increasing there. Check that the result lies in the support and that the conditional CDF at the result is \(u\).
Worked Example: A Uniform Conditional Distribution
Suppose \(Y\) is uniform on \((1,3)\), and, given \(Y=y\), \(X\) is uniform on \((0,y)\). Find the conditional \(u\)-quantile for \(0<u<1\), then calculate the conditional \(0.80\)-quantile when \(y=2.5\).
For a fixed \(y\in(1,3)\), the conditional density of \(X\) is \(1/y\) on \(0<x<y\). Integrating from zero to \(x\), and including the values outside the support, gives $$ F_{X\mid Y}(x\mid y)= \begin{cases} 0, & x\leq 0,\\ x/y, & 0<x<y,\\ 1, & x\geq y. \end{cases} $$
For \(0<u<1\), the solution of \(x/y=u\) is \(x=uy\), which lies strictly between \(0\) and \(y\). Therefore \(Q_X(u\mid y)=uy\). At \(y=2.5\) and \(u=0.80\), this gives \(Q_X(0.80\mid 2.5)=0.80(2.5)=2.0\). Substitution checks the result: \(F_{X\mid Y}(2.0\mid2.5)=2.0/2.5=0.80\).
For a mixed conditional law, a quantile may fall at an atom or in a continuous part. The generalized-inverse definition handles both cases without changing conventions.
Worked Example: A Conditional Law with an Atom
For a fixed conditioning value \(y\), suppose \(X\) has conditional probability \(0.40\) at zero and, with probability \(0.60\), has an exponential distribution with rate \(2\) on the positive half-line. Find the conditional \(0.30\)-quantile and conditional median.
For \(x<0\), the CDF is zero. For \(x\geq0\), the atom and the positive continuous component contribute $$ F_{X\mid Y}(x\mid y)=0.40+0.60(1-e^{-2x}). $$
At zero, the CDF jumps from zero to \(0.40\). Since \(0.30\leq0.40\), the first point where the CDF is at least \(0.30\) is zero: \(Q_X(0.30\mid y)=0\).
For the median, \(0.50\) exceeds the jump size \(0.40\), so solve in the continuous part: $$ 0.40+0.60(1-e^{-2x})=0.50. $$ Subtracting \(0.40\) gives \(0.60(1-e^{-2x})=0.10\). Dividing by \(0.60\) gives \(1-e^{-2x}=1/6\), so \(e^{-2x}=5/6\). Taking logarithms yields \(x=\tfrac12\log(6/5)\), approximately \(0.0912\). This is positive, as required for the continuous part, and substitution gives CDF value \(0.50\). Thus \(Q_X(0.50\mid y)=\tfrac12\log(6/5)\).
Conditional Medians and a Common Mistake
The conditional median under the lower-quantile convention is \(Q_X(0.50\mid y)\). The theorem implies that at this value \(q\), the conditional probability strictly below \(q\) is at most one half, and the conditional probability at or below \(q\) is at least one half. Equivalently, each of the events \(X\leq q\) and \(X\geq q\) has conditional probability at least one half. There may be more than one value satisfying these median inequalities; the lower-quantile convention selects a particular one.
- Mistake: requiring \(F_{X\mid Y}(q\mid y)=u\). This can fail for a discrete law because a CDF can jump from below \(u\) to above it. The correction is to use the smallest \(q\) with \(F_{X\mid Y}(q\mid y)\geq u\), and check the two inequalities involving \(F(q-)\) and \(F(q)\).
- Mistake: using a pointwise conditional formula without specifying its status. If \(Y\) is continuous, conditioning on \(Y=y\) is described through a conditional-distribution version, and that version is fixed only up to a set of \(Y\)-values with probability zero. State the conditional law being used and interpret its conclusions almost surely unless a version is specified pointwise.
Check Your Understanding
Use the lower generalized-inverse convention in each question.
- A conditional CDF is \(0.20\) for \(0\leq x<1\), \(0.65\) for \(1\leq x<3\), and \(1\) for \(x\geq3\), with CDF zero for \(x<0\). Find its \(0.50\)- and \(0.80\)-quantiles.
- For a conditional uniform law on \((0,y)\), with \(y>0\), derive the conditional \(u\)-quantile and identify the conditional median.
- Why can a discrete conditional CDF have no value \(x\) for which \(F_{X\mid Y}(x\mid y)=u\), even though its \(u\)-quantile exists?
- If \(q=Q_X(0.25\mid y)\), state the inequalities involving \(F_{X\mid Y}(q-\mid y)\) and \(F_{X\mid Y}(q\mid y)\).
- Why should a formula for a conditional quantile given a continuous \(Y=y\) be understood relative to a specified conditional-distribution version?