1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Standard Normal Dist Transformation

  1. Sep 20, 2012 #1
    1. The problem statement, all variables and given/known data
    The question ask to find [itex]E[X]; E[X^2]; Var(X)[/itex] for the standard normal distribution [itex]f(x)=1/\sqrt{2\pi}e^{-x^2/2}[/itex]


    2. Relevant equations
    I found
    [itex]
    \begin{align}
    E[X]&=\int_{-\infty}^\infty \! x*1/\sqrt{2\pi}e^{-x^2/2} \, \mathrm{d} x\\
    &=1/\sqrt{2\pi} ( \int_{-\infty}^0 \! x*e^{-x^2/2} \, \mathrm{d} x + \int_{0}^{\infty} \! x*e^{-x^2/2} \, \mathrm{d} x )\\
    &= 1/\sqrt{2\pi} ( (-1-0) + (0+1) )\\
    &= 0
    \end{align}
    [/itex]
    I found [itex]E[X^2]=1[/itex]
    and [itex]Var[X]=1[/itex]. So far no problem.


    3. The attempt at a solution
    Now, I am asked to find the pdf, [itex]E[Y], Var[Y][/itex] of [itex]Y=|X|[/itex]
    Since the inverse of [itex]Y=|X|[/itex] is [itex]X=|Y|[/itex] and the derivative of the inverse is 1. The transformation seems fairly straight forward.

    [itex]f(y)=1/\sqrt{2\pi}e^{-|y|^2/2}[/itex]

    I am just not sure about the domain of y, isn't it exactly the same as X because x is squared? Once I get that I should be able to use the same integration technique as above to find [itex]E[Y]; Var[Y][/itex] Wouldn't these values be exactly the same as [itex]E[X]; Var[X][/itex]? Something seems wrong here.
     
    Last edited: Sep 20, 2012
  2. jcsd
  3. Sep 20, 2012 #2

    jbunniii

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    No, this can't be right. Y = |X|, so Y can never be negative. Therefore f(y) must be zero for negative y. Your f(y) does not have that property.

    [edit] Just saw your remark about the domain. Right, so as I said, f(y) must be zero for negative y. However, you can't simply write
    [tex]f(y) = \left\{ \begin{array}{lr}
    1/\sqrt{2\pi}e^{-|y|^2/2} & y \geq 0 \\
    0 & \text{otherwise}
    \end{array} \right.[/tex]
    because that function will not integrate to 1. But I'm sure you can fix that easily enough.
     
  4. Sep 20, 2012 #3
    I guess then the inverse of [itex]Y=|X|[/itex] is not [itex]X=|Y|[/itex]. It must be something like
    [itex] f(y) =1/\sqrt{2\pi}e^{-y^2/2} \, for \, y\geq0[/itex].Which I think means I'm only looking at half the distribution. The right half to be exact. Correct?
     
    Last edited: Sep 20, 2012
  5. Sep 20, 2012 #4

    jbunniii

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Y = |X| doesn't have a (single-valued) inverse. For every nonzero value of Y, there are two values of X that give Y = |X|. You have to account for both of these. Hopefully you have seen an example of how to do this in your textbook or lecture?
     
  6. Sep 20, 2012 #5

    jbunniii

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Yes, this is almost correct. However, because you chopped off the left half, it no longer integrates to 1. You have to re-scale it appropriately.
     
  7. Sep 20, 2012 #6
    So I must have to multiply it by 2.
    [itex]f(y) =2/\sqrt{2\pi}e^{-y^2/2} \, for \, y\geq0[/itex] ?

    I don't really see how an absolute value transformation works for a distribution that isn't the standard normal.

    I'm confused.
     
  8. Sep 20, 2012 #7

    jbunniii

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Yes, in general it's a bit more complicated. Here it was easier because the standard normal is symmetric around zero. To see how it works in a somewhat more general case, consider what happens if you start with a normal distribution that has nonzero mean. There's an expression for the PDF here:

    http://en.wikipedia.org/wiki/Folded_normal_distribution

    Note that it simplifies to your result if [itex]\mu = 0[/itex].

    If your book doesn't cover how to calculate the density function when the transformation is not one-to-one, you can read about it here (and I would also recommend finding a better book!)

    http://www.cl.cam.ac.uk/teaching/2003/Probability/prob11.pdf
     
  9. Sep 20, 2012 #8
    I do not like the main book, but I looked in the second book and I just realized how you would have to do it. You would need to break it up into parts that are monotone and add them together. Correct?
     
  10. Sep 20, 2012 #9
    So if my integration is correct
    [itex]
    \begin{align}
    E[Y]&=\int_0^\infty \! 2/\sqrt{2\pi}e^{-y^2/2} \, dy \\
    &=2/\sqrt{2\pi} (-e^{-y^2/2}|_0^ \infty)\\
    &=2/\sqrt{2\pi}
    \end{align}
    [/itex]

    and
    [itex]Var(Y)=1-2/\pi[/itex]

    Edit: I saw where you posted the link to the folded normal. These answers are correct. Thanks for your help!
     
    Last edited: Sep 20, 2012
  11. Sep 21, 2012 #10

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    [tex] E|X| = \int_{-\infty}^{\infty} |x| f(x) \, dx = 2 \int_0^{\infty} x f(x) \, dx.[/tex] This is not zero.

    [tex]\text{Var}(|X|) = E(|X|^2) - (E|X|)^2 = E(X^2) -(E|X|)^2 = 1 - (E|X|)^2,[/tex] because EX2 is just the variance of X.

    RGV
     
  12. Sep 21, 2012 #11
    The absolute value threw me because the inverse is not monotone. The book does a horrible job of explaining how to handle this case and instead focuses on the fact that it must be strictly increasing or decreasing in the domain for the transformation to work.

    I guess another way to think about this problem would be to split the absolute value into two parts.
    [itex]\int_0^\infty \! yf(y) dy \, + \int_0^\infty \! yf(y) dy [/itex]
    since Y=|X| if I put postive values into x, I get postive y's and if I put negative values into x I get the same postive y's (hence the 2 times or the sum of integrals). Since x is defined for [itex] -\infty \le x \le \infty [/itex] I must transform the entire domain, but you can see that when I do this I get only postive y's, so the domain of y must be [itex] y \geq 0 [/itex].

    Thanks everyone for the help.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook