Tutorials › Statistical Theory I - Probability and Distribution Theory › Conditioning on Intervals and Threshold Events

Conditional Distribution Theory · Tutorial 255 of 994

Conditioning on Intervals and Threshold Events

Derive conditional laws given interval and threshold events, including their densities, probabilities, and expectations.

Intermediate 10 min read

What You'll Learn

  • Derive the density of \(X\) conditional on an event \(a<Y<b\)
  • Adapt the calculation to upper- and lower-threshold events
  • Find conditional probabilities by integrating the conditional density
  • Relate interval conditioning to a weighted average of pointwise conditional densities
  • Identify when conditioning on an interval is not defined by the density formula

From a Joint Law to an Interval-Conditioned Law

Conditioning on a continuous value and conditioning on an interval answer different questions. The event \(Y=y\) has probability zero when \(Y\) has a density, so conditioning on that exact value uses a conditional density defined through a limiting or regular conditional distribution. By contrast, an interval such as \(a<Y<b\) can have positive probability. Its conditional law is obtained directly from the joint law: retain the part of the joint density over that interval, integrate out \(Y\), and divide by the probability of the interval.

This gives a practical method for questions about \(X\) among cases whose \(Y\)-values fall in a specified range. The range may be bounded, such as \(a<Y<b\), or a threshold, such as \(Y>c\). In either case, the denominator is essential: it makes the resulting conditional density integrate to one.

Definition: Suppose \((X,Y)\) has joint density \(f_{X,Y}(x,y)\), and let \(A=\{a<Y<b\}\), where \(-\infty\leq a<b\leq\infty\). If \(P(A)>0\), the density of \(X\) conditional on \(A\) is $$ f_{X\mid A}(x)=\frac{\displaystyle\int_a^b f_{X,Y}(x,y)\,dy}{P(A)} $$ for almost every \(x\), where $$ P(A)=\int_a^b f_Y(y)\,dy =\int_a^b\int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dx\,dy. $$ Here \(f_Y\) is the marginal density of \(Y\).

The integral in the numerator automatically respects the joint support: wherever \((x,y)\) is outside that support, the joint density is zero. Thus the range of \(y\) that contributes may depend on \(x\). One must integrate over the part of the support satisfying the event, not over a rectangle that includes points with zero density.

Why the Formula Is a Conditional Density

The formula follows from the definition of conditioning on a positive-probability event. It also verifies that the resulting function is normalized. The proof uses the fact that a density is nonnegative, so changing the order of integration is justified by Tonelli’s theorem.

Theorem: Let \((X,Y)\) have a joint density, and let \(A=\{a<Y<b\}\) satisfy \(P(A)>0\). Then the formula in the definition is a density for the conditional distribution of \(X\) given \(A\).

Proof. For any Borel set \(B\subseteq\mathbb{R}\), the definition of conditional probability and integration of the joint density give

$$ P(X\in B\mid A) =\frac{P(X\in B,\ A)}{P(A)} =\frac{\displaystyle\int_B\int_a^b f_{X,Y}(x,y)\,dy\,dx}{P(A)}. $$

By Tonelli’s theorem, the order of integration is valid because the integrand is nonnegative. Therefore

$$ P(X\in B\mid A)=\int_B \frac{\displaystyle\int_a^b f_{X,Y}(x,y)\,dy}{P(A)}\,dx. $$

The integrand is nonnegative. Taking \(B=\mathbb{R}\) shows that its integral is \(P(A)/P(A)=1\), so it is a normalized density of \(X\) conditional on \(A\). \(\square\)

The same argument gives a useful formula for conditional expectations. If \(g\) is measurable and \(E[|g(X)|\mid A]<\infty\), then

$$ E[g(X)\mid A] =\frac{\displaystyle\int_{-\infty}^{\infty}\int_a^b g(x)f_{X,Y}(x,y)\,dy\,dx}{P(A)} =\int_{-\infty}^{\infty} g(x)f_{X\mid A}(x)\,dx. $$

To justify the order of integration when \(g\) can have either sign, apply Tonelli’s theorem to \(|g(x)|f_{X,Y}(x,y)\). The stated integrability condition makes the resulting absolute integral finite; Fubini’s theorem then permits the rearrangement for \(g\).

Worked Examples

Worked Example: A Triangular Support and a Bounded Interval

Suppose the joint density is \(f_{X,Y}(x,y)=2\) for \(0<x<y<1\), and zero elsewhere. Find the density of \(X\) given \(1/2<Y<1\), and calculate \(P(X<1/4\mid 1/2<Y<1)\).

