[Math] Change of variable in a probability distribution

probability

Could somebody check this for me?
Problem:
Let $Y$ be a random variable with the with density function given by
\begin{eqnarray*}
f(y) = \begin{cases}
\big( \frac{3}{2} \big)y^2, & \text{for} -1 \le y \le 1 \\
0, & \text{otherwise} \\
\end{cases}
\end{eqnarray*}
(a) Find the density function of $U_1 = 3Y$.
(b) Find the density function of $U_2 = 3 – Y$.
(c) Find the density function of $U_3 = Y^2$.
Answer: (a)
\begin{eqnarray*}
P( y \le y_0 ) &=& P ( y \ge \frac{u_0}{3} ) = \int_{-1}^{\frac{u_0}{3}} \big( \frac{3}{2} \big)y^2 \, dy \\
P( y \le y_0 ) &=& \frac{3y^3}{3(2)} \,\, \Big|_{-1}^{\frac{u_0}{3}} = \frac{y^3}{2} \,\, \Big|_{-1}^{\frac{u_0}{3}} \\
P( y \le y_0 ) &=& \frac{\big(\frac{u_0}{3}\big)^3}{2} – \frac{(-1)^3}{2} \\
P( y \le y_0 ) &=& \frac{ u_0^3}{ 27(2)} + \frac{1}{8} \\
F(u_1) &=& \frac{ u_1^3 }{ 54} + \frac{1}{8} \\
f(u_1) &=& \frac{3u_1^2}{54} \\
f(u_1) &=& \frac{u_1^2}{18} \\
\end{eqnarray*}
Now, we need to find the limits for the function. When $y = -1$ then $u_1 = -3$. When $y = 1$ then $u_1 = 3$. Hence we have:
\begin{eqnarray*}
f(u) = \begin{cases}
\big( \frac{u^2}{18} \big), &\text{for} -3 \le u \le 3 \\
0, & \text{otherwise} \\
\end{cases}
\end{eqnarray*}
(b)
\begin{eqnarray*}
Y &=& 3 – U_2 \\
P( y \ge 3 – u_0 ) &=& 1 – P( y \le 3 – u_0 ) \\
P( y = 3 – u_0 ) &=& \int_{-1}^{3 – u_0} \big( \frac{3}{2} \big)y^2 \, dy =
\frac{3y^3}{3(2)} \,\, \Big|_{-1}^{3 – u_0} \\
P( y \le 3 – u_0 ) &=& \frac{(3-u_0)^3}{2} – \frac{(-1)^3}{2} = \frac{(3-u_0)^3}{2} + \frac{1}{8} \\
P( y \ge 3 – u_0 ) &=& 1 – \Big( \frac{(3-u_0)^3}{2} + \frac{1}{8} \Big) = \frac{(u_0 – 3)^3}{2} + \frac{7}{8} \\
F(u_2) &=& \frac{(u_2 – 3)^3}{2} + \frac{7}{8} \\
f(u_2) &=& \frac{3(3 – u_2)^2}{2} \\
\end{eqnarray*}
Now, we need to find the limits for the function. When $y = -1$ then $u_2 = 4$. When $y = 1$ then $u_2 = 2$. Hence we have:
\begin{eqnarray*}
f(u) = \begin{cases}
\big( \frac{3(3 – u)^2}{2} \big), & \text{for} \quad 2 \le u \le 4 \\
0, & \text{otherwise} \\
\end{cases}
\end{eqnarray*}
(c)
\begin{eqnarray*}
Y &=& \sqrt{ U_3 } \\
P( y \le y_0 ) &=& P( y \le \sqrt{u_3} ) = \int_{-1}^{\sqrt{u_3}} \big( \frac{3}{2} \big)y^2 \, dy \\
P( y \le y_0 ) &=& \frac{3y^3}{3(2)} \Big|_{-1}^{ \sqrt{u_3}} = \frac{3u_3^{ \frac{3}{2} }}{6} – \frac{3(-1)^3}{6} \\
P( y \le y_0 ) &=& \frac{u_3^{ \frac{3}{2} }}{2} + \frac{3}{6} \\
F(u_3) &=& \frac{ u_3 ^ {\frac{3}{2}} + 1 } { 2 } \\
f(u_3) &=& 3u_3^{ \frac{1}{2} } \\
\end{eqnarray*}
Now, we need to find the limits for the function. Observe that $u_3$ is always greater than or equal to $0$. Hence,
the lower bound for $u_3$ is $0$. When $y = 1$, $u_3 = 1$. Hence we have:
\begin{eqnarray*}
f(u) &=& \begin{cases}
\frac{ 3u^{ \frac{1}{2} } } { 2 } & \text{for} \quad 0 \le u \le 1 \\
0, & \text{otherwise} \\
\end{cases}
\end{eqnarray*}

Best Answer

That is mostly okay, but you are making way too much work for yourself.   You are asked to transform variable to find a pdf from a pdf.   You don't actually have to perform an integration to a CDF to get there.   You can apply the chain rule of differentiation to go straight to goal.

$$\begin{align}U_1&=3Y\\\mathsf P(U_1\leqslant u) &= \mathsf P(3Y\leqslant u) \\ & = \mathsf P(Y\leqslant u/3) \\ F_{U_1}(u) & = F_Y(u/3) \\ f_{U_1}(u) & = \tfrac 13 f_Y(u/3) \\ & = \tfrac 12 (\tfrac u3)^2~\mathbf 1_{-1\leqslant (u/3)\leqslant 1}\\ &=\tfrac 1{18}u^2~\mathbf 1_{(-3\leqslant u\leqslant 3)}\end{align}$$


When the transformation $Y\mapsto h(Y)$ has an inverse function $g()$, then the fact that the pdf is the unsigned derivative of the CDF means:

$$F_{h(Y)}(u)=F_Y(g(u)) \implies f_{h(Y)}(u) = \lvert g'(u)\rvert~f_Y(g(u))$$

Thus we do not have to invoke the CDF at all:

$$\begin{align}U_2 & =3-Y\\ f_{U_2}(u) ~&=f_{3-Y}(u) \\ &= \lvert\tfrac{\partial (3-u)}{\partial u}\rvert f_Y(3-u) \\ &= \tfrac {3}{2} (3-u)^2 ~\mathbf 1_{(-1\leqslant 3-u\leqslant 1)}\\ &=\tfrac {3}{2}(u-3)^2~\mathbf 1_{(2\leqslant u\leqslant 4)}\end{align}$$


However, complications do arise when the transformation $Y\mapsto U$ is not invertable. In this case $Y\mapsto Y^2$ does not have a single inverse over $[-1;1]$.   Taking it carefully we find:

$$\begin{align}U_3&=Y^2 \\\mathsf P(U_3\leqslant u) &= \mathsf P(Y^2\leqslant u) \\ & = \mathsf P({-}\surd u\leqslant Y\leqslant \surd u) \\ F_{U_3}(u) & = F_Y(\surd u)-F_Y({-}\surd u) \\ f_{U_3}(u) & = \tfrac 1{2\surd u} f_Y(\surd u)~+~\tfrac 1{2\surd u} f_Y({-}\surd u)) \\ & = \tfrac 3{4\surd u}((\surd u)^2\mathbf 1_{-1\leqslant \surd u\leqslant 1}+({-}\surd u)^2\mathbf 1_{-1\leqslant {-}\surd u\leqslant 1}) \\ & = \tfrac 3 2 \surd u~\mathbf 1_{0\leqslant u\leqslant 1}\end{align}$$

$\blacksquare$