Transforming Random Variables Explained
Transforming Random Variables Explained
For discrete random variables, the probability mass function (PMF) of a transformed variable Y = g(X) is determined by summing the probabilities of all original variable values X that map to the same Y. In the continuous case, the probability distributions of transformed random variables are often found using the cumulative distribution function (CDF) or the probability density function (PDF) and involve calculus, such as the 'change of variables' method. Specifically, continuous transformations require consideration of the monotonicity of g(X) and the derivative of the inverse transformation to properly compute the PDF of Y .
For non-monotone transformations, deriving the probability density function (PDF) involves accounting for all branches of the inverse function that map to a given value of the transformed variable. Specifically, one must identify multiple x-values where g(x)=y, and sum these contributions to the PDF. For example, if X is a continuous variable and Y = X², each positive y has two corresponding x-values (+√y and -√y). Hence, the PDF is calculated as the sum of the contributions from all inverse branches, such as fY(y) = fX(√y) / 2√y + fX(-√y) / 2√y for a variable like X², ensuring to capture all the different values X takes to reach the same Y .
The Jacobian matrix plays a crucial role when transforming multivariate distributions, especially in higher dimensions. For a transformation Y = g(X) involving multiple dimensions, the joint PDF of the transformed variables is calculated using the determinant of the Jacobian matrix (det(J)) of the partial derivatives of the inverse transformation x = g−1(y). The matrix accounts for the rate and direction of change in all variables, ensuring the transformed distribution correctly reflects how probability mass is transferred from the original variables to the new ones. This is vital for accurately determining the density function of transformed multivariate random variables .
For Y = ln(X) when X is exponentially distributed with parameter λ, the PDF fY(y) is found using the inverse transformation x = e^y. Applying the change of variables formula, the derivative dx/dy = e^y is utilized along with fX(x) = λe^{-λx}. Hence, fY(y) = fX(e^y) * e^y = λe^{-λe^y} * e^y, simplifying to fY(y) = λe^y - λe^2y for y in the range defined by the exponential distribution .
Standardizing a normally distributed variable involves converting X ~ N(µ, σ²) to Y = (X - µ) / σ. Since normal distributions are affine transformations, this transformation shifts the mean to zero and scales the variance to one. The CDF of Y matches the standard normal CDF, indicating that subtraction of the mean followed by division by the standard deviation transforms the original normal distribution into a standard normal distribution N(0, 1).
Variable transformations are necessary because they allow for simplification of models, derivation of new quantities from basic measurements, and enable more convenient manipulation of functions. In data analysis and theoretical work, transformations can result in a simpler or more familiar distribution, making it easier to conduct analysis or infer properties. For example, if X is exponentially distributed and we set Y = ln(X), the transformation might yield a simpler form. Therefore, understanding the distribution of Y = g(X) based on the distribution of X is crucial in these contexts .
To apply the change of variables formula for a continuous random variable Y = g(X), one assumes that g is differentiable and strictly monotone, ensuring a well-defined inverse g−1. The PDF of Y is determined as fY(y) = fX(g−1(y)) * |d/dy(g−1(y))|. This formula accounts for how the transformation affects probabilities through the derivative of the inverse, ensuring the transformed variable's PDF remains non-negative. By substituting the inverse and its derivative into the formula, the distribution of Y can be effectively calculated .
With X uniformly distributed over (0, 1), the transformation Y = -ln(X) leads to an exponential distribution for Y. Using the inverse x = e^{-y} and the uniform PDF fX(x) = 1 for x in [0, 1], the derivative dx/dy = -e^{-y} is applied in the change of variables formula. Thus, fY(y) = fX(e^{-y})|-e^{-y}|, which evaluates to e^{-y} for the range y ≥ 0, indicating that Y follows an exponential distribution with λ = 1 .
For Y = X² with X being a standard normal distribution, the PDF involves using both inverse functions x = √y and x = -√y due to the symmetry of the normal distribution about zero. The PDF fX(x) is used for both inverses and summed: fY(y) = fX(√y) / 2√y + fX(-√y) / 2√y. Focusing on fX(x) = 1/√(2π)e^{-x²/2}, this yields the expression fY(y) = 2(1/√2πy)e^{-y/2} for y ≥ 0, representing a chi-squared distribution with one degree of freedom .