finding the pdf of the square of another pdf

5k Views Asked by At

This might be just a silly question. If I have a distribution $Y=X^2$ where $X$ is normally distributed, how would I find the pdf of $Y$?

3

There are 3 best solutions below

6
On

Consider the general case: $X$ has a pdf and $X=-X$ in distribution.

The pdf of $X$ is $$ \frac d{dx} P(X<x). $$

Consider $Y$ and $x>0$.

$$P(Y<x) = P(X^2 < x) = P(-\sqrt{x} < X < \sqrt{x}) = P(0 < X < \sqrt{x}) + P(0 < -X < \sqrt{x}) $$

Now take the derivative with respect to $x$, you find that the pdf is $$ f_Y(x) = \frac1{2\sqrt{x}}(f_X(\sqrt{x}) + f_{-X}(\sqrt{x})) = \frac{f_X(\sqrt{x})}{\sqrt{x}} $$

0
On

In general, for a continuous random variable $Y = f(X)$ for some random variable $Y$, where $f$ is some nice function we can do the following:

  • Find the cumulative distribution function (c.d.f.): $$ F_Y(y) = P(Y < y) = P(f(X) < y) $$ Now note here in order to find this probability it depends on the function $f$. If you can find that $P(f(X) < y) = P(h(y) < X < g(y))$ for some $h,g$ we can integrate as follows: $$ P(f(X) < y) = P(h(y) < X < g(y)) = \int_{h(y)}^{g(y)} f_X(x) \, \mathrm{d} x $$

  • Differentiate the c.d.f. to find the p.d.f.: $$ f_Y(y) = \frac{\mathrm{d} F_Y(y)}{\mathrm{d} y} $$

Now for the problem of $f(X) = X^2$ we have that $$ P(X^2 < y) = P\left(- \sqrt{y} < X < \sqrt{y} \right) = \int_{-\sqrt{y}}^{\sqrt{y}} f_X(x) \, \mathrm{d} x $$ If we have that $X$ is a normal distribution with mean $\mu$ and S.D. $\sigma$ we have $$ F_Y(y) = \int_{-\sqrt{y}}^{\sqrt{y}} f_X(x) \, \mathrm{d} x = \int_0^{\sqrt{y}} f_X(x) \, \mathrm{d} x - \int_0^{-\sqrt{y}} f_X(x) \, \mathrm{d} x = P\left( X < \sqrt{y} \right) - P\left( X < - \sqrt{y} \right) \\ = F_X\left(\sqrt{y}\right) - F_X\left(-\sqrt{y}\right) = \frac{1}{2} \left( 1 + \mathrm{erf}\left( \frac{\sqrt{y} - \mu}{\sqrt{2\sigma^2}}\right) - 1 - \mathrm{erf}\left( \frac{-\sqrt{y} - \mu}{\sqrt{2\sigma^2}}\right) \right) = \frac{1}{2} \left( \mathrm{erf} \left( \frac{\sqrt{y} - \mu}{\sqrt{2\sigma^2}} \right) - \mathrm{erf} \left( \frac{-\sqrt{y} - \mu}{\sqrt{2\sigma^2}} \right) \right) $$ And now note that $$ \frac{\mathrm{d}}{\mathrm{d} x} \mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} e^{-z^2} $$ to find the final distribution.

7
On

Use the following method. Let $f_Y$ and $F_Y$ denote the density and cumulative distribution functions of $Y$, respectively. Also, let $f_X$ and $F_X$ denote the same for $X$. Then we have $$\begin{align} F_Y(y) &= \mathbb{P}(Y \leq y) \\&= \mathbb{P}(X^2 \leq y) \\&= \mathbb{P}(|X| \leq \sqrt{y}) \\&=2\,\mathbb{P}(0 < X \leq \sqrt{y}) \\&=2\left[\mathbb{P}(X \leq \sqrt{y}) - \mathbb{P}(X \leq 0)\right]\\&=2\left[F_X(\sqrt{y}) - F_X(0)\right] \,\,,\end{align}$$ where the fourth equality comes from the fact that $Y$ is nonnegative and the symmetry of the normal distribution. Now, differentiating both sides of the above, we have $$f_Y(y)=2\frac{f_X(\sqrt{y})}{2\sqrt{y}} =\frac{f_X(\sqrt{y})}{\sqrt{y}}\,.$$ Recall that the density of $X$ is given by $$f_X(x) = \frac{1}{\sigma \sqrt{2\pi}}\text{exp}\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) \,,$$ where $\mu$ and $\sigma^2$ are the mean and variance of $X$, respectively. Thus, we find the density of $Y$ is given by $$f_Y(y) = \frac{1}{\sigma \sqrt{2\pi y}}\text{exp}\left(-\frac{(\sqrt{y}-\mu)^2}{2\sigma^2}\right) \,.$$