Check the joint density. Its integral over the triangular support is \(2\) times the triangle’s area, or \(2(1/2)=1\). The marginal density of \(Y\) is

$$ f_Y(y)=\int_0^y 2\,dx=2y,\qquad 0<y<1. $$

Thus the conditioning event has probability

$$ P(1/2<Y<1)=\int_{1/2}^1 2y\,dy =\left[y^2\right]_{1/2}^1 =1-\frac14=\frac34. $$

For fixed \(x\), the joint support requires \(y>x\). The numerator integrates over \(1/2<y<1\) and \(y>x\), so its lower limit is \(\max(1/2,x)\). For \(0<x<1/2\), the integral is \(2(1-1/2)=1\). For \(1/2\leq x<1\), it is \(2(1-x)\). Dividing by \(3/4\) gives

$$ f_{X\mid 1/2<Y<1}(x)= \begin{cases} \frac43,&0<x<\frac12,\\[3pt] \frac83(1-x),&\frac12\leq x<1,\\[3pt] 0,&\text{otherwise}. \end{cases} $$

Check the normalization: the first part integrates to \((4/3)(1/2)=2/3\), and the second to \((8/3)\int_{1/2}^1(1-x)\,dx=(8/3)(1/8)=1/3\). Together they integrate to one. Finally, since \(1/4<1/2\),

$$ P(X<1/4\mid 1/2<Y<1) =\int_0^{1/4}\frac43\,dx =\frac13. $$

Worked Example: An Upper-Threshold Event with Dependent Variables

Suppose \(f_{X,Y}(x,y)=2\) on \(0<y<x<1\), and zero elsewhere. Find the density of \(X\) given \(Y>1/2\), then find \(P(X>3/4\mid Y>1/2)\).

The joint density integrates to one because the support has area \(1/2\). The event probability is

$$ P(Y>1/2)=\int_{1/2}^1\int_y^1 2\,dx\,dy =\int_{1/2}^1 2(1-y)\,dy =\frac14. $$

For a fixed \(x\), the support requires \(0<y<x\), while the event requires \(y>1/2\). There is no contributing \(y\) if \(x\leq1/2\); if \(x>1/2\), the relevant range is \(1/2<y<x\). Therefore

$$ \int_{1/2}^{1} f_{X,Y}(x,y)\,dy = \begin{cases} 0,&x\leq 1/2,\\ 2(x-1/2),&1/2<x<1. \end{cases} $$

After dividing by \(1/4\), the conditional density is \(8(x-1/2)\) for \(1/2<x<1\), and zero otherwise. Its integral is \(8\int_{1/2}^1(x-1/2)\,dx=8(1/8)=1\). The requested probability is

$$ P(X>3/4\mid Y>1/2) =\int_{3/4}^1 8(x-1/2)\,dx =4\left[(x-1/2)^2\right]_{3/4}^1 =4\left(\frac14-\frac1{16}\right)=\frac34. $$

The support determines the answer’s lower limit: for \(X\) to be observed with \(Y>1/2\), it must itself exceed \(1/2\). Ignoring that constraint would produce an incorrect numerator.

Worked Example: Conditioning a Bivariate Normal Model on an Interval

Let \(X\) and \(Z\) be independent \(N(0,1)\) variables, and set \(Y=X/2+\sqrt{3}Z/2\). Find the density of \(X\) given \(0<Y<1\), and evaluate that density at \(x=0\).

Both \(X\) and \(Y\) have the standard normal distribution, and their correlation is \(1/2\). Given \(X=x\), the representation of \(Y\) gives \(Y\mid X=x\sim N(x/2,3/4)\). Write \(\phi\) and \(\Phi\) for the standard normal density and CDF. Standardizing the two interval endpoints yields

$$ P(0<Y<1\mid X=x) =\Phi\!\left(\frac{1-x/2}{\sqrt{3}/2}\right) -\Phi\!\left(\frac{-x/2}{\sqrt{3}/2}\right) =\Phi\!\left(\frac{2-x}{\sqrt3}\right)-\Phi\!\left(-\frac{x}{\sqrt3}\right). $$

Since the marginal density of \(X\) is \(\phi(x)\), the joint density integrated over the event is \(\phi(x)P(0<Y<1\mid X=x)\). Also, \(Y\sim N(0,1)\), so \(P(0<Y<1)=\Phi(1)-\Phi(0)\). Hence

$$ f_{X\mid 0<Y<1}(x) = \frac{\phi(x)\left[\Phi\!\left(\frac{2-x}{\sqrt3}\right)-\Phi\!\left(-\frac{x}{\sqrt3}\right)\right]} {\Phi(1)-\Phi(0)}. $$

