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 double
nextDouble()
Get the next randomdouble
.void
seed(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:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGenerator
Get the next randomdouble
.- Specified by:
nextDouble
in interfaceRandomNumberGenerator
- Returns:
- the next random number
-
-