25package umontreal.ssj.randvar;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
50 setParams(mu, lambda, sn);
60 setParams(dist.getMu(), dist.getLambda(), sn);
69 return mhs(s, sn, mu, lambda);
73 return mhs(stream, genN, mu, lambda);
80 throw new IllegalArgumentException(
"lambda <= 0");
82 throw new IllegalArgumentException(
"mu <= 0");
85 double ymu = mu * z * z;
86 double x1 = mu + 0.5 * mu * ymu / lambda - 0.5 * mu / lambda * Math.sqrt(4.0 * ymu * lambda + ymu * ymu);
88 if (u <= mu / (mu + x1))
93 protected void setParams(
double mu,
double lambda, NormalGen sn) {
94 setParams(mu, lambda);
Extends the class ContinuousDistribution for the inverse Gaussian distribution with location paramete...
InverseGaussianGen(RandomStream s, double mu, double lambda)
Creates an inverse Gaussian random variate generator with parameters mu and lambda,...
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
static double nextDouble(RandomStream s, NormalGen sn, double mu, double lambda)
Generates a new variate from the inverse gaussian distribution with parameters mu and lambda,...
InverseGaussianMSHGen(RandomStream s, NormalGen sn, double mu, double lambda)
Creates an inverse gaussian random variate generator with parameters mu and lambda,...
InverseGaussianMSHGen(RandomStream s, NormalGen sn, InverseGaussianDist dist)
Creates a new generator for the distribution dist using streams s and sn.
This class implements methods for generating random variates from the normal distribution .
static double nextDouble(RandomStream s, double mu, double sigma)
Generates a variate from the normal distribution with parameters.
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,...