At \(x=0\), \(\phi(0)=0.3989423\), \(\Phi(2/\sqrt3)-\Phi(0)\approx0.375893\), and \(\Phi(1)-\Phi(0)\approx0.3413447\). Using these unrounded values in the ratio gives

$$ f_{X\mid 0<Y<1}(0) =\frac{\phi(0)\left[\Phi(2/\sqrt3)-\Phi(0)\right]}{\Phi(1)-\Phi(0)} \approx 0.4393. $$

This is a density value, not the probability that \(X=0\). Probabilities are obtained by integrating this conditional density over a set of \(x\)-values.

Interval Conditioning as a Weighted Average

When a conditional density \(f_{X\mid Y=y}\) is available, the interval-conditioned density can also be expressed as an average of those pointwise conditional densities. Suppose \(f_Y(y)>0\) for almost every \(y\in(a,b)\), and the conditional densities are chosen so that \(f_{X,Y}(x,y)=f_{X\mid Y=y}(x)f_Y(y)\) almost everywhere in the interval. Substitution in the interval formula gives

$$ f_{X\mid a<Y<b}(x) =\int_a^b f_{X\mid Y=y}(x)\, \frac{f_Y(y)}{P(a<Y<b)}\,dy. $$

The weights \(f_Y(y)/P(a<Y<b)\), restricted to \(a<y<b\), form the density of \(Y\) given the interval event. Thus values of \(y\) that are more probable within the interval contribute more to the conditional law of \(X\). In general, the answer is not the conditional density evaluated at the midpoint of the interval.

The same reasoning gives a second useful result. For any Borel set \(B\), the conditional CDF is

Result: Under the theorem’s assumptions, $$ P(X\leq t\mid a<Y<b) =\frac{\displaystyle\int_{-\infty}^{t}\int_a^b f_{X,Y}(x,y)\,dy\,dx} {P(a<Y<b)}. $$

Justification. Apply the theorem’s probability identity with \(B=(-\infty,t]\). The numerator is the joint probability of \(X\leq t\) and \(a<Y<b\), obtained by integrating the joint density over precisely that event. Dividing by the positive probability of the conditioning event gives the displayed expression. This also shows how to obtain conditional tail probabilities: integrate the conditional density over the relevant tail, or use one minus the conditional CDF when appropriate.

Thresholds, Endpoints, and Common Mistakes

A threshold event is just an interval with an infinite endpoint. For example, for \(A=\{Y>c\}\),

$$ f_{X\mid Y>c}(x) =\frac{\displaystyle\int_c^\infty f_{X,Y}(x,y)\,dy}{P(Y>c)}, \qquad P(Y>c)>0. $$

For \(Y<c\), integrate over \((-\infty,c)\) instead. If \(Y\) has a density, changing a strict inequality to a non-strict one at a finite endpoint does not change these probabilities: \(P(Y=c)=0\). That endpoint observation relies on the density assumption. When a distribution has point masses, endpoint choices may change the event probability, so the displayed density-only formula may not apply.

A frequent mistake is to use \(f_{X,Y}(x,y)\) at one representative value of \(y\), or to substitute a midpoint into a conditional density. Neither operation integrates over the conditioning event. The correct numerator accumulates all joint probability compatible with both \(X=x\) and the event, and the denominator normalizes by the event’s total probability.

1
Set the event range.
For \(a<Y<b\), identify the allowed values of \(y\), including any infinite endpoint for a threshold event.
2
Respect the joint support.
For each fixed \(x\), determine which values of \(y\) satisfy both the event and the support constraints.
3
Integrate and normalize.
Integrate the joint density over the allowed \(y\)-values and divide by the probability of the event; check that the final density integrates to one.

This method is useful whenever a report or model describes a selected group through a range of a continuous variable: for example, patients whose biomarker lies in a specified band or measurements exceeding a threshold. It converts the selection rule into an explicit conditional distribution, from which probabilities and expectations can then be computed.

Check Your Understanding

For each question, identify the integration range and the normalization probability before calculating.

  1. If \(A=\{a<Y<b\}\) has positive probability, what is the numerator in the density of \(X\) given \(A\)?
  2. For the density \(2\) on \(0<y<x<1\), why does the numerator for \(Y>1/2\) vanish when \(x\leq1/2\)?
  3. Why must a density for \(X\) given an event be divided by the probability of that event?
  4. In the normal example, why is the value of the conditional density at \(x=0\) not the probability that \(X=0\)?
  5. Under what assumption can the endpoint distinction between \(Y>c\) and \(Y\geq c\) be ignored?