16 Joint Distribution of Functions of Random Variables
Let \(X_1\) and \(X_2\) be jointly continuous random variables with joint probability density function \(f(x_1,x_2)\). Suppose that \(Y_1 = g_1(X_1, X_2)\) and \(Y_2 = g_2(X_1, X_2)\) for some functions \(g_1\) and \(g_2\).
Assume that the functions \(g_1\) and \(g_2\) satisfy the following conditions: * \(g_1\) and \(g_2\) are injective (one to one), i.e. the equations \(y_1 = g_1(x_1, x_2)\) and \(y_2 = g_2(x_1, x_2)\) can be uniquely solved for \(x_1\) and \(x_2\) in terms of \(y_1\) and \(y_2\) with solutions given by, say, \(x_1 = h_1(y_1, y_2)\) and \(x_2 = h_2(y_1, y_2)\). * The functions \(g_1\) and \(g_2\) have continuous partial derivatives at all points \((x_1, x_2)\) and are such that the following 2 × 2 determinant \[\det J_{(g_1, g_2)} = \begin{vmatrix}\frac{\partial g_1}{\partial x_1} & \frac{\partial g_1}{\partial x_2} \\ \frac{\partial g_1}{\partial x_2} & \frac{\partial g_2}{\partial x_2}\end{vmatrix} \ne 0\] at all points \((x_1, x_2)\), i.e. non-vanishing Jacobian.
Under these two conditions it can be shown that the random variables \(Y_1\) and \(Y_2\) are jointly continuous with joint density function given by \[f_{Y_1, Y_2}(y_1, y_2) = f(x_1,x_2)|\det J_{(g_1,g_2)}|^{-1}\] where \(x_1 = h_1(y_1, y_2)\) and \(x_2 = h_2(y_1, y_2)\).
Expanding the above to a general \(\mathbb R^n\)-valued random variable, we obtain:
Proposition: Let \(X = (X_1,...,X_n)\) have joint density \(f\). Let \(g:\mathbb R^n \to \mathbb R^n\) be continuously differentiable and injective, with non-vanishing Jacobian. Then \(Y = g(X)\) has density \[f_{Y}(y) = f_X(g^{-1}(y))|\det J_{g^{-1}}(x)|\]
Corollary: Let \(S \in B_n\) be partitioned into disjoint subsets \(S_0, S_1, ..., S_m\) such that \(\bigcup_{i=0}^m S_m = S\), and such that \(m_n(S_0)=0\) and that for each \(i=1,...,m\), \(g: S_i \to \mathbb R^n\) is injective (one to one) and continuously differentiable with non-vanishing Jacobian. Let \(Y = g(X)\), where \(X\) is an \(\mathbb R^n\)-valued r.v. with values in \(S\) and with density \(f_X\) . Then \(Y\) has a density given by \[f_Y(y) = \sum_{i=1}^m f_X(g^{-1}(y))|\det J_{g^{-1}}(y)|\]
Example: Let \(X,Y\) be independent normal r.v.’s, each with parameters \(\mu = 0, \sigma^2 = 1\), i.e. \(f(x) = \frac{1}{\sqrt{2\pi}}e^{-x^2/2}\). Let us calculate the joint distribution of \((U, V) = (X + Y, X - Y)\). Here \[g(x, y) = (x + y, x − y) = (u, v)\] and \[h(u,v)= \bigg(\frac{u+v}{2}, \frac{u-v}{2}\bigg)\]
The Jacobian in this simple case does not depend on \((u, v)\), and is \[J_{h}(u,v) = \begin{pmatrix}\frac{1}{2} & \frac{1}{2} \\ \frac{1}{2} & \frac{-1}{2}\end{pmatrix}\] and \(|\det J_h| = |\frac{-1}{2}| = \frac{1}{2}\). Therefore, \[\begin{align} f_{(U,V)}(u,v) &= f_{(X,Y)}(\frac{u+v}{2}, \frac{u-v}{2}) |\det J_h| \\ &= f_X(\frac{u+v}{2})f_Y(\frac{u-v}{2})\frac{1}{2} \\ &= \frac{1}{\sqrt{4\pi}}e^{-u^2/2}\frac{1}{\sqrt{4\pi}}e^{-v^2/2}\end{align}\] We conclude that \(U, V\) are also independent normals, each with parameters \(\mu = 0\) and \(\sigma^2 = 2\).