Tutorials › Statistical Theory I - Probability and Distribution Theory › Choosing a Method for Nonlinear Distribution Problems

Many-to-One Transformations · Tutorial 443 of 994

Choosing a Method for Nonlinear Distribution Problems

Choose a calculation strategy for nonlinear transformations by matching the geometry of the event or density to the simplest available method.

Intermediate 10 min read

What You'll Learn

  • Decide when a transformation is easiest to handle through its CDF preimage.
  • Derive the density of a one-variable transformation by summing over inverse branches.
  • Use conditioning to calculate product and ratio densities.
  • Check support and integration bounds before choosing a method.
  • Compare methods by verifying that they give the same distribution.

Introduction

For a nonlinear transformation, the main challenge is often not finding a formula but choosing a route to it. A square has two inverse branches away from zero; a product or ratio involves two random variables and often becomes simpler after conditioning. The cumulative distribution function (CDF), inverse-branch density, and conditioning methods are different ways to organize the same probability calculation.

A useful starting question is: which description of the event or transformation makes the relevant set easiest to calculate? If the event \(g(X)\leq t\) has a simple preimage, work with the CDF. If the inverse branches are explicit, transform the density branch by branch. If conditioning reduces a two-variable problem to a one-variable transformation with simple bounds, integrate the conditional density.

Three Routes to a Distribution

Definition: If \(Z=g(X)\), where \(g\) is measurable, then for every real \(t\), $$ F_Z(t)=P(Z\leq t)=P(g(X)\leq t)=\int_{\{x:g(x)\leq t\}} f_X(x)\,dx, $$ when \(X\) has density \(f_X\). The set \(\{x:g(x)\leq t\}\) is the preimage of \((-\infty,t]\) under \(g\).

The CDF identity is valid for any measurable \(g\); it does not require \(g\) to be one-to-one. Its practical value depends on whether the preimage can be described and integrated simply. A density calculation may be shorter when the equation \(g(x)=z\) has a few manageable solutions.

