Normal distribution transformation with $\phi(x)=x^2$

2.6k Views Asked by At

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?

3

There are 3 best solutions below

0
On 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…

3
On

Call $y = x^2$, then the PDF for $y$ can be constructed by realizing that

$$ f_X(x)dx = f_Y(y)dy $$

or equivalently

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

the absolute value is there to ensure that $f_Y(y) \ge 0$. Since $dx/dy = y^{-1/2}/2$ you have

$$ f_Y(y) = \frac{1}{\sqrt{2\pi y}}e^{-y/2} \tag{1} $$

Below there's a small simulation of the random variable $Y$. First a generate $10^5$ points following a standard normal distribution and squared them. The blue histogram is the result. The red line is Eq. (1)

enter image description here

Note Since $y=x^2 \ge 0$, there's no need to include the case $y<0$ in your derivation

7
On

Ok so the first point the change of variables is given by $$ \begin{align} f_{Y}(y) = f_{X}(\phi^{-1}(y) ) \left|\frac{d}{dy}\phi^{-1} \right|, \end{align} $$ Now as you noticed we have positive and negative roots where as the change of variable formula as stated just now is for a single monotonic transformation, however the symmetry around $x=0$ means that we can consider the positive and negative sections seperately, so taking the positive square root first we have $$ \left| \frac{d}{dy}\phi^{-1} (y) \right| = \frac{1}{2}y^{-1/2}, $$ the term for the negative square root is just the same and so we have $$ \begin{align} f_Y(y) &= 2 \cdot f_X(\sqrt{y}) \left| \frac{d}{dy} \sqrt{y} \right|\\ &=2\frac{1}{2\sqrt{2\pi}}y^{-\frac{1}{2}} e^{-\frac{y}{2}} \\ &= \frac{1}{2^{1/2}\sqrt{\pi} }y^{-1/2}e^{-y/2} \\ &= \frac{1}{2^{1/2}\Gamma(1/2)}y^{1/2-1}e^{-y/2} \end{align} $$ where I have included that last line just to show that this equals the probability density function of a Chi-squared random variable with one degree of freedom which is what we would expect.