Is there a one-pass algorithm that can generate numbers distributed over part of the normal (Gaussian) distribution?
I want to specify a base value (distribution center), standard deviation, and minimum and maximum values.
For example, I would like all values to be distributed between -0.5 and +1 standard deviations in the same ratio as in the normal distribution (obviously increased to account for missing tails).
Obviously, you can use the loop and only exit if the generated number was between the minimum and maximum, but this can continue for a long time if min / max is too close to each other or too far in the tail.
I am assuming a language with a Gaussian random number function (I use Java, but I can read almost everything).
source
share