Results 1 to 7 of 7

Thread: value in Normal Distribution

  1. #1

    Thread Starter
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    Question value in Normal Distribution

    Simple question:

    i am after a function that, given a mean and standard deviation, returns a random value such that if you call the function often enough, the values it returns represent a normal distribution.

    thanks
    sql_lall

  2. #2
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703

    Re: value in Normal Distribution

    You want the normal distribution?

    The density function is

    (1/sqr(2*Pi)) * exp(-(t^2)/2)

    with

    t = (x- mu)/sigma

    mu = mean
    sigma = std. dev.

    The distribution fn. is the integral of that between (-infinity) and whatever value of x you're interested in.
    an ending

  3. #3

    Thread Starter
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    Re: value in Normal Distribution

    Thanks for that....the formula you gave, while correct, is a bit hard to put in code (like...integral to infinity). I guess i could approximate, but still tricky.

    Maybe it would be best to approximate to binomial distr, with large enough n for good fit, but low enough to not take too long to compute....

    ideas?
    sql_lall

  4. #4
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703

    Re: value in Normal Distribution

    The integrand gets extremely small as you approach large negative (or positive) x-values. Just approximate with some reasonably large in magnitude minimum value - you'll be limited by floating point number precision and roundoff errors anyway.
    an ending

  5. #5
    Addicted Member Rassis's Avatar
    Join Date
    Jun 2004
    Location
    Lisbon
    Posts
    248

    Re: value in Normal Distribution

    The solution to the question can be seen in the attached file. One can use both MS-EXCEL or the analytical expression (Box-Muller method).

    Good luck for all.
    Attached Files Attached Files

  6. #6

    Thread Starter
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    Re: value in Normal Distribution

    Wow! that's great
    thanks, the second part is exactly what i was looking for...
    but, for the Box-Muller thing, which i'll end up using, the random values that you give it (r1 and r2), do they have to be between 0 and 1, or must be integers, or what?

    but anyway, thanks for the sheet...it's made really nicely. U have that already, or make it for this?
    sql_lall

  7. #7
    Addicted Member Rassis's Avatar
    Join Date
    Jun 2004
    Location
    Lisbon
    Posts
    248

    Re: value in Normal Distribution

    Quote Originally Posted by sql_lall
    Wow! that's great
    thanks, the second part is exactly what i was looking for...
    but, for the Box-Muller thing, which i'll end up using, the random values that you give it (r1 and r2), do they have to be between 0 and 1, or must be integers, or what?

    r1 and r2 are any random values between 0 and 1. They have to be decimal numbers. I attach another MS-EXCEL file (Normal_Forum_1.XLS) with an example of the Box-Muller method and a better explanation of the expression and some stats procedures possible.

    but anyway, thanks for the sheet...it's made really nicely. U have that already, or make it for this?
    I use computer simulation methods often for the decision making processes: lay-out alternatives, organizational methods, equipment investments, overhauls of big machinery, etc., so I am used to these stats which give me lots of fun.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width