Results 1 to 6 of 6

Thread: sampling from a normal distribution

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    sampling from a normal distribution

    Can anyone help me out with an equation (or algorithm) that I can use in a program I am writing to simulate sampling from a Normal distribution? I also need this for a Lognormal distribution.

    I basically need a function:

    SampledValue = f(RandomNumber)

    Thanks for any help!

  2. #2
    Hyperactive Member DavidHooper's Avatar
    Join Date
    Apr 2001
    Posts
    357
    I personally hate the normal distribution - too many nasty questions on Maths papers!

    http://www.itl.nist.gov/div898/handb...n3/eda3661.htm
    There are 10 types of people in the world - those that understand binary, and those that don't.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    Thanks David, but ....

    I cannot find an explicit function or equation for the function I need on the page though. Any other references?

    If I just had a function that returned the value of a normal cdf, I could probably work out the solution on my own.

    Thanks!

  4. #4
    Hyperactive Member DavidHooper's Avatar
    Join Date
    Apr 2001
    Posts
    357
    This help?:
    http://www.itl.nist.gov/div898/handb...n3/eda3669.htm

    To be honest, I don't completely understand what you want
    Last edited by DavidHooper; Dec 23rd, 2001 at 01:20 PM.
    There are 10 types of people in the world - those that understand binary, and those that don't.

  5. #5
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728
    Originally posted by DavidHooper
    I personally hate the normal distribution - too many nasty questions on Maths papers!
    *Glad to know it's not just me who thinks this
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  6. #6
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    I found a formula which did not enlighten me much, but it might help you. The following is supposed to be the equation for the normal curve.

    y = Exp(.5*x^2)/Sqr(2*pi).

    A note says that x is measured in standard deviation units from the mean and the area under the curve is exactly one.

    I plotted the above and it looks like a normal curve with a mean of zero. I t seem to me that areas under this curve represent probabilities. Thus integrals of the function would be probabilities. For example, the integral from x = - 1 to +1 would be the probability of a given sample value being between one standard deviation below the mean and one above it.

    I have no idea how to use the above information for sampling from a normal distribution. Perhaps you can figure out something.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

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