Change-of-variables formula for a probability density (source code)

= Change-of-variables formula for a probability density

= Change-of-variables formula for probability densities
{synonym}

Let a <random vector> $X$ have <probability density function> $f_X$ on an open set $U\subseteq\mathbb R^d$. If $g:U\to V$ is a continuously differentiable <diffeomorphism> onto an open set $V$, with nonsingular <Jacobian matrix>, then $Y=g(X)$ has <probability density function>
$$
f_Y(y)=f_X(g^{-1}(y))\left|\det Dg^{-1}(y)\right|\qquad(y\in V),
$$
and zero off $V$. A <diffeomorphism> includes differentiability of the inverse; a merely differentiable bijection is not the full hypothesis needed for this <probability density function>[density] formula. The determinant corrects local <volume>, and its absolute value accounts for an orientation reversal.

Indeed, for a <Borel set> $A\subseteq V$, apply the <change of variables formula> to $\mathbb P(Y\in A)=\int_{g^{-1}(A)}f_X(x)\,dx$. The resulting <integral> over $A$ identifies the <probability density function>.

For example, if $X$ has an <exponential distribution> of rate $\lambda>0$ and $Y=X^2$, use the <diffeomorphism> $(0,\infty)\to(0,\infty)$. It gives $f_Y(y)=\lambda e^{-\lambda\sqrt y}/(2\sqrt y)$ for $y>0$. Its <integrable> singularity at zero does not create a point mass. A map with several inverse branches requires summing their <probability density function>[density] contributions rather than choosing a single inverse.