---
title: "Transformation of random variables"
author:
  - name: "Fan Wang"
    affiliation: "Department of Economics, University of Houston"
    url: "https://fanwangecon.github.io/"
date: "2026-11-30"
---

**Part of [Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics](https://fanwangecon.github.io/Stam4Econ/).**  
[Main Stam4Econ site](https://fanwangecon.github.io/Stam4Econ/) | [View this section in the book](https://fanwangecon.github.io/Stam4Econ/stats_random_variable/overview.html#transformation-of-random-variables) | [Author: Fan Wang](https://fanwangecon.github.io/) | [DOI: 10.5281/zenodo.24696926](https://doi.org/10.5281/zenodo.24696926)  
Date: 2026-11-30 | [HTML](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/stats_random_variable/transformation.html) | [PDF](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/stats_random_variable/transformation.pdf) | [QMD](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/stats_random_variable/transformation.qmd)

## Transformation of random variables

### Mean shift

Given a random variable $X$ with cumulative distribution function $F_X(x)$, we can define a new random variable $Y = g(X)$, where $g$ is some function. 

When $g(X) = X + \delta$, the cumulative distribution function of $Y$ is:

$$
F_Y(y) = P(Y \leq y) = P(X + \delta \leq y) = P(X \leq y - \delta) = F_X(y - \delta)
$$

### Rescaling the random variable

When $g(X) = aX$, where $a > 0$, the cumulative distribution function of $Y$ is:

$$
F_Y(y) = P(Y \leq y) = P(aX \leq y) = P\left(X \leq \frac{y}{a}\right) = F_X\left(\frac{y}{a}\right)
$$

### Mean-preserving relative proportion shift

Mean preserving variance shift. Let $Y = g(X) = \mu_x + \lambda\left( X - \mu_x\right)$, where $\lambda > 0$ and $\mu_x = E(X)$. In this case, a shift in $\lambda$ changes the relative distance of all data below and above the mean by the same rate, and keeps the mean unchanged. Specifically, the mean of $Y$ is:

$$
E(Y) = E(g(X)) = E\left(\mu_x + \lambda(X - \mu_x)\right) = \mu_x + \lambda(E(X) - \mu_x) = \mu_x
$$

The cumulative distribution function of $Y$ is:

$$
F_Y(y) = P(Y \leq y) = P\left(\mu_x + \lambda(X - \mu_x) \leq y\right) = P\left(X \leq \frac{y - \mu_x}{\lambda} + \mu_x\right) = F_X\left(\frac{y - \mu_x}{\lambda} + \mu_x\right)
$$

The variance of $Y$ is:

$$
Var(Y) = Var(g(X)) = Var\left(\mu_x + \lambda(X - \mu_x)\right) = \lambda^2 Var(X)
$$
