MATH 5010 • Section 5

Transformations of Random Variables

A visual and interactive lesson on changing variables, CDF methods, Jacobians, one-to-one and many-to-one maps, probability integral transform, and simulation checks.

Concept map

What does a transformation do?

If $X$ is random and $Y=g(X)$, then the randomness is inherited through the map $g$. The main question is: how does probability mass or probability density move under the map?

CDF method:
$F_Y(y)=P(Y\le y)=P(g(X)\le y)$.
PDF method:
If $g$ is monotone, use inverse and derivative.
Jacobian method:
For vectors, use the determinant of the inverse map derivative.
$$\boxed{f_Y(y)=f_X(g^{-1}(y))\left|\frac{d}{dy}g^{-1}(y)\right|}$$

This simple formula is only directly valid when $g$ is one-to-one on the relevant support.

Interactive 1

CDF method: $Y=X^2$ when $X$ has density $f_X(x)=\frac12(1+x)$ on $(-1,1)$

This transformation is not one-to-one because both $x=\sqrt y$ and $x=-\sqrt y$ map to the same $y$. The CDF method avoids mistakes.

$$F_Y(y)=P(X^2\le y)=P(-\sqrt y\le X\le \sqrt y)=\sqrt y.$$ $$f_Y(y)=\frac{1}{2\sqrt y},\qquad 0

The shaded interval is $[-\sqrt y,\sqrt y]$ in the original $x$-space.

Interactive 2

One-to-one transformation: $Y=aX+b$

Let $X\sim \text{Uniform}(0,1)$ and $Y=aX+b$, where $a>0$. Then $Y$ is uniform on $(b,a+b)$ with density $1/a$.

$$x=g^{-1}(y)=\frac{y-b}{a},\qquad \left|\frac{dx}{dy}\right|=\frac1a.$$
Interactive 3

Many-to-one formula: two inverse branches

When $g$ is not one-to-one, split the support into intervals where $g$ is monotone and add all contributions.

$$\boxed{f_Y(y)=\sum_i f_X(x_i(y))\left|\frac{dx_i}{dy}\right|},\qquad g(x_i(y))=y.$$
BranchInverseContribution
Interactive 4

Probability integral transform

If $X$ is continuous with CDF $F_X$, then $U=F_X(X)\sim \text{Uniform}(0,1)$. For the density $f_X(x)=\frac{x-1}{2}$ on $1

After transformation, the histogram should become nearly flat on $(0,1)$.

Interactive 5

Jacobian method for two variables

For a transformation $(U,V)=T(X,Y)$, use the inverse map $(X,Y)=T^{-1}(U,V)$:

$$f_{U,V}(u,v)=f_{X,Y}(x(u,v),y(u,v))\left|\det\frac{\partial(x,y)}{\partial(u,v)}\right|.$$

Example: sum and difference

If $U=X+Y$ and $V=X-Y$, then $$x=\frac{u+v}{2},\qquad y=\frac{u-v}{2},\qquad \left|\det\frac{\partial(x,y)}{\partial(u,v)}\right|=\frac12.$$

For independent normal variables with equal variance, this factorization shows $U$ and $V$ are independent.

Jacobian calculator

For linear map $u=ax+by$, $v=cx+dy$, the inverse Jacobian factor is $1/|ad-bc|$.

Interactive 6

Transformation can create a mixed distribution

Let $T\sim \text{Exponential}(\theta=1.5)$ and define $$V=\begin{cases}5,&T<3,\\2T,&T\ge 3.\end{cases}$$ Then $V$ has a point mass at $5$ and a continuous density for $v\ge6$.

$$P(V=5)=1-e^{-2},\qquad f_V(v)=\frac13e^{-v/3},\ v\ge6.$$
Self-check

Quick practice questions

1. Why is $Y=X^2$ not one-to-one on $(-1,1)$?

Because $x$ and $-x$ produce the same value $x^2$. For example, $0.4^2=(-0.4)^2$.

2. What is the most common mistake with $Y=X^2$?

Using only one inverse branch, such as $x=\sqrt y$, and forgetting $x=-\sqrt y$.

3. What does the absolute value in the Jacobian do?

It measures local stretching or shrinking of area/volume, and it must be positive for density.

4. Why does $F_X(X)$ become uniform?

Because $P(F_X(X)\le u)=P(X\le F_X^{-1}(u))=u$ for $0