Step-by-step method for transforming two random variables using the Jacobian to find the joint pdf, with worked example

How Do We Transform Two Random Variables?

Suppose $X$ and $Y$ are continuous random variables with joint pdf $f_{X,Y}(x,y)$.

We use them to define two new random variables:

$$U=u(X,Y), \qquad V=v(X,Y).$$

We would like to find the joint pdf of $U$ and $V$.

The difficulty is that transforming the variables can stretch or compress areas.

Under the transformation, a region in the original $x$-$y$ plane is mapped to a new, corresponding region in the $u$-$v$ plane. These two regions must have the same probability. However, after the transformation, they may have different areas.

Since probability is represented by the volume under the pdf, a change in the area of the region would change this volume unless the height of the pdf changed too. That is, the height of the pdf has to adjust to compensate for the rescaling.

If the transformed region is larger, the new pdf must generally have a smaller height, so that the volume under it remains the same. If instead the transformed region becomes smaller, the new pdf must generally be taller to keep the same probability.

For example, suppose

$$U=2X, \qquad V=2Y.$$

A square with side length $1/2$ in the original $x$-$y$ plane is mapped to a square with side length $1$ in the new $u$-$v$ plane.

The new square has four times the area of the original one. Since the two corresponding regions represent the same event, they must contain the same probability. So, the height of the pdf must become one quarter as large.

The Jacobian method keeps track of this change in area.


The Jacobian Method

We can find the new joint pdf in three main steps.

Step 1: Invert the transformation.

Write $X$ and $Y$ in terms of $U$ and $V$:

$$X=x(U,V), \qquad Y=y(U,V).$$

This may involve solving two simultaneous equations.

Step 2: Find the Jacobian of the inverse transformation.

Using possible values $u$ and $v$ of the new random variables, form the matrix

$$J=\left(\begin{array}{cc}\frac{\partial x}{\partial u} & \frac{\partial x}{\partial v} \cr \frac{\partial y}{\partial u} & \frac{\partial y}{\partial v}\end{array}\right).$$

Then calculate its determinant.

Step 3: Find the new pdf.

The transformed joint pdf is

$$f_{U,V}(u,v)=|\det(J)|f_{X,Y}(x,y),$$

where $x$ and $y$ are replaced by their expressions in terms of $u$ and $v$.

We must also work out the new range of possible values of $u$ and $v$.

This version of the method assumes that the transformation can be inverted uniquely over the region we are considering.


Why Does the Jacobian Appear?

Here $J$ is the Jacobian of the inverse transformation, from the $u$-$v$ plane back to the $x$-$y$ plane.

The original transformation changes small areas by a factor of

$$\frac{1}{|\det(J)|}.$$

Multiplying the pdf by $|\det(J)|$ compensates for this change in area, so that corresponding regions still contain the same probability.


Worked Example

Suppose $X$ and $Y$ have joint pdf

$$f_{X,Y}(x,y)=8xy$$

for

$$0<x<1, \qquad 0<y<x,$$

and zero elsewhere.

Define two new random variables:

$$U=X, \qquad V=XY.$$

Let’s find the joint pdf of $U$ and $V$.


Step 1: Invert the Transformation

For this example,

$$U=X,$$

so immediately

$$X=U.$$

We also have

$$V=XY.$$

Substituting $X=U$ gives

$$V=UY,$$

and hence

$$Y=\frac{V}{U}.$$

So the inverse transformation is

$$X=U, \qquad Y=\frac{V}{U}.$$


Step 2: Find the Jacobian

For this example,

$$x=u, \qquad y=\frac{v}{u}.$$

The Jacobian matrix is

$$J=\left(\begin{array}{cc}1 & 0 \cr -\frac{v}{u^2} & \frac{1}{u}\end{array}\right).$$

Its determinant is

$$\det(J)=\frac{1}{u}.$$

Since $u>0$ over the range we will use,

$$|\det(J)|=\frac{1}{u}.$$


Step 3: Find the Transformed pdf

For this example, we substitute

$$x=u, \qquad y=\frac{v}{u}$$

into the original pdf:

$$f_{X,Y}(x,y)=8xy.$$

This gives

$$f_{X,Y}\left(u,\frac{v}{u}\right)=8u\left(\frac{v}{u}\right)=8v.$$

We then multiply by the absolute value of the Jacobian determinant:

$$f_{U,V}(u,v)=\frac{1}{u}\times8v=\frac{8v}{u}.$$

Finally, we need the range of $u$ and $v$.

Since $U=X$ and $0<X<1$,

$$0<u<1.$$

Also,

$$V=XY.$$

For a fixed value $U=u$, we have $X=u$ and

$$0<Y<u.$$

Multiplying by $u$ gives

$$0<V<u^2.$$

So the final joint pdf is

$$f_{U,V}(u,v)=\frac{8v}{u}$$

for

$$0<u<1, \qquad 0<v<u^2,$$

and zero elsewhere.


Background:

Found this useful?

Understanding Econometrics is completely free to use, and always will be.

If you found the site useful and would like to help me keep adding new material, please consider buying me a coffee!

Buy me a coffee ☕