25package umontreal.ssj.randvar;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
43 private boolean available =
false;
44 private double[] variates =
new double[2];
45 private static double[] staticVariates =
new double[2];
77 return mu + sigma * variates[1];
79 polar(stream, mu, sigma, variates);
81 return mu + sigma * variates[0];
91 polar(s, mu, sigma, staticVariates);
92 return mu + sigma * staticVariates[0];
97 private static void polar(
RandomStream stream,
double mu,
double sigma,
double[] variates) {
103 }
while (s > 1.0 || s == 0.0);
105 double temp = Math.sqrt(-2.0 * Math.log(s) / s);
107 variates[0] = y * temp;
108 variates[1] = x * temp;
Extends the class ContinuousDistribution for the normal distribution (e.g., tjoh95a (page 80)).
void setParams(double mu, double sigma)
Sets the parameters and of this object.
NormalGen(RandomStream s, double mu, double sigma)
Creates a normal random variate generator with mean mu and standard deviation sigma,...
NormalPolarGen(RandomStream s, double mu, double sigma)
Creates a normal random variate generator with mean mu and standard deviation sigma,...
NormalPolarGen(RandomStream s, NormalDist dist)
Creates a random variate generator for the normal distribution dist and stream s.
NormalPolarGen(RandomStream s)
Creates a standard normal random variate generator with and , using stream s.
static double nextDouble(RandomStream s, double mu, double sigma)
Generates a variate from the normal distribution with parameters  mu and  sigma,...
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...
double nextDouble()
Returns a (pseudo)random number from the uniform distribution over the interval , using this stream,...