Functions of Random Vectors#
Just as a function applied to a univariate random variable results in a new random variable, applying a function to a random vector yields a new random variable (or vector).
Let \(\mathbf{X} \in \mathbb{R}^n\) be a random vector, and let \(f : \mathbb{R}^n \to \mathbb{R}^m\) be a measurable function.
Then the composition
defines a new random vector \(\mathbf{Y} \in \mathbb{R}^m\).
Scalar-Valued Functions#
If \(f : \mathbb{R}^n \to \mathbb{R}\), then \(Y = f(\mathbf{X})\) is a scalar random variable.
Example: Sum of Dice Rolls#
Let \(\mathbf{X} = \begin{bmatrix} X_1 \\ X_2 \end{bmatrix}\), where \(X_1, X_2\) are the results of rolling two fair six-sided dice.
Each component has values in \(\{1, 2, 3, 4, 5, 6\}\).
Define a new random variable:
Then \(Y\) is a random variable whose possible values are \(\{2, 3, \dots, 12\}\), and the distribution of \(Y\) can be computed by counting all combinations \((x_1, x_2)\) such that \(x_1 + x_2 = y\).
For example:
\(\mathbb{P}(Y=2) = \mathbb{P}(X_1=1, X_2=1) = \frac{1}{36}\)
\(\mathbb{P}(Y=7) = \frac{6}{36}\)
\(\mathbb{P}(Y=12) = \frac{1}{36}\)
So even though \(Y\) is not a component of \(\mathbf{X}\), it is still a random variable induced by a function of \(\mathbf{X}\).
Vector-Valued Functions#
If \(f : \mathbb{R}^n \to \mathbb{R}^m\), then \(f(\mathbf{X})\) is a random vector in \(\mathbb{R}^m\).
This is especially useful when modeling nonlinear transformations of multivariate data.
Example: Vector-Valued Transformation#
Let \(\mathbf{X} = \begin{bmatrix} X_1 \\ X_2 \end{bmatrix}\), where \(X_1\) and \(X_2\) are independent random variables uniformly distributed on \([0,1]\).
Define a function:
Then \(\mathbf{Y} = f(\mathbf{X})\) is a random vector in \(\mathbb{R}^2\), whose first component is the sum of \(X_1\) and \(X_2\), and whose second component is the product.
The distribution of \(\mathbf{Y}\) is induced by pushing forward the joint distribution of \((X_1, X_2)\) through \(f\).
Change of Variables (Jacobian Rule)#
If \(f : \mathbb{R}^n \to \mathbb{R}^n\) is invertible and differentiable, then the distribution of \(\mathbf{Y} = f(\mathbf{X})\) can be computed using the Jacobian determinant:
or equivalently, using the Jacobian of \(f\):
Let’s compute the distribution of \(\mathbf{Y} = f(\mathbf{X}) = \begin{bmatrix} X_1 + X_2 \\ X_1 \cdot X_2 \end{bmatrix}\) using the change-of-variables formula for a transformation of continuous random variables.
Step 1: Define the input distribution#
Let \(X_1, X_2 \sim \text{Uniform}[0,1]\), and independent.
Then the joint density of \(\mathbf{X} = (X_1, X_2)\) is
Step 2: Define the transformation#
Let:
We need to find the joint density \(p_{\mathbf{Y}}(y_1, y_2)\).
To do so, we must:
Express \((x_1, x_2)\) in terms of \((y_1, y_2)\)
Compute the determinant of the Jacobian of the inverse transformation
Step 3: Invert the transformation#
We solve for \(x_1, x_2\) from:
This gives the quadratic equation:
with solutions:
This only yields real values if \(y_1^2 \ge 4y_2\).
Let’s denote the roots as:
or vice versa (symmetry doesn’t matter since the Jacobian determinant will handle it).
Step 4: Jacobian determinant#
We compute the Jacobian matrix of \(f\):
So the determinant is:
We then get the change-of-variables density:
Because \(p_{\mathbf{X}}(x_1, x_2) = 1\) in the domain \([0,1]^2\), we must restrict to the region where both \(x_1, x_2 \in [0,1]\), and hence where \(y_1 \in [0,2]\), \(y_2 \in [0,1]\), and \(y_1^2 \ge 4 y_2\).
Thus, the final density is:
We can now write this entirely in terms of \(y_1\) and \(y_2\), using:
So:
The factor 2 accounts for the two symmetric roots (since \((x_1,x_2)\) and \((x_2,x_1)\) both map to the same \((y_1,y_2)\)).