T.R | Title | User | Personal Name | Date | Lines |
---|
1549.1 | | ZFC::deramo | Dan D'Eramo | Mon Jan 27 1992 13:09 | 12 |
| It could be done "exactly" if you had some of the transcendental
functions and I think sqrt. I don't remember the formula, it involved
generated two random numbers from the uniform distribution on [0,1) and
rejecting them if they fell outside the unit circle, and manipulating
them somehow otherwise to get two random numbers from a unit normal
distribution.
With just + - X / ^ you can try the rough approximation of taking the
sum of 12 random numbers then subtracting 6. I don't know how far off
that is.
Dan
|
1549.2 | Depends on the application. | CADSYS::COOPER | Topher Cooper | Mon Jan 27 1992 13:31 | 0 |
1549.3 | Depends on the application. | CADSYS::COOPER | Topher Cooper | Mon Jan 27 1992 13:32 | 14 |
| It seems odd to have a non-scientific calculator with a RND function,
but the sum-of-uniforms method mentioned by Dan is probably your only
real possibility. Basically, it gives pretty good results for most of
the numbers generated. The distribution of the tails are pretty far
off, though, so some percentage of the time you'll get
not-particularly-normal results. If you just need numbers that are
roughly normal, that's probably OK -- particularly since its unlikely
that you'll be generating almost by hand enough normal r.n.'s to make
the differences that obvious. If its programmable, you might consider
summing 24 RNDs, subtracting 12 instead of 6, then dividing by 2. That
would probably push the bad region out to where it is of little
concern.
Topher
|
1549.4 | Suggestions | CIVAGE::LYNN | Lynn Yarbrough @WNP DTN 427-5663 | Mon Jan 27 1992 13:46 | 12 |
| >With just + - X / ^ you can try the rough approximation of taking the
>sum of 12 random numbers then subtracting 6. I don't know how far off
>that is.
There is nothing magic about 12 here: it's just the smallest n for which
summing n samples from a uniform distribution and subtracting n/2 gives a
decent approximation to a normal distribution. More samples, better
results. The comparison is good out to around 3 sigma, I think.
As for the "circle" formula, look at routine GASDEV (short for Gaussian
Deviates) in "Numerical Recipes". It's compact enough to use on a
calculator with sqrt, random, and log keys, I think.
|
1549.5 | Magic number 12 | CADSYS::COOPER | Topher Cooper | Mon Jan 27 1992 14:47 | 12 |
| RE: .4 (Lynn)
>There is nothing magic about 12 here: it's just the smallest n for which
The only "magic" about 12 is that it results in a standard deviation
of 1, thereby avoiding having to scale in order to get a standard
normal distribution. The variance (standard deviation squared) of
the sum of N Uniform(0..1) random numbers is N/12 (the variance of
the sum of any random numbers is the sum of the random numbers'
variances, and the variance of a unit uniform random number is 1/12).
Topher
|
1549.6 | | IMTDEV::ROBERTS | Reason, Purpose, Self-esteem | Mon Jan 27 1992 15:10 | 4 |
| Thanks, all.
Dwayne
|
1549.7 | Another Method | FASDER::MTURNER | Mark Turner * DTN 425-3702 * MEL4 | Mon Jan 27 1992 17:28 | 4 |
| See 755.n. This method may be too slow for you, though, unless
your calculator will allow you to store the formula for the normal
distribution. The advantage to the method is its flexibility: it'll
convert uniform distributions to any other type.
|