5

$ \def\dee{\mathop{\mathrm{d}\!}} \def\Jac#1{\mathop{\mathbf{J}_{#1}}} $

I'm confused about how to use the change of variable formula to describe the density of a pushforward measure. My question boils down to: which of the two formulae, (1) and (2) below, is the correct one?

Let $X$ be a real-valued random variable with density $\rho_X$ wrt the Lebesgue measure and let $Y=f(X)$ be another random variable, where $f$ is a deterministic invertible transformation. What is the probability density function of $Y$? [Just to be clear, the connection with the push-forward is: Denote by $P_X$ the law of $X$. Then the law of $Y$ is $P_Y = P_X \circ f^{-1} = {({P_X})}_\sharp f$, the push-forward of $P_X$ by $f$.]

For any measurable set $E$ of outcomes for $Y$, the probability measure of that set is

$$ \begin{align} P_Y(E) = P_X(f^{-1}(E)) &= \int_{f^{-1}(E)} \rho_X(x) \dee x\\ &= \int_{E} \rho_X(f^{-1}(y)) \left|\frac{\dee}{\dee y}f^{-1}(y)\right|\dee y \end{align} $$

(using the change of variables formula for integration by substitution) so the density of $Y$ is

$$ \rho_Y(y) = \rho_X(f^{-1}(y)) \left|\frac{\dee}{\dee y}f^{-1}(y)\right| $$

The derivative in this expression generalizes to the Jacobian determinant in multivariate case (when $f$ is a diffeomorphism, I gather), giving the following formula for the density (see, e.g. this math.SE answer)

$$ \tag{1} \rho_Y(y) = \rho_X(f^{-1}(y)) \left|\det\Jac{f^{-1}}(y)\right| $$

However, a few sources (for example, Betancourt's notes see section 4.2, and some implementations, like here)* give a similar expression but with the reciprocal of the Jacobian determinant, as

$$ \tag{2} \rho_Y(y) = \rho_X(f^{-1}(y)) \frac1{\left|\det\Jac{f^{-1}}(y)\right|} $$

It can't be the case that (1) and (2) both hold in general! Is (2) just a typo, or have I misunderstood the notation they use?

I know that $(\frac{\dee}{\dee x}{f}(x))^{-1}=\frac{\dee}{\dee y}{f^{-1}}(y)$ (by the inverse function theorem). This generalizes to $(\Jac{f}(x))^{-1}=\Jac{f^{-1}}(y)$. So, I think the correct version of (2) would be ($2^\star$):

$$ \tag{2$^\star$} \rho_Y(y) = \rho_X(f^{-1}(y)) \frac1{\left|\det\Jac{f}(x)\right|}\\ = \rho_X(x) \frac1{\left|\det\Jac{f}(x)\right|} $$

or, in the simpler one-dimensional case,

$$ \displaystyle \rho_Y(y) = \rho_X(f^{-1}(y)) \frac1{\left|\frac{\dee}{\dee x}{f}(x)\right|} \\ = \rho_X(x) \frac1{\left|\frac{\dee}{\dee x}{f}(x)\right|} $$

But I don't know why you would write it that way (since you want an expression where $y$ is the variable, not $x$), instead of the way in $(1)$.

Have I just made a silly mistake reading the notations? Is $(2)$ somehow correct?


*EDIT: I think I may be interpreting Betancourt's notation wrong. I now think any sources for $(2)$ are either based on a misunderstanding or a typo.

postylem
  • 350

1 Answers1

4

For simplicity lets assume $f:\mathbb R\to\mathbb R$ is differentiable and bijective and denote its inverse function by $g\,.$ Then $$\tag{1} f'(x)=\frac{1}{g'(f(x))} $$ and, by ordinary change of variables from elementary calculus, $\def\dee{\mathop{\mathrm{d}\!}}$ \begin{align} P_Y(E) &= P_X(f^{-1}(E)) = \int_{f^{-1}(E)} \rho_X(x) \dee x=\int_{g(E)} \rho_X(x)\frac{f'(x)}{f'(x)} \dee x\tag{2}\\ &=\int_{g(E)}\rho_X\big(g(f(x))\big)\frac{f'(x)}{f'(x)}\dee x =\int_{g(E)}\rho_X\big(g(y)\big)\frac{1}{f'(x)}\dee y\tag{3}\\ &= \int_{E} \rho_X\big(g(y)\big)\,g'(y)\dee y\,.\tag{4} \end{align} In other words, when the density of $X$ is $\rho_X(x)$ then the density of $Y=f(X)$ is $$\tag{5} \rho_X\big(g(y)\big)\,g'(y)=\rho_X(f^{-1}(y))\frac1{f'(f^{-1}(y))}\,. $$ One-line proof of (1). From $g(f(x))=x$ it follows by differentiation from the chain rule that $$\tag{6} g'(f(x))f'(x)=1\,. $$ QED

Kurt G.
  • 17,136
  • 1
    I used the inverse function theorem. Please describe the equations you are asking about more clearly (comments support Mathjax). I also believe that looking at the case $f:\mathbb R\to\mathbb R$ from first principles will allow to get to the very bottom of your question without looking at any reference. I would not take an interest in this question if I had not the same type of riddle every now and then. – Kurt G. Feb 20 '23 at 15:15
  • Okay, now I am quite convinced that the correct version is my first one: $\rho_Y(y)=\rho_X(f^{-1}(y))\left|\frac{d}{dy}f^{-1}(y)\right|$. – postylem Feb 21 '23 at 00:34
  • Absolutely. I had exactly that error in (3) which I now corrected. Thanks! – Kurt G. Feb 21 '23 at 17:22
  • In Betancourt's notes I only see \begin{align} \pi_{*} (y) &= \pi(g^{-1}(y)) |J(g^{-1}(x))|^{-1} \ &= \pi(g^{-1}(y)) \left| \frac{ \partial g}{\partial x} (g^{-1}(y)) \right|^{-1}. \end{align} The line with the Jacobian of $g^{-1}$ drives me nuts. His next line seems OK though. His $g$ is my $f$. – Kurt G. Feb 21 '23 at 18:15
  • Yes, it was that first line that my question was motivated by--it's that that I was trying to understand. But I think it just has a typo. – postylem Feb 21 '23 at 22:27
  • Lets rather just clean up that comment section here by deleting most of them. We can restart the discussion when a really serious problem comes up. typos in maths are ubiquitous. – Kurt G. Feb 22 '23 at 06:28