Theorem: Suppose \(X\) has density \(f_X\), and, except for a set of \(X\)-probability zero, its support can be partitioned into finitely many intervals on each of which \(g\) is continuously differentiable, strictly monotone, and has nonzero derivative. At values \(z\) with inverse points in those intervals, the density of \(Z=g(X)\) is $$ f_Z(z)=\sum_{x:g(x)=z}\frac{f_X(x)}{|g'(x)|}, $$ for almost every \(z\). Only inverse points in the support of \(X\) are included.

Each inverse point contributes a term. The absolute derivative accounts for the local change in scale, and the support restriction prevents including roots that \(X\) cannot take.

Justification. On any one of the monotone intervals, the map \(z=g(x)\) has a differentiable inverse \(x=g^{-1}(z)\). The one-dimensional change-of-variables formula gives the contribution $$ f_X\bigl(g^{-1}(z)\bigr)\left|\frac{d}{dz}g^{-1}(z)\right| =\frac{f_X(x)}{|g'(x)|}. $$ The interval images may overlap. At a value \(z\) in an overlap, the disjoint source intervals contribute separate probabilities, so their densities add. Summing over the finitely many intervals gives the stated formula. The excluded set has probability zero and therefore contributes no probability to the distribution of \(Z\). \(\square\)

For a transformation of two variables, conditioning can turn the problem into a one-variable calculation. For independent \(X\) and \(Y\) with densities, one useful ratio formula, when \(P(Y=0)=0\), is $$ f_{X/Y}(r)=\int_{y\ne 0}|y|f_X(ry)f_Y(y)\,dy. $$ It follows by using \((r,y)\mapsto (x,y)=(ry,y)\), whose Jacobian has absolute value \(|y|\), and integrating the resulting joint density over \(y\). Conditioning on a suitable variable often gives the same integral with bounds that are easier to see directly.

Worked Examples: Match the Method to the Transformation

Worked Example: Squaring a Uniform Random Variable

Let \(X\sim\operatorname{Uniform}(-1,1)\), with density \(f_X(x)=1/2\) for \(-1<x<1\), and set \(Z=X^2\). Find the CDF and density of \(Z\). Here the CDF preimage is especially transparent, and the inverse-branch formula provides a direct check.

Since \(Z\geq 0\), \(F_Z(z)=0\) for \(z\leq 0\). For \(0<z<1\), $$ F_Z(z)=P(X^2\leq z)=P(-\sqrt z\leq X\leq\sqrt z) =\frac{2\sqrt z}{2}=\sqrt z. $$ For \(z\geq 1\), \(F_Z(z)=1\). Differentiating on \(0<z<1\) gives $$ f_Z(z)=\frac{1}{2\sqrt z}. $$

For the inverse-branch calculation, \(x^2=z\) has roots \(x=\sqrt z\) and \(x=-\sqrt z\). Both lie in the support when \(0<z<1\), and \(|g'(x)|=|2x|\). Thus $$ f_Z(z)=\frac{1/2}{2\sqrt z}+\frac{1/2}{2\sqrt z} =\frac{1}{2\sqrt z},\qquad 0<z<1. $$ The density integrates to \(\int_0^1 (2\sqrt z)^{-1}\,dz=1\). The CDF route describes the whole distribution at once; the branch route is a quick density calculation once both roots are identified.

Worked Example: Product of Two Uniform Random Variables

Let \(X\) and \(Y\) be independent \(\operatorname{Uniform}(0,1)\) random variables and define \(Z=XY\). Conditioning on \(X\) makes the product a scaled version of \(Y\), so it gives a particularly direct density calculation.

For fixed \(X=x\), where \(0<x<1\), \(Z=xY\) is uniform on \((0,x)\). Its conditional density is \(f_{Z\mid X}(z\mid x)=1/x\) for \(0<z<x\), and zero otherwise. Integrating over \(X\), whose density is 1 on \((0,1)\), gives, for \(0<z<1\), $$ f_Z(z)=\int_z^1\frac{1}{x}\,dx=-\log z. $$ Outside \((0,1)\), the density is zero. As a check, $$ \int_0^1-\log z\,dz =\left[-z\log z+z\right]_0^1=1, $$ where \(z\log z\to0\) as \(z\downarrow0\).

The CDF preimage also gives a clear calculation and confirms the result. For \(0<z<1\), the event \(XY\leq z\) includes all points with \(0<x\leq z\); for \(z<x<1\), it requires \(0<y\leq z/x\). Therefore $$ F_Z(z)=\int_0^z 1\,dx+\int_z^1\frac{z}{x}\,dx =z+z\log(1/z). $$ Differentiating yields \(F'_Z(z)=1+\log(1/z)-1=-\log z\). Here either method works, but conditioning makes the density integral especially immediate; the CDF calculation also makes the event geometry explicit.

Worked Example: Ratio of Two Uniform Random Variables

Let \(X\) and \(Y\) again be independent \(\operatorname{Uniform}(0,1)\) variables, and let \(R=X/Y\). Since \(Y>0\) with probability one, the ratio is defined almost surely. The CDF preimage is simple: for \(t>0\), \(R\leq t\) means \(X\leq tY\).

If \(0<t\leq1\), this event has probability $$ F_R(t)=\int_0^1 ty\,dy=\frac{t}{2}. $$ If \(t\geq1\), it is convenient to calculate the complement. For \(0<y<1/t\), the condition \(X>ty\) has probability \(1-ty\), while for \(y\geq1/t\) it is impossible. Hence $$ F_R(t)=1-\int_0^{1/t}(1-ty)\,dy =1-\left(\frac1t-\frac{1}{2t}\right) =1-\frac{1}{2t}. $$ For \(t\leq0\), \(F_R(t)=0\). The two positive-\(t\) expressions agree at \(t=1\), where each gives \(1/2\). Differentiation gives $$ f_R(t)= \begin{cases} \frac12,&0<t<1,\\[2pt] \frac{1}{2t^2},&t>1. \end{cases} $$

Conditioning on \(Y=y\) gives an independent check. Given \(Y=y\), \(R=X/y\) has density \(y\) on \(0<r<1/y\). Thus $$ f_R(r)=\int_0^{\min(1,1/r)}y\,dy = \begin{cases} \frac12,&0<r\leq1,\\[2pt] \frac{1}{2r^2},&r>1. \end{cases} $$ The CDF route is especially natural here because the inequality \(X\leq tY\) has a simple geometric description. Conditioning is equally effective for the density and makes the changing integration limit explicit.

A Practical Choice of Method

The methods are not competing formulas that must be applied in a fixed order. Choose the one that turns the transformation into the simplest event or integral, then use another route as a check when the calculation is delicate.

1
Inspect the preimage.
Write \(g(X)\leq t\) as a condition on the original variables. If this gives a small number of simple intervals or regions, the CDF method is often the clearest.
2
Count and locate inverse branches.
For a one-variable transformation, solve \(g(x)=z\). If the roots and derivatives are manageable, sum the inverse-branch contributions, retaining only roots in the support.
3
Try conditioning for a two-variable transformation.
Fix one variable and ask whether the remaining transformation is a simple scaling or monotone map. Choose the conditioning variable that gives the clearest conditional distribution and bounds.
4
Check the result.
Confirm that the support is plausible and, for a density, that its integral over the support is one. When practical, differentiate a CDF or compare with a second method.

A frequent mistake is to treat a many-to-one transformation as if it were increasing. For example, writing \(X^2\leq z\) as \(X\leq\sqrt z\) omits the condition \(X\geq-\sqrt z\). The correction is to describe the full preimage: \(-\sqrt z\leq X\leq\sqrt z\). In a density calculation, the same issue appears as missing an inverse branch. Explicitly checking the preimage or listing every support-valid root prevents that mistake.

The central decision is therefore structural. CDF preimages are flexible and work even when there are multiple branches; inverse-branch densities are efficient for a manageable one-dimensional equation; conditioning is often effective when fixing one variable simplifies a product or ratio. Each method computes probabilities under the same distribution, so agreement between two valid routes is a useful verification rather than a coincidence.

Check Your Understanding

For each problem, identify a suitable method before carrying out the calculation.

  1. For \(X\sim\operatorname{Uniform}(-2,2)\) and \(Z=X^2\), what is the preimage of the event \(Z\leq z\) when \(0<z<4\), and how many inverse branches contribute to the density?
  2. For independent \(X,Y\sim\operatorname{Uniform}(0,1)\) and \(Z=XY\), why does conditioning on \(X=x\) restrict the density integral to \(x>z\)?
  3. For the ratio \(R=X/Y\) in the worked example, why does the CDF calculation for \(t>1\) use a complement?
  4. State one advantage of the CDF preimage method and one situation where the inverse-branch formula is especially efficient.
  5. What support and normalization checks can help assess a proposed density for a transformed random variable?