## Some RV transformations and their densities

Given a random variable (RV) $X\sim p_X$ and a function $f$ whose inverse $f^{-1}$ is differentiable, we know that the pdf of the random variable $Y = f(X)$ is given by

$$ p_Y(y) = \left\lvert\dfrac{\partial }{\partial y} f^{-1}\right\rvert \, p_X \circ f^{-1} (y) $$

This post reviews some applications of this formula.

### Scaling and Shifting

Suppose you have a scalars $\sigma > 0$ and $\mu \neq 0$. You may want to know the pdf of the shifted variable $X + \mu$ or the scaled variable $\sigma X$. Applying the formula yields that $X+\mu$ is distributed as $p_X(x – \mu)$ and $\sigma X$ as $p_X(x/\sigma)/\sigma$. Therefore, the normalisation $Y = (X – \mu)/\sigma$ yields a pdf of $p_Y(y) = \sigma p_X(\sigma y+\sigma\mu)$.

### Reciprocal

Assuming that $X$ is strictly positive, what is the pdf of $1/X$ ? By applying our formula, one finds that $$ Y = X^{-1} \sim p_Y(y) = y^{-2}\,p_X(y^{-1}) $$

### Logarithm

Suppose that $X \geq 0$, so that $\log X$ is defined. The pdf of this new variable is then $p_Y(y) = \exp(y)\,p_X(\exp(y))$

### Exponentiation

Suppose that $X \geq 0$, so that for a scalar $\gamma > 0$ the variable $X^\gamma$ is defined. The pdf of $Y = X^\gamma$ is then $$p_Y(y) = y^{\frac{1 – \gamma}{\gamma}}\,p_X(y^{1/\gamma}). $$