com.numericalmethod.suanshu.stats.random.distribution
Class StandardGaussian
java.lang.Object
com.numericalmethod.suanshu.stats.random.distribution.Gaussian
com.numericalmethod.suanshu.stats.random.distribution.StandardGaussian
- All Implemented Interfaces:
- RandomNumberGenerator
public class StandardGaussian
- extends Gaussian
Sample pseudo random numbers from the standard Normal distribution.
This class is more efficient than Gaussian to generate standard gaussian random samples.
| Nested classes/interfaces inherited from class com.numericalmethod.suanshu.stats.random.distribution.Gaussian |
Gaussian.Method |
| Fields inherited from class com.numericalmethod.suanshu.stats.random.distribution.Gaussian |
mu, sigma |
|
Method Summary |
double |
nextDouble()
This function is more efficient, saving two floating point computations. |
| Methods inherited from class com.numericalmethod.suanshu.stats.random.distribution.Gaussian |
seed |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StandardGaussian
public StandardGaussian(Gaussian.Method method,
RandomNumberGenerator rng)
- Construct a pseudo-random number generator of the standard Gaussian distribution.
- Parameters:
method - the sampling methodrng - a uniform random number generator
StandardGaussian
public StandardGaussian()
- Construct a pseudo-random number generator of the standard Gaussian distribution.
nextDouble
public double nextDouble()
- This function is more efficient, saving two floating point computations.
Get the next Gaussian sample.
This method is synchronized so that one call generates two random samples.
- Specified by:
nextDouble in interface RandomNumberGenerator- Overrides:
nextDouble in class Gaussian
- Returns:
- a random standard Gaussian sample
Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.