25package umontreal.ssj.randvar;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
72 return kindermanRamage(stream, mu, sigma);
81 return kindermanRamage(s, mu, sigma);
85 private static double kindermanRamage(
RandomStream stream,
double mu,
double sigma) {
86 final double XI = 2.216035867166471;
87 final double PIhochK = 0.3989422804;
92 if (U < 0.884070402298758) {
94 X = XI * (1.131131635444180 * U + V - 1.);
97 else if (U >= 0.973310954173898) {
105 t = XI * XI / 2. - Math.log(W);
106 }
while ((V * V * t) > (XI * XI / 2.));
107 X = (U < 0.986655477086949) ? Math.pow(2 * t, 0.5) : -Math.pow(2 * t, 0.5);
110 else if (U >= 0.958720824790463) {
112 V = stream.nextDouble();
113 W = stream.nextDouble();
115 t = XI - 0.630834801921960 * Math.min(V, W);
116 }
while (Math.max(V, W) > 0.755591531667601 && 0.034240503750111
117 * Math.abs(z) > (PIhochK * Math.exp(t * t / (-2.)) - 0.180025191068563 * (XI - Math.abs(t))));
118 X = (z < 0) ? t : -t;
121 else if (U >= 0.911312780288703) {
123 V = stream.nextDouble();
124 W = stream.nextDouble();
126 t = 0.479727404222441 + 1.105473661022070 * Math.min(V, W);
127 }
while (Math.max(V, W) > 0.872834976671790 && 0.049264496373128
128 * Math.abs(z) > (PIhochK * Math.exp(t * t / (-2)) - 0.180025191068563 * (XI - Math.abs(t))));
129 X = (z < 0) ? t : -t;
134 V = stream.nextDouble();
135 W = stream.nextDouble();
137 t = 0.479727404222441 - 0.595507138015940 * Math.min(V, W);
140 }
while (Math.max(V, W) > 0.805777924423817 && 0.053377549506886
141 * Math.abs(z) > (PIhochK * Math.exp(t * t / (-2)) - 0.180025191068563 * (XI - Math.abs(t))));
142 X = (z < 0) ? t : -t;
145 return mu + sigma * X;
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,...
static double nextDouble(RandomStream s, double mu, double sigma)
Generates a variate from the normal distribution with parameters  mu and  sigma,...
NormalKindermannRamageGen(RandomStream s)
Creates a standard normal random variate generator with mean 0 and standard deviation 1,...
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
NormalKindermannRamageGen(RandomStream s, NormalDist dist)
Creates a random variate generator for the normal distribution dist and stream s.
NormalKindermannRamageGen(RandomStream s, double mu, double sigma)
Creates a normal random variate generator with mean mu and standard deviation sigma,...
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,...