Random Variable Transformation

Table of contents
  1. Defining Random Variable Transformation
  2. Discrete Random Variable Transformation
  3. Continuous Random Variable Transformation
  4. Multivariate Transformation
  5. Expectation of Transformed Random Variable
    1. The Law of the Unconscious Statistician (LOTUS)
      1. Univariate Case
      2. Multivariate Case

Defining Random Variable Transformation

Let $X$ be a random variable.

Let $Y = r(X)$ be a function of $X$ (e.g. $Y = X^2$).

Then $Y$ is a random variable transformation of $X$.


Discrete Random Variable Transformation

Let $X$ be a discrete random variable with probability mass function $p_X(x)$.

Then the mass function of $Y = r(X)$ is:

$$ p_Y(y) = P(Y = y) = P(r(X) = y) = P(X \in r^{-1}(y)) = \sum_{x \in r^{-1}(y)} p_X(x) $$

So it really boils down to solving for $r^{-1}(y)$.


Continuous Random Variable Transformation

For continuous random variables, in order to find the probability density function (PDF) $f_Y(y)$, we first solve for the cumulative distribution function (CDF) $F_Y(y)$, and then take the derivative.

To do that, we first find the set:

$$ A_y = \{ x \mid r(x) \leq y \} $$

Then find the CDF:

$$ F_Y(y) = P(Y \leq y) = P(r(X) \leq y) = P(X \in A_y) = \int_{A_y} f_X(x) dx $$

Then take the derivative:

$$ f_Y(y) = \frac{d}{dy} F_Y(y) $$


Multivariate Transformation

Examples of multivariate transformation would be:

  • $Z = X + Y$
  • $Z = \min(X, Y)$
  • etc.

The general idea is the same as the univariate case.

For $Z = r(X, Y)$, we first find the set:

$$ A_z = \{ (x, y) \mid r(x, y) \leq z \} $$

Then find the CDF:

$$ F_Z(z) = P(Z \leq z) = P(r(X, Y) \leq z) = P((X, Y) \in A_z)= \int \int_{A_z} f_{X, Y}(x, y) dx dy $$

Then take the derivative:

$$ f_Z(z) = \frac{d}{dz} F_Z(z) $$


Expectation of Transformed Random Variable

The Law of the Unconscious Statistician (LOTUS)

Univariate Case

When $Y = r(X)$:

$$ \E(Y) = \E(r(X)) = \int r(x) p_X(x) $$

Multivariate Case

When $Z = r(X, Y)$:

$$ \E(Z) = \E(r(X, Y)) = \int \int r(x, y) dF_{X, Y}(x, y) $$