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=h1(Y), then the pdf of Y is

fy(y)=fX(h1(y))|h1(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(h11(y))|dh11(y)dy|+fx(h21(y))||dh21(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)dyn2dyn1dyn

Examples

X1,X2Exponential

Y1=X1+X2,X1=Y2Y2=X1,X2=Y1Y2

As both random variables are independent:

fX1,X2(x1,x2)=1βex1/β1βex2/βfX1,X2(x1,x2)=1β2e(x1+x2)/β

Jacobian:

|J|=det[X1Y1X1Y2X2Y1X2Y2]=det[0111]=|1|=1

Joint pdf of Y1,Y2:

fY1,Y2(y1,y2)=fX1,X2(Y2,Y1Y2)1=1β2e(y2+y1y2)/β=1β2ey1/β0y2y1

Marginalizing:

fY1(y)=0y11β2ey1/βdy2=1β2ey1/β0y11dy2fY1(y)=1β2y1ey1/β,y10

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

Finding the pdf of a cdf

Y=g(x)=FX(x)0FX(x)1,0y1X=h1(Y)dxdy=1dydx=1dFX(x)dx=1fX(x)=dh1(y)dyfY(y)=fX(h1(y))|dh1(y)dy|=1,Y=FX(x)unif[0,1]

The cdf for any pdf follows a Uniform Distribution