Below is a problem I did. My answer matches the back of the book, but some how, I do not have confidence in my answer. I am hoping somebody here can confirm that my solution is right.
Problem:
Let $X$ have the normal density $N(0,\sigma^2)$. Find the density of $Y =|X|$.
Answer:
Clearly the density function for $Y$ is $0$ when $Y < 0$ because Y cannot be negative. Here is the density function for $X$.
$$ f_x = \frac{e^ {-\frac{x^2}{2 \sigma^2} } }{\sigma \sqrt{2 \pi}} $$
Now, we are interested in $P(Y <= y_0)$ where $Y = |X|$. Call the density function we are look for $f_y(x)$
\begin{align*}
P(Y <= y_0) &= \int_{-y_0}^{y_0} f_x(x) \, dx \\
P(Y <= y_0) &= \int_{-y_0}^{y_0} \frac{e^ {-\frac{x^2}{2\sigma^2} } }{\sigma \sqrt{2 \pi}} \, dx \\
P(Y <= y_0) &= \int_{0}^{y_0} \frac{2e^ {-\frac{x^2}{2\sigma^2} } }{\sigma \sqrt{2 \pi}} \, dx \\
\end{align*}
Now to find $f_y(x)$ we differentiate the last equation. This gives us:
$$ f_y(x) = \frac{2e^ {-\frac{x^2}{2\sigma^2} } }{\sigma \sqrt{2 \pi}} $$
-
2$\begingroup$ Your solution is right. $\endgroup$NCh– NCh2020-01-23 01:09:46 +00:00Commented Jan 23, 2020 at 1:09
2 Answers
The method you used in your solution has been correct all along; it is the starting point that has been wrong. With the latest emendation of your query where you have used the correct density function for a $N(0,\sigma^2)$ random variable, the final answer is correct too. Too bad that the answer provided in the back of your book is incorrect; most likely, the author also made the same mistake that you made earlier. You might want to edit the very first sentence of your question to reflect this reality.
-
$\begingroup$ Actual the answer in the back of the book was correct. I just read it wrong. $\endgroup$Bob– Bob2020-01-25 16:25:41 +00:00Commented Jan 25, 2020 at 16:25
As has already been stated in the comments, your solution is correct.
-
1$\begingroup$ joriki, the solution begins with an incorrect statement of the pdf of a $N(0,\sigma^2)$ random variable (the numerator needs to be $\exp(-x^2/2\sigma^2)$ and not $\exp(-x^2/2)$ as the OP has written)and thus results in an incorrect expression for the density of $|X|$. $\endgroup$Dilip Sarwate– Dilip Sarwate2020-01-23 16:38:54 +00:00Commented Jan 23, 2020 at 16:38
-
$\begingroup$ @DilipSarwate Is my solution now correct? If you could tell me as an answer then I am thinking I can close this question. $\endgroup$Bob– Bob2020-01-24 16:49:26 +00:00Commented Jan 24, 2020 at 16:49
-
$\begingroup$ My comment above applies to the original version of the question . The OP has corrected the error and now has the correct calculation in his question. $\endgroup$Dilip Sarwate– Dilip Sarwate2020-01-24 22:06:25 +00:00Commented Jan 24, 2020 at 22:06