7

When we have a random variable $x$ with a probability density $p(x)$, and a function $y = f(x)$ that is differentiable and can be solved for $x = g(y)$, the change of variable formula leads us to a density for $y$ given by

$$ p(x) \, dx = p(x) \left| g'(y) \right| \, dy = p(x) \left| \frac{1}{f'(x)} \right| \, dy = p(x) \left| \frac{dx}{dy} \right| \, dy $$ where $\frac{dx}{dy}$ is called (to my knowledge even in the univariate case) the Jacobian of the transformation (as in Zill & Wright, p. 792). In general this would be a determinant of a Jacobian matrix $\mathbf{J}(\mathbf{g}(\mathbf{y}))$, obviously. But I never understood why does it enter in absolute value? I have read somewhere that it's because $f(x)$ could have a negative derivative whereas probabilities are confined to be positive, but that sounds more like a post-hoc justification than a mathematical result. Is there a way to derive this fact?

Durden
  • 860
  • 10
  • 12
  • See [Wikipedia on the Radon-Nikodym Theorem](https://en.wikipedia.org/wiki/Radon–Nikodym_theorem). – whuber Jun 10 '19 at 15:28
  • 1
    See also a [similar question on Math.SE](https://math.stackexchange.com/questions/856654/why-absolute-values-of-jacobians-in-change-of-variables-for-multiple-integrals-b) – husB Apr 08 '20 at 05:05

1 Answers1

6

For a specific example, in addition to @whuber's advice, let $y=f(x)=-2x$, and $x=g(y)=-y/2$; and $x \in [0,1]$, i.e. the support. Then, $y$ would be in the range $[-2,0]$. Also, we have $g'(y)=-1/2, f'(x)=-2$.

Normally, you'd take the integral $\int p(g(y))\left|\frac{dx}{dy}\right|dy$ from $-2$ to $0$, while using the formula. However, it actually is from $0$ to $-2$, since $x$ and $y$ directions differ, i.e. $$\int_{0}^{-2} p(g(y))\frac{dx}{dy}dy=\int_{-2}^{0} p(g(y))\left(-\frac{dx}{dy}\right)dy=\int_{-2}^{0} p(g(y))\left|\frac{dx}{dy}\right|dy$$

The use of absolute value removes the need of considering the inverse directions (i.e. negative directions of $x$ and $y$ which is reflected by negative derivatives).

Sycorax
  • 76,417
  • 20
  • 189
  • 313
gunes
  • 49,700
  • 3
  • 39
  • 75