Results 1 to 9 of 9

Math Help - Finding expected value and variance of pdf

  1. #1
    Senior Member
    Joined
    Feb 2008
    Posts
    297

    Finding expected value and variance of pdf

    Find E(X) and Var(X) for the random variable X with probability density function proportional to:

    e^{-x^2+x}
    Last edited by CaptainBlack; June 19th 2010 at 01:02 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,111
    Thanks
    2
    First, and very much most importantly, you must specify a DOMAIN. I'm going to guess you mean [-\infty,\infty], but [-5,5] is about the same on this one. Please think about complete definitions. Your life WILL be better.

    With that, we can solve the silly "proportional" word. The probability, whatever it is, must sum to unity.

    \int_{-\infty}^{\infty}a\cdot e^{x-x^{2}}\;dx = 1

    Solve for 'a'. I get a = 1.3153602668. You may have to employ some numerical methods.

    Can you take it from there? Calculating the first two moments seems a good way to proceed.
    Last edited by CaptainBlack; June 19th 2010 at 01:05 AM.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member
    Joined
    Feb 2008
    Posts
    297
    Quote Originally Posted by TKHunny View Post
    First, and very much most importantly, you must specify a DOMAIN. I'm going to guess you mean [-\infty,\infty], but [-5,5] is about the same on this one. Please think about complete definitions. Your life WILL be better.

    With that, we can solve the silly "proportional" word. The probability, whatever it is, must sum to unity.

    \int_{-\infty}^{\infty}a\cdot e^{x-x^{2}}\;dx = 1

    Solve for 'a'. I get a = 1.3153602668. You may have to employ some numerical methods.

    Can you take it from there? Calculating the first two moments seems a good way to proceed.
    Ok, so once we find a, to find the expected value and variance, do I do the following?

    E(X)=1.32\int_{-\infty}^{\infty}xe^{x-x^2}\;dx

    Var(X)=1.32\int_{-\infty}^{\infty}x^2e^{x-x^2}\;dx-[E(X)]^2

    By the way, what's an easy way of integrating that?
    Last edited by CaptainBlack; June 19th 2010 at 01:05 AM.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    May 2010
    Posts
    1,030
    Thanks
    28
    you need to use integration by parts for both i think.


    Since different people use different notation for integration by parts, here is how i write it:
     \int uv' = \left[uv \right] - \int u'v

    For E(X) use
    v'=xe^{-x^2}
    v = -0.5e^{-x^2}

    u=e^{x}
    u'=e^{x}

    Integration by parts:

    \int_{-\infty}^{\infty} xe^{x-x^2} =  \left[uv \right]_{-\infty}^{\infty} - \int_{-\infty}^{\infty} -0.5e^{-x^2}e^{x}

    \int_{-\infty}^{\infty} xe^{x-x^2} =  \left[uv \right]_{-\infty}^{\infty} + 0.5 \int_{-\infty}^{\infty} e^{x-x^2}

    You can recognise the integral on the RHS as the pdf multiplied by a constant \frac{0.5}{a}, you know the PDF integrates to 1.


    If you take a similar approach to do the E(x^2), I think you will find that the integral "appearing" on the right is equal to E(X) + pdf, multiplied by various constants, but this should be no problem as you just calculated the value of E(X).

    Try that, my apologies if it doesn't work. I haven't worked it through myself.

    Edit I did the second one to check
    Spoiler:


    For E(X^2) use
    v'=xe^{-x^2}
    v = -0.5e^{-x^2}

    u=xe^{x}
    u'=xe^{x} + e^x


    \int_{-\infty}^{\infty} xe^{x-x^2} =  \left[uv \right]_{-\infty}^{\infty} - \int_{-\infty}^{\infty} -0.5e^{-x^2}\left(xe^{x} + e^x   \right)

    \int_{-\infty}^{\infty} xe^{x-x^2} =  \left[uv \right]_{-\infty}^{\infty} - \left(  \int_{-\infty}^{\infty} -0.5e^{-x^2}xe^{x} + \int_{-\infty}^{\infty} -0.5e^{-x^2}e^{x} \right)

    \int_{-\infty}^{\infty} xe^{x-x^2} =  \left[uv \right]_{-\infty}^{\infty} - \left(  \int_{-\infty}^{\infty} -0.5xe^{x-x^2} + \int_{-\infty}^{\infty} -0.5e^{x-x^2} \right)

    You can recognise the integrals on the RHS as the PDF and E(X), muyltipled by constants. the PDF integrates to 1 (again), and you just calculated E(X)

    Last edited by CaptainBlack; June 19th 2010 at 01:06 AM.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,111
    Thanks
    2
    Quote Originally Posted by acevipa View Post
    By the way, what's an easy way of integrating that?
    Well, that's why I mentioned the numerical methods. Really, it's not evil to have only 15 decimal places rather than an exact solution. If you were trying to find Mars, I think that much accuracy would get you there. For well-behaved functions, as strictly continuous probability densities often are, simpler methods, such as Simpson's rule, are likely to be quite sufficient. Throw in Rhomberg Extrapolation and a very large percentage of such integrals easily are solved. Maybe Gaussian Quadrature if your feeling a little adventurous.

    Just a quick reference for you.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Joined
    May 2010
    Posts
    1,030
    Thanks
    28
    worth checking if credit will be given for an approximate solution before doing that. The purpose of these exercises is often to learn to manipulate integrals in that way.
    Last edited by SpringFan25; June 10th 2010 at 11:49 AM.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,111
    Thanks
    2
    In a statistics class?! I cannot agree with that. It should have been in your calculus prerequisites.

    My views. I welcome others'.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by acevipa View Post
    Find E(X) and Var(X) for the random variable X with probability density function proportional to:

    e^{-x^2+x}
    You should be able to re-write this as e^{-\left(x - \frac{1}{2}\right)^2} e^{-1/4} and then normalise e^{-\left(x - \frac{1}{2}\right)^2} by recognising it as being proportional to the pdf of a normal distribution with mean ..... and sd ......

    Then use the well known results for mean and variance of a normal distribution to answer your question.
    Last edited by CaptainBlack; June 19th 2010 at 01:09 AM.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,111
    Thanks
    2
    You mean those well-known and inexact probabilities in published references and in software algorithms?

    Good call. Much simpler not to reinvent the wheel.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Expected Value and Variance?
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: November 8th 2011, 01:00 PM
  2. Expected Value and Variance
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: May 10th 2010, 05:24 AM
  3. expected value and variance
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: March 4th 2010, 01:29 PM
  4. [SOLVED] Finding expected values and variance
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: February 23rd 2009, 06:17 PM
  5. Expected Value and Variance Again
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: December 7th 2008, 02:10 PM

Search Tags


/mathhelpforum @mathhelpforum