2
$\begingroup$

For the density function below, I need to find $E(X)$ and $E(X^2)$. For $E(X)$, I did the following steps and got the answer of $-2/\sqrt{2\pi}$. However, this is incorrect as the correct answer is $\sqrt{\frac{2}{\pi}}$. I am unsure what I did incorrectly. For $E(X^2)$, is there any easier way to do it than by integration by parts? Thanks for the help.

Also, I tried a different approach that didn't work at all and I was wondering why it was incorrect. I split it up into two standard normals by adding them. Then, I used the theorem that the sum of two normals is also normal with a mean that is the sum of the two original normals and a variance that is a sum of the variances of the original normals. Going by that logic, I should get a normal with a mean of $0$ and a variance of $2$; however, that is obviously incorrect, so I am just wondering why.

$$ f(x) = \frac{2}{\sqrt{2\pi}} e^{-\frac{x^2}{2}} dx, \ \ \ \ \ 0 < x < \infty $$ $$ E(X) = \frac{2}{\sqrt{2\pi}} \int_0^\infty x e^{-\frac{x^2}{2}} dx. $$ Let $u = \frac{x^2}{2}$. $$ = - \frac{2}{\sqrt{2\pi}}. $$

  • 1
    But it does not show how you arrived at the negative answer.2011-09-26
  • 0
    e^-u from 0 to infinite is -12011-09-26
  • 0
    Thank you! I forgot the negative that preceded e^-u when integrating. Much appreciated.2011-09-26
  • 0
    This is the [half-normal distribution](http://en.wikipedia.org/wiki/Half-normal_distribution). Note $2/\sqrt{2 \pi} = \sqrt{2/\pi}$.2011-09-26
  • 0
    How do I now go about finding E(X^2) without having to use integration by parts? Can I compare it to the standard normal and somehow infer E(X^2) from it?2011-09-26
  • 1
    BTW, this is actually about the expectation of the _absolute value_ of a normally distributed random variable.2011-09-26

3 Answers 3

2

Since you got a negative answer, my first suspicion is that you didn't deal carefully with the bounds of integration. If $u=-x^2/2$, then as $x$ goes from $0$ to $\infty$, $u$ goes from $0$ to $-\infty$. Since $du=-x\;dx$, the integral $\int_0^\infty$ becomres $$\int_0^{-\infty} -e^u\;du.$$ So think about how to change that to $\int_{-\infty}^0\cdots\cdots$.

Also, it wouldn't hurt to recall a bit of algebra in order to understand the relationship between $\dfrac{2}{\sqrt{2\pi\;{}}}$ and $\dfrac{\sqrt{2}}{\sqrt{\pi}}$.

2

There is absolutely no way you can obtain a negative answer, since $x>0$ and $f(x)$ is always positive, since it is a pdf. Integration has to go along the following lines:

$\varphi(x) = \int_{0}^{\infty}x e^{-\frac{x^2}{2}}dx = \int_{0}^{\infty}e^{-\frac{x^2}{2}}d(\frac{x^2}{2}) =\int_{0}^{\infty}e^{-t}dt=-[e^{-\frac{x^2}{2}}] \vert^{\infty}_{0}=1$

  • 1
    I don't understand the notation on the left-hand side. What is $\varphi(x)$ supposed to denote and why is it a function of $x$?2011-09-26
  • 0
    it's the integral in OP's question2011-09-26
  • 1
    sigma, please read carefully @cardinal comment, you cannot have some $x$ in $\varphi$ and in the integral (besides, you did not define $\varphi$).2011-09-26
  • 0
    from OP, $EX=\frac{2}{\sqrt{2 \pi}} \varphi(x)$2011-09-27
  • 0
    Sorry, but your last comment does not make sense either. $\mathbb E X$ is a *number*, not a function of $x$, and $\varphi$ is not found anywhere in the question, as far as I can tell. :)2011-09-27
2

For calculating $E[X^2]$, you need not do integration by parts.

HINT Suppose $Y$ is distributed according to the standard normal $N(0,1)$. Do you know how to calculate $E[Y^2]$ (given its mean and variance)?

Secondly, the random variables $X^2$ and $Y^2$ are identically distributed. Can you see why? How would this fact help us?

  • 0
    Are they identically distributed because X^2 is an even function?2011-09-26
  • 0
    @Srivatsan, I temporarily submitted a comment to the question, explaining basically your point here. Sorry about that, it seems that I somehow missed your answer. Comment now deleted.2011-09-26
  • 0
    No problem @Didier. :)2011-09-26