Let $X\sim N(\mu,\sigma^2)$ a normal distributed random variable. Let furthermore $\mu=0, \sigma^2=1$ and $\phi(x)=x^2, \phi:\mathbb{R}\to \mathbb{R}_{+}$. Compute the density function of the random variable $\phi \circ X$!
So I know that one can compute with the transformation theorem for density functions. For a random variable $Y$ one has:
$$f_Y(y)=
\left\{\begin{array}{ll} \frac{f_X(\phi^{-1}(y))}{\phi'(\phi^{-1}(y))}, & y\in Image(\phi) \\
0, & y\not\in Image(\phi)\end{array}\right. (1) .
$$
For the density function of the normal distribution one has:
$$f_X(x)=\frac{1}{\sqrt{2\pi}\sigma}\cdot \mathrm{e}^{\left(-\frac{x-\mu}{2\sigma}\right)^2} (2)$$
To use (1) I have to compute $\phi^{-1}(y)$:
$$\phi^{-1}(y)=
\left\{\begin{array}{ll} \sqrt{y}, & y \ge \\
-\sqrt{y}, & y < 0\end{array}\right. (3).$$
For (2) I get with the given parameter:
$$f_X(x)=\frac{1}{\sqrt{2\pi}}\cdot \mathrm{e}^{-\frac{1}{2}x^2}$$
I put it all together and I get the density function:
$$f_Y(y)=
\left\{\begin{array}{ll} \frac{1}{\sqrt{8\pi y}}\cdot \mathrm{e}^{-\frac{1}{2}y}, & y\ge 0 \\
-\frac{1}{\sqrt{8\pi y}}\cdot \mathrm{e}^{-\frac{1}{2}y}, & y<0\end{array}\right. (4).$$
It seemed quite easy, so are there any mistakes?
Best Answer
Consider that $\phi: \Bbb R \to \Bbb R_+$, so $\phi^{-1}: \Bbb R_+ \to \Bbb R$ BUT ofc it's not the true inverse due to the fact that $\phi$ is not injective…
Try by direct calculating, so let $Y = \phi \circ X = X^2$ then $f_Y(x) = F'_Y(x)$ with $$\begin{align*} F_Y(x) &= P(X^2 \le x) \\ &= P(-\sqrt{x} \le X \le \sqrt{x}) \\ &= F_X(\sqrt{x}) - F_X(-\sqrt{x})\end{align*}$$
So: $$\begin{align*} f_Y(x) &= F'_Y(x) \\ &= \frac{1}{2\sqrt{x}}\left(f_X(\sqrt{x}) + f_X(-\sqrt{x})\right)\end{align*}$$
Plug in by yourself…