Tutorials › Multivariate Statistics (Graduate) › Change of Variables for Bijective Maps

Multivariate Laws and Transformations · Tutorial 53 of 975

Change of Variables for Bijective Maps

Learn how a smooth one-to-one transformation changes a joint density and how to determine exactly where the transformed density is nonzero.

Beginner 10 min read

What You'll Learn

  • State the conditions for the bijective change-of-variables formula
  • Use the inverse map and its Jacobian determinant to calculate a transformed density
  • Track the support through the transformation rather than assuming it stays unchanged
  • Check a transformed density by integrating it over its support
  • Recognize common errors involving the inverse map and the Jacobian factor

Why the Support and the Jacobian Both Matter

A transformation changes more than the numerical values of a random vector. It can change the region where the vector can occur, and it changes how probability is distributed across that region. The density must account for both effects: the transformed support identifies where probability is possible, while a Jacobian determinant adjusts for how the map stretches or compresses volume.

The formula in this tutorial concerns a differentiable, one-to-one transformation between open subsets of Euclidean space. Its essential feature is that the density is evaluated using the inverse map, and the volume adjustment is the absolute determinant of the inverse map's derivative.

Definition: Let \(U,V\) be open subsets of \(\mathbb{R}^d\). A map \(g:U\to V\) is a diffeomorphism if it is a bijection, \(g\) is continuously differentiable, its inverse \(h=g^{-1}:V\to U\) is continuously differentiable, and the derivative matrices are nonsingular at every point. The Jacobian matrix \(Dg(x)\) has entries \(\partial g_i/\partial x_j\), and its Jacobian determinant is \(\det Dg(x)\).

Suppose \(X\) has density \(f_X\) on \(U\), meaning \(P(X\in U)=1\) and probabilities within \(U\) are obtained by integrating \(f_X\) with respect to \(d\)-dimensional Lebesgue measure. Define \(Y=g(X)\). Since \(g\) is a bijection, \(Y\) takes values in \(V\), and \(X=h(Y)\). The density formula follows by expressing probabilities for \(Y\) as probabilities for \(X\).

Theorem (Change of Variables for a Bijection): Let \(g:U\to V\) be a diffeomorphism between open subsets of \(\mathbb{R}^d\), and let \(h=g^{-1}\). If \(X\) has density \(f_X\) on \(U\) and \(Y=g(X)\), then a density of \(Y\) is $$ f_Y(y)= \begin{cases} f_X(h(y))\,|\det Dh(y)|, & y\in V,\\ 0, & y\notin V. \end{cases} $$ Equivalently, for \(y\in V\), \( |\det Dh(y)|=1/|\det Dg(h(y))|\). The density is determined up to changes on sets of Lebesgue measure zero.

Deriving the Density Formula

Let \(A\) be any Borel subset of \(\mathbb{R}^d\). The event \(Y\in A\) is the event \(g(X)\in A\), or, equivalently, \(X\in h(A\cap V)\). Therefore,

$$ P(Y\in A) = \int_{h(A\cap V)} f_X(x)\,dx. $$

Apply the multivariate change-of-variables theorem for integrals to the substitution \(x=h(y)\). It applies because \(h\) is a continuously differentiable bijection between the open sets \(V\) and \(U\), with nonsingular derivative. The integral becomes

$$ P(Y\in A) = \int_{A\cap V} f_X(h(y))\,|\det Dh(y)|\,dy. $$

This is the defining integral identity for a density of \(Y\): for every Borel set \(A\), its probability is the integral over \(A\) of the stated function, set to zero outside \(V\). The absolute value is required because a change of variables adjusts volume by a nonnegative factor, regardless of whether the map preserves or reverses orientation.

To obtain the equivalent expression using \(Dg\), differentiate \(g(h(y))=y\). The chain rule gives \(Dg(h(y))Dh(y)=I_d\), where \(I_d\) is the \(d\)-dimensional identity matrix. Taking determinants yields \(\det Dg(h(y))\det Dh(y)=1\), and hence

$$ |\det Dh(y)|=\frac{1}{|\det Dg(h(y))|}. $$

This derivation also shows why the original density is evaluated at \(h(y)\), not at \(g(y)\): the probability near \(y\) comes from the corresponding original point \(x=h(y)\).

Worked Examples

Worked Example: A One-Dimensional Nonlinear Transformation

Let \(X\) have density \(f_X(x)=2e^{-2x}\) for \(x>0\), and zero otherwise. Set \(Y=X^2\). Find and check the density of \(Y\).

