The joint probability density function of a multivariate random variableX=(X1,⋯,Xn), given by f, is assumed to be as follows:
y1=u1(x1,⋯,xn)⋮yn=un(x1,⋯,xn)
Consider the following transformation u1,⋯,un, which might not be injective. Thus, the support X of SX is divided into kpartitionsA1,⋯,Ai,⋯,Ak, and the following inverse transformations wji∣i=1,⋯,kj=1,⋯,n could be considered:
x1=w1i(y1,⋯,yn)⋮xn=wni(y1,⋯,yn)
Due to such transformation
Y1=u1(X1,⋯,Xn)⋮Yn=un(X1,⋯,Xn)
the joint probability density function g of the transformed multivariate random variable Y=(Y1,⋯,Yn) is as follows:
g(y1,⋯,yn)=i=1∑kf[w1i(y1,⋯,yn),⋯,wni(y1,⋯,yn)]∣Ji∣
Ji is the i=1,⋯,k-th JacobianJi:=∂y1∂w1i⋮∂y1∂wni⋯⋱⋯∂yn∂w1i⋮∂yn∂wni.
As a caution, it’s unnecessary to calculate the Jacobian for discrete random variables. It’s a basic mistake yet surprisingly common misconception.
Examples
The transformation of random variables is not only seemingly difficult but also requires honest and complex calculations. For transformations that are not injective, it’s necessary to calculate the Jacobian for each case separately, and how challenging this can be varies by problem. To get a sense of this difficulty, consider the following example:
f(x1,x2)={π10,0<x12+x22<1,otherwise
A random variable with the following probability density function samples points inside a circle uniformly. Naturally, one would transform orthogonal coordinates to polar coordinates, but to facilitate understanding, let’s consider an artificial transformation Y1=X12+X22, Y2=X12/(X12+X22). Since the equation includes squaring, this transformation isn’t injective, and one needs to consider the following four scenarios:
x1=y1y2∧x2=y1(1−y2)x1=y1y2∧x2=−y1(1−y2)x1=−y1y2∧x2=y1(1−y2)x1=−y1y2∧x2=−y1(1−y2)
The i=1,2,3,4-th Jacobian for each is calculated as follows:
J1=21y1y221y11−y221y2y1−211−y2y1=−4y2(1−y2)1
J4=−21y1y2−21y11−y2−21y2y1211−y2y1=4y2(1−y2)1
Therefore, the new joint probability density function g obtained through y1,y2 is as follows:
g(y1,y2)=i=1∑4π1±4y2(1−y2)1=πy2(1−y2)1
If these calculations seem nauseating, that’s normal.