Class NormalRNG
- java.lang.Object
-
- dev.nm.stat.random.rng.univariate.normal.NormalRNG
-
- All Implemented Interfaces:
RandomNumberGenerator,Seedable
public class NormalRNG extends Object implements RandomNumberGenerator
This is a random number generator that generates random deviates according to the Normal distribution.- See Also:
- Wikipedia: Normal distribution
-
-
Constructor Summary
Constructors Constructor Description NormalRNG(double mean, double sigma)Construct a random number generator to sample from the Normal distribution.NormalRNG(double mean, double sigma, RandomStandardNormalGenerator rnorm)Construct a random number generator to sample from the Normal distribution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublenextDouble()Get the next randomdouble.voidseed(long... seeds)Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
NormalRNG
public NormalRNG(double mean, double sigma, RandomStandardNormalGenerator rnorm)Construct a random number generator to sample from the Normal distribution.- Parameters:
mean- the meansigma- the standard deviationrnorm- a standard random normal number generator
-
NormalRNG
public NormalRNG(double mean, double sigma)Construct a random number generator to sample from the Normal distribution.- Parameters:
mean- the meansigma- the standard deviation
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:SeedableSeed the random number/vector/scenario generator to produce repeatable experiments.
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGeneratorGet the next randomdouble.- Specified by:
nextDoublein interfaceRandomNumberGenerator- Returns:
- the next random number
-
-