On \(U=(0,\infty)\), the map \(g(x)=x^2\) is a diffeomorphism onto \(V=(0,\infty)\). Its inverse is \(h(y)=\sqrt{y}\), with derivative \(h'(y)=1/(2\sqrt{y})\). Thus, for \(y>0\),

$$ f_Y(y) =f_X(\sqrt{y})\,|h'(y)| =2e^{-2\sqrt{y}}\frac{1}{2\sqrt{y}} =\frac{e^{-2\sqrt{y}}}{\sqrt{y}}. $$

The transformed support is \(y>0\), because squaring maps every positive \(x\) to a positive \(y\). To check normalization, substitute \(t=\sqrt y\), so \(dy=2t\,dt\):

$$ \int_0^\infty \frac{e^{-2\sqrt{y}}}{\sqrt{y}}\,dy = \int_0^\infty \frac{e^{-2t}}{t}(2t)\,dt = 2\int_0^\infty e^{-2t}\,dt =1. $$

The density can become unbounded near zero, but that does not prevent it from being a valid density: its integral over the support is one.

Worked Example: A Two-Dimensional Transformation

Suppose \(X=(X_1,X_2)\) has joint density \(f_X(x_1,x_2)=e^{-x_1-x_2}\) for \(x_1>0,\ x_2>0\), and zero otherwise. Define \(Y=g(X)\) by \(Y_1=X_1\) and \(Y_2=X_1X_2\). Find the joint density of \(Y\).

On the positive quadrant, \(g\) is a bijection onto the positive quadrant: given \(y_1>0,\ y_2>0\), its inverse is \(h(y_1,y_2)=(y_1,y_2/y_1)\). The derivative matrix and its determinant are

$$ Dh(y_1,y_2)= \begin{pmatrix} 1 & 0\\ -\frac{y_2}{y_1^2} & \frac{1}{y_1} \end{pmatrix}, \qquad \det Dh(y_1,y_2)=\frac{1}{y_1}. $$

The support remains the positive quadrant, and for \(y_1,y_2>0\),

$$ f_Y(y_1,y_2) = f_X\left(y_1,\frac{y_2}{y_1}\right)\frac{1}{y_1} = \frac{1}{y_1}\exp\left(-y_1-\frac{y_2}{y_1}\right). $$

Check that this integrates to one by first integrating with respect to \(y_2\):

$$ \int_0^\infty\int_0^\infty \frac{1}{y_1}e^{-y_1-y_2/y_1}\,dy_2\,dy_1 = \int_0^\infty e^{-y_1} \left(\int_0^\infty \frac{1}{y_1}e^{-y_2/y_1}\,dy_2\right)dy_1 = \int_0^\infty e^{-y_1}\,dy_1 =1. $$

In the inner integral, the substitution \(s=y_2/y_1\) gives \(dy_2=y_1\,ds\), so the inner integral is \(\int_0^\infty e^{-s}\,ds=1\).

Worked Example: Tracking a Bounded, Nonrectangular Support

Let \(X=(X_1,X_2)\) be uniform on the unit square \(U=(0,1)\times(0,1)\), with density one there. Define \(Y_1=X_1\) and \(Y_2=X_2/(1+X_1)\). Find the support and density of \(Y\).

Solving for the original coordinates gives \(x_1=y_1\) and \(x_2=(1+y_1)y_2\). The conditions \(0<x_1<1\) and \(0<x_2<1\) become

$$ 0<y_1<1, \qquad 0<y_2<\frac{1}{1+y_1}. $$

This is the transformed support: it is not the unit square. The inverse derivative matrix has determinant

$$ Dh(y_1,y_2)= \begin{pmatrix} 1 & 0\\ y_2 & 1+y_1 \end{pmatrix}, \qquad |\det Dh(y_1,y_2)|=1+y_1. $$

Since the original density is one on the square, the transformed density is \(1+y_1\) on the region just found and zero elsewhere. Its integral is

$$ \int_0^1\int_0^{1/(1+y_1)}(1+y_1)\,dy_2\,dy_1 = \int_0^1 1\,dy_1 =1. $$

The support condition and the Jacobian factor work together: the height of the support at \(y_1\) is \(1/(1+y_1)\), while the density there is \(1+y_1\).

Support, Regularity, and Common Pitfalls

The formula applies where \(Y\) can occur: if \(X\) is concentrated on \(U\), then \(Y=g(X)\) is concentrated on \(V\). Within \(V\), the transformed density is nonzero wherever the inverse image has positive original density, subject to the usual qualification that densities are defined only almost everywhere. If the original density is zero on part of \(U\), its image need not carry positive transformed density. Thus, transforming the map's whole range identifies where \(Y\) is allowed to lie, while transforming the region where \(f_X\) is positive identifies where its density is positive.

A frequent mistake is to use \(|\det Dg(y)|\) as the multiplier and evaluate \(f_X\) at \(g(y)\). The variables do not match: \(g\) takes original points to transformed points, while the density formula at \(y\) requires the original point \(h(y)\). The correct factor is \(|\det Dh(y)|\), or equivalently \(1/|\det Dg(h(y))|\). Another common error is to give a formula on the transformed range but omit its boundaries or inequalities; that can incorrectly assign positive density to impossible values.

The determinant factor describes local volume change. When \(|\det Dh(y)|\) is large, a small volume near \(y\) corresponds to a larger volume in the original coordinates, and its transformed density is correspondingly larger. When the inverse map compresses volume, the factor is smaller. Keeping the inverse, determinant, and support together provides a reliable check before using a transformed law in further calculations.

Key takeaway: For a differentiable bijection \(Y=g(X)\), evaluate the original density at \(g^{-1}(y)\), multiply by \(|\det Dg^{-1}(y)|\), and restrict the result to the image of the original support.

Check Your Understanding

For each question, identify both the Jacobian factor and the support implications.

  1. In the bijective change-of-variables formula, why is the density evaluated at \(h(y)\) rather than \(g(y)\)?
  2. If \(g:U\to V\) is a diffeomorphism, write the relationship between \(|\det Dh(y)|\) and \(|\det Dg(h(y))|\).
  3. For the transformation in the bounded-support example, why is the transformed support not the unit square?
  4. A proposed transformed density integrates to one over all of \(\mathbb{R}^d\), but is positive outside \(g(U)\). What must be corrected?
  5. Why does the change-of-variables formula use an absolute value around the Jacobian determinant?
Clinical Biostats