Probability Density Function from Random Variable Transformation

change-of-variabledensity functionprobability distributions

The problem 2.7 from Casella & Berger asks us to find the pdf of $Y = X^2$, given $$f_X(x)=\frac{2}{9}(x+1) \quad \text{ for }-1 \le x \le 2$$

I reasoned and concluded that, assuming $Y=g(X)=X^2$, $g(\cdot)$ is monotonic over $X \in (-1, 0)$ and over $X \in (0, 2)$, given $X$ limits.

My approach is, given partitions on $X$, $A_1=(-1,0)$ and $A_2=(1,2)$, similar to Example 2.1.9, I get the following pdf (essentially applying Theorem 2.1.8):
$$f_y(Y)=\sum_{i=1}^2f_X(g_i^{-1}(y))\Bigg\lvert \frac{d}{dy}g_i^-1(y) \Bigg\rvert ,$$
assuming $g(x) = g_i(x)$ for $x \in A_i$.

I really do not see why I cannot apply Theoreom 2.1.8 given those partitions.

The solution gives conditional pdf over intervals $| x | < 1$ and $x > 1$ and I also cannot understand the disjoint results cannot be added together.

Can someone help me with this?

Best Answer

Define $g:\mathbb{R}\rightarrow\mathbb{R}$ by $g(x)=x^2$. Define $Y=g(X)$. For $y>0$ there are two points $x_1=\sqrt{y}$ and $x_2 = -\sqrt{y}$ that satisfy $g(x_1)=g(x_2)=y$. So $$ f_Y(y) = \sum_{i=1}^2 \frac{f_X(x_i)}{|g'(x_i)|} = \frac{f_X(\sqrt{y})+f_X(-\sqrt{y})}{2\sqrt{y}}\quad \forall y > 0 $$ We are given $$ f_X(x) = \left\{\begin{array}{ll} \frac{2}{9}(x+1) & \mbox{ if $-1\leq x \leq 2$} \\ 0 & \mbox{ else} \end{array}\right.$$ Thus

  • $0<y\leq 1 \implies f_X(\sqrt{y})=\frac{2}{9}(\sqrt{y}+1) , f_X(-\sqrt{y})=\frac{2}{9}(-\sqrt{y}+1)$.

  • $1<y\leq 4 \implies f_X(\sqrt{y})=\frac{2}{9}(\sqrt{y}+1) , f_X(-\sqrt{y})=0$.

  • $y>4 \implies f_X(\sqrt{y}) = 0 , f_X(-\sqrt{y})=0$.

Thus $$ f_Y(y) = \left\{\begin{array}{ll} \frac{2}{9\sqrt{y}} & \mbox{ if $0<y\leq 1$} \\ \frac{\sqrt{y} + 1}{9\sqrt{y}} & \mbox{ if $1<y\leq 4$} \\ 0 & \mbox{ else}\end{array}\right. $$ You can verify that $$ \int_0^1 \frac{2}{9\sqrt{y}} dy + \int_1^4\frac{\sqrt{y}+1}{9\sqrt{y}} dy = 1$$