Simple change of variables question

41 Views Asked by At

I'm reading this book Bayesian Data Analysis from Gelman and on page 52 he makes a change of variables:

This is a very basic calculus question, but I'm a little rusty, someone could reminds me why this is true or show me a good resource to find the prove of this?

2

There are 2 best solutions below

0
On BEST ANSWER

It is the simple way to get a $1\rightarrow1$ transformation when the transformation function is monotonic.

Let $X\sim f_X(x)$ and $Y=g(X)$ with $g$ continuous and increasing (better, not decreasing)

Thus

$$F_Y(y)=P(Y\leq y)=P(g(X) \leq y)=P(X\leq g^{-1}(y))=F_X(g^{-1}(y))$$

derivating you get

$$f_Y(y)=f_X(g^{-1}(y))\cdot \frac{d}{dy}g^{-1}(y)$$

your statement is the same as the one I showed you; you can write

$$f_Y(y)=f_X(g^{-1}(y))\left|\frac{dx}{dy}\right|$$

or

$$f_Y(y)=f_X(x)\left|\frac{1}{\frac{dy}{dx}}\right|$$

...as you prefer.

the absolute value is due to the fact that if you take $g$ monotonic but decreasing the result is the same...


Example:

$$f_X(x)=3x^2$$

$x \in(0;1)$

$$Y=-\log X$$

thus

$x=e^{-y}$; $|x'|=e^{-y}$

and

$$f_Y(y)=3 e^{-2y}e^{-y}=3 e^{-3y}$$

that is $Y\sim \exp(3)$

0
On

The notation are a bit confusing (although they do say they talk about densities so Ok) since we have $p(\phi) = p\circ h (\theta) $ which if we want to distinguish from $p$ we should write $\tilde{p}(\theta)$. No factor $\left|\frac{d\theta}{d\phi} \right|$.

Let now $\Phi$ be a primitive of $p$, one has $$\int_{\phi_1}^{\phi_2} p(\phi)\, d\phi =\Phi(\phi_2)-\Phi(\phi_1) = \Phi\circ h (\theta_2)-\Phi\circ h(\theta_1) $$ for appropriate pre-images $\theta_1,\ \theta_2$ assuming that $h$ does reach $\phi_i$ (usually one requires $h$ to be a $\mathcal{C}^1$ diffeomorphism). By Leibniz's rule $$ (\Phi\circ h)'(\theta)= h'(\theta)\times \Phi'\circ h(\theta) = h'(\theta)\times \tilde{p}(\theta)$$ So again by the fundamental theorem of calculus $$ \int_{\theta_1}^{\theta_2} h'(\theta)\times \tilde{p}(\theta)\, d\theta= \Phi\circ h (\theta_2)-\Phi\circ h(\theta_1) $$

It is a routine check that one can decide to always integrate from the smallest $\theta_i$ to the largest, but take the absolute value of $h'$. (if one had integrated from the smaller $\phi_i$ to the largest)