java.lang.Object
org.cicirello.math.rand.PolarGaussian
Deprecated.
This class provides methods for generating pseudorandom numbers from a Gaussian distribution
using the classic Polar Method. Other methods exist that are faster than Polar, and with superior
statistical properties over the Polar method. One such algorithm is the Ziggurat method,
implemented in the
ZigguratGaussian
class. The Polar method implementation provided in
the PolarGaussian class was originally implemented as part of an experimental study comparing the
effects of different Gaussian algorithms on the performance of a genetic algorithm. It is
included here in this repository, however, if you are looking for a fast algorithm for generating
Gaussian distributed random numbers, we suggest you consider the ZigguratGaussian
class
instead.
You can find some experimental data comparing the performance of a sequential genetic algorithm (GA) using this implementation of the Polar method for Gaussian mutation vs using the faster Ziggurat method, as well as experimental data for the same comparison but with a Parallel GA, in the following paper:
- V. A. Cicirello. Impact of Random Number Generation on Parallel Genetic Algorithms. Proceedings of the Thirty-First International Florida Artificial Intelligence Research Society Conference, pages 2-7. AAAI Press, May 2018.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation 1.static double
nextGaussian
(double sigma) Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation, sigma, or your choosing.static double
nextGaussian
(double sigma, RandomGenerator r) Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation, sigma, or your choosing.static double
Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation 1.
-
Method Details
-
nextGaussian
public static double nextGaussian(double sigma) Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation, sigma, or your choosing.ThreadLocalRandom
is used as the pseudorandom number generator for the source of randomness.- Parameters:
sigma
- The standard deviation of the Gaussian.- Returns:
- A random number from a Gaussian distribution with mean 0 and standard deviation sigma.
-
nextGaussian
Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation, sigma, or your choosing.- Parameters:
sigma
- The standard deviation of the Gaussian.r
- The pseudorandom number generator to use for the source of randomness.- Returns:
- A random number from a Gaussian distribution with mean 0 and standard deviation sigma.
-
nextGaussian
public static double nextGaussian()Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation 1.ThreadLocalRandom
is used as the pseudorandom number generator for the source of randomness.- Returns:
- A random number from a Gaussian distribution with mean 0 and standard deviation 1.
-
nextGaussian
Deprecated.Generates a random number from a Gaussian distribution with mean 0 and standard deviation 1.- Parameters:
r
- The pseudorandom number generator to use for the source of randomness.- Returns:
- A random number from a Gaussian distribution with mean 0 and standard deviation 1.
-
RandomVariates
or the instance methods ofEnhancedRandomGenerator
.