Transformation technique

Let Y=h(X)

Bijective transformation

If h(x) is differentiable at all values of x and is either a decreasing/increasing function such that there is a unique inverse function X=h−1(Y), then the pdf of Y is

fy(y)=fX(h−1(y))⋅|∂h−1(y)∂y|

if ∂h(x)∂x=0,fY(y)=0

Non-bijective transformation

If the transformation is not one-to-one, for example Y=X2, we can divide the domain of the random variable X into multiple non-overlapping regions. Then we find the pdf of Y in each of the regions

fY(y)=fX(h1−1(y))|dh1−1(y)dy|+fx(h2−1(y))||dh2−1(y)dy|

Multivariable (joint) distributions

Suppose X1,…,Xn is a set of continuous random variables with joint pdf fX1,…,Xn(x1,…,xn) and let Y1=h1(X1,…,Xn), Y2=h2(X1,…,Xn),… Yn=hn(X1,…,Xn) be another set of random variables.

If the hi functions are differentiable with respect to each of X1,…,Xn and and are one-to-one correspondent within the range of X1,…,Xn for which fX1,…,Xn(x1,…,xn)≠0, then the joint pdf of Y1,…,Yn is given by

fY1,...,Yn(y1,...,yn)=fX1,...,Xn(g1(y1,...,yn),...,gn(y1,...,yn))⋅|J|

where the gi functions are the inverse transformations

If we have less transformations (Y) than random variables (X), we create new pointless transformations to ensure the Jacobian is a square matrix.
Then we can remove the leftover transformations from the pdf by integrating its marginal.

fY1,…,Yr(y1,…,yr)=∫∫∫fY1,…,Yr,…Yn(y1,…,yr,…,yn)dyn−2dyn−1dyn

Examples

X1,X2∼Exponential

Y1=X1+X2,X1=Y2Y2=X1,X2=Y1−Y2

As both random variables are independent:

fX1,X2(x1,x2)=1βe−x1/β⋅1βe−x2/βfX1,X2(x1,x2)=1β2e−(x1+x2)/β

Jacobian:

|J|=det[∂X1∂Y1∂X1∂Y2∂X2∂Y1∂X2∂Y2]=det[011−1]=|−1|=1

Joint pdf of Y1,Y2:

fY1,Y2(y1,y2)=fX1,X2(Y2,Y1−Y2)⋅1=1β2e−(y2+y1−y2)/β=1β2e−y1/β0≤y2≤y1

Marginalizing:

fY1(y)=∫0y11β2e−y1/βdy2=1β2e−y1/β∫0y11dy2fY1(y)=1β2y1e−y1/β,y1≥0

The transformation Y1 follows a Gamma distribution with parameters α=2,β=β

Finding the pdf of a cdf

Y=g(x)=FX(x)0≤FX(x)≤1,0≤y≤1X=h−1(Y)dxdy=1dydx=1dFX(x)dx=1fX(x)=dh−1(y)dyfY(y)=fX(h−1(y))⋅|dh−1(y)dy|=1,Y=FX(x)∼unif[0,1]

The cdf for any pdf follows a Uniform Distribution