Tutorials › Multivariate Statistics (Graduate) › Worked Transformations of Sums, Ratios, and Products

Multivariate Laws and Transformations · Tutorial 57 of 975

Worked Transformations of Sums, Ratios, and Products

Learn to transform a joint density into the density of a sum, ratio, or product, with particular care to the support and Jacobian.

Beginner 10 min read

What You'll Learn

  • Derive the convolution formula for a sum and identify when independence is needed.
  • Find the Jacobians for ratio and product transformations.
  • Set integration limits by intersecting the transformed constraints with the original support.
  • Compute the sum of two independent uniform random variables.
  • Derive ratio and product densities for independent uniform random variables.
  • Check support and normalization to catch common transformation errors.

From a Joint Density to a New Random Variable

A sum, ratio, or product is a function of a pair of random variables. Its distribution is therefore determined by the joint law of that pair. The main challenge is often not the calculus itself: it is identifying which original values can produce a proposed transformed value. That support calculation determines the correct integration limits.

Assume throughout that \((X,Y)\) has a joint density \(f_{X,Y}(x,y)\) with respect to area, and consider \(S=X+Y\), \(R=X/Y\), and \(P=XY\). For the ratio and product, the line \(y=0\) has probability zero under this assumption, so the transformations can be defined off that line. Independence is not required for the general formulas below. When \(X\) and \(Y\) are independent, the joint density factors as \(f_{X,Y}(x,y)=f_X(x)f_Y(y)\).

Definition: The support constraints for a transformed variable are the restrictions on its transformed coordinates that come from the region where \(f_{X,Y}(x,y)\) is positive. In a density formula, integrate only over values that satisfy those original constraints. A formula for the Jacobian does not determine the integration limits; the support does.

Sum: Convolution and Its Support

To find the density of \(S=X+Y\), use the transformation \((x,y)\mapsto(s,y)=(x+y,y)\). Its inverse is \(x=s-y\), \(y=y\), and the absolute Jacobian determinant of the inverse is \(1\). Integrating out the coordinate \(y\) gives the sum density.

Theorem: If \((X,Y)\) has a joint density, then a density of \(S=X+Y\) is
$$ f_S(s)=\int_{-\infty}^{\infty} f_{X,Y}(s-y,y)\,dy. $$

The integrand is zero wherever \((s-y,y)\) lies outside the support of \((X,Y)\), so this expression automatically imposes the support constraints. If \(X\) and \(Y\) are independent, the formula becomes the convolution

$$ f_S(s)=\int_{-\infty}^{\infty} f_X(s-y)f_Y(y)\,dy. $$

To justify the formula, the change of variables \((x,y)\mapsto(s,y)\) gives the joint density \(f_{S,Y}(s,y)=f_{X,Y}(s-y,y)\), since its inverse Jacobian has absolute value \(1\). Integrating this joint density over \(y\) gives the marginal density of \(S\). The integrands are nonnegative, so the integration and marginalization are valid by Tonelli’s theorem. The result is a density up to changes on sets of measure zero. \(\square\>

Worked Example: The Sum of Two Uniform Variables

Let \(X\) and \(Y\) be independent Uniform\((0,1)\) random variables. Find the density of \(S=X+Y\), including its support.

The joint density is \(1\) when \(0<x<1\) and \(0<y<1\), and zero elsewhere. For a fixed \(s\), substitute \(x=s-y\). Both \(0<y<1\) and \(0<s-y<1\) must hold. The second pair of inequalities is equivalent to \(s-1<y<s\). Thus the allowed values of \(y\) lie in the intersection of \((0,1)\) and \((s-1,s)\).

If \(0<s<1\), that intersection is \((0,s)\), whose length is \(s\). If \(1\leq s<2\), it is \((s-1,1)\), whose length is \(2-s\). Outside \(0<s<2\), the intersection is empty. Therefore

$$ f_S(s)= \begin{cases} s, & 0<s<1,\\ 2-s, & 1\leq s<2,\\ 0, & \text{otherwise}. \end{cases} $$

The density integrates to \(1\): \(\int_0^1 s\,ds+\int_1^2(2-s)\,ds=\tfrac12+\tfrac12=1\). The triangular shape comes directly from the changing length of the overlap, not from an assumption that the sum is uniform.

Ratio and Product: Transform First, Then Restrict

For a ratio, retain \(Y\) as the second transformed coordinate and set \(R=X/Y\). The inverse transformation is \(x=ry,\ y=y\). Its Jacobian determinant is \(y\), so the absolute Jacobian is \(|y|\). For a product, set \(P=XY\) and retain \(Y\). The inverse is \(x=p/y,\ y=y\), with absolute Jacobian \(1/|y|\). These factors are different; each comes from its own inverse map.

Theorem: If \((X,Y)\) has a joint density and \(P(Y=0)=0\), then densities of \(R=X/Y\) and \(P=XY\) are, respectively,
$$ f_R(r)=\int_{y\ne 0}|y|\,f_{X,Y}(ry,y)\,dy, \qquad f_P(p)=\int_{y\ne 0}\frac{1}{|y|}\,f_{X,Y}\!\left(\frac{p}{y},y\right)\,dy. $$

Each integral is restricted to values of \(y\) for which the corresponding original pair \((ry,y)\) or \((p/y,y)\) is in the support. For the ratio, the transformed joint density of \((R,Y)\) is \(|y|f_{X,Y}(ry,y)\); integrating out \(y\) gives \(f_R\). For the product, the transformed joint density of \((P,Y)\) is \(f_{X,Y}(p/y,y)/|y|\); integrating out \(y\) gives \(f_P\). In both cases the change of variables is one-to-one on \(y\ne0\), and the nonnegative integrands permit marginalization by Tonelli’s theorem. As with any density formula, values at individual points can be changed without changing the distribution. \(\square\)

When \(X\) and \(Y\) are independent, replace \(f_{X,Y}(x,y)\) by \(f_X(x)f_Y(y)\). The formulas still require the support restrictions: an integral over all nonzero \(y\) is harmless only if the densities themselves make the integrand zero outside the feasible region.

Worked Example: The Ratio of Two Uniform Variables

Let \(X\) and \(Y\) be independent Uniform\((0,1)\) random variables. Find the density of \(R=X/Y\).

Because \(X\) and \(Y\) are positive, \(R>0\). For a fixed \(r>0\), the ratio formula has integrand \(y\) when both \(0<y<1\) and \(0<ry<1\) hold. These conditions give \(0<y<\min(1,1/r)\). Therefore

$$ f_R(r)=\int_0^{\min(1,1/r)} y\,dy =\frac12\min(1,1/r)^2,\qquad r>0. $$

Equivalently,

$$ f_R(r)= \begin{cases} \frac12, & 0<r\leq1,\\ \frac{1}{2r^2}, & r>1,\\ 0, & r\leq0. \end{cases} $$

The two pieces integrate to \(\int_0^1\tfrac12\,dr=\tfrac12\) and \(\int_1^\infty \tfrac{1}{2r^2}\,dr=\tfrac12\), so the density has total mass \(1\). The unbounded range of the ratio is possible because \(Y\) can be arbitrarily close to zero.

Worked Example: The Product of Two Uniform Variables

Let \(X\) and \(Y\) again be independent Uniform\((0,1)\) random variables. Find the density of \(P=XY\).

Both variables are positive and less than \(1\), so \(0<P<1\). For fixed \(0<p<1\), the product formula has integrand \(1/y\). The original constraints require \(0<y<1\) and \(0<p/y<1\). Since \(y>0\), the latter says \(y>p\). Thus \(p<y<1\), and

$$ f_P(p)=\int_p^1\frac{1}{y}\,dy =-\log p,\qquad 0<p<1. $$

The density is zero outside this interval. Its total mass is \(1\), since

$$ \int_0^1-\log p\,dp =\left[-p\log p+p\right]_0^1 =1. $$

At the lower endpoint the expression \(p\log p\) tends to \(0\) as \(p\) decreases to \(0\). The density grows without bound near zero, but its integral remains finite; an unbounded density is not by itself a problem.

Support Checks and a Common Pitfall

A useful way to organize a transformation problem is to solve the inverse map first, write the original support inequalities in the new coordinates, and only then integrate. This prevents the most common error: using the correct Jacobian but the wrong range of integration.

1
Choose transformed coordinates.
For a sum, use \((s,y)=(x+y,y)\); for a ratio, use \((r,y)=(x/y,y)\); for a product, use \((p,y)=(xy,y)\).
2
Invert the map and compute its Jacobian.
Use the absolute determinant of the inverse derivative: \(1\) for the sum, \(|y|\) for the ratio, and \(1/|y|\) for the product.
3
Translate every support constraint.
Substitute the inverse map into the original support and find the values of the retained coordinate that satisfy all constraints.
4
Integrate and check.
Integrate over precisely those feasible values. Check that the resulting density is nonnegative and has total integral \(1\).

For example, a tempting but incorrect ratio calculation for the independent Uniform\((0,1)\) variables is to integrate \(y\) over \((0,1)\) for every \(r>0\). That ignores \(ry<1\), which requires \(y<1/r\) when \(r>1\). The resulting constant density \(1/2\) on all positive \(r\) would have infinite total mass. The correction is to intersect both original constraints, giving \(0<y<\min(1,1/r)\) and the integrable tail \(1/(2r^2)\). Likewise, omitting the Jacobian factor \(|y|\) for the ratio or \(1/|y|\) for the product changes the distribution even if the limits are correct.

Independence is another condition to handle explicitly. The product \(f_X(x)f_Y(y)\) is justified only when \(X\) and \(Y\) are independent. For dependent variables with a joint density, use \(f_{X,Y}(x,y)\) in the same transformation formulas. A formula based only on the marginal densities cannot generally determine the law of a sum, ratio, or product.

Key takeaway: The transformed density combines the original joint density with a Jacobian factor, while the support determines the integration limits. Both parts are essential: a correct transformation with incorrect support constraints does not give the desired distribution.

Check Your Understanding

For each question, identify the support constraints before attempting the integration.

  1. For independent Uniform\((0,1)\) variables, what values of \(y\) are feasible in the sum-density calculation when \(s=1.4\)?
  2. Why does the ratio of two positive Uniform\((0,1)\) variables have no mass on negative values?
  3. For the ratio transformation, what is the absolute Jacobian factor, and which inverse map produces it?
  4. For the product of two Uniform\((0,1)\) variables, explain why the product density integrates over \(p<y<1\).
  5. Which part of the sum, ratio, and product formulas changes when \(X\) and \(Y\) are dependent?
Clinical Biostats