umontreal.iro.lecuyer.randvar
Class ExponentialGen
- java.lang.Object
-
- umontreal.iro.lecuyer.randvar.RandomVariateGen
-
- umontreal.iro.lecuyer.randvar.ExponentialGen
-
public class ExponentialGen extends RandomVariateGen
This class implements random variate generators for the exponential distribution. The density isf (x) = λe-λx for x >= 0,where λ > 0.The (non-static) nextDouble method simply calls inverseF on the distribution.
-
-
Constructor Summary
Constructors Constructor and Description ExponentialGen(RandomStream s, double lambda)Creates an exponential random variate generator with parameter λ = lambda, using stream s.ExponentialGen(RandomStream s, ExponentialDist dist)Creates a new generator for the exponential distribution dist and stream s.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetLambda()Returns the λ associated with this object.static doublenextDouble(RandomStream s, double lambda)Uses inversion to generate a new exponential variate with parameter λ = lambda, using stream s.-
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
-
-
-
-
Constructor Detail
-
ExponentialGen
public ExponentialGen(RandomStream s, double lambda)
Creates an exponential random variate generator with parameter λ = lambda, using stream s.
-
ExponentialGen
public ExponentialGen(RandomStream s, ExponentialDist dist)
Creates a new generator for the exponential distribution dist and stream s.
-
-
Method Detail
-
nextDouble
public static double nextDouble(RandomStream s, double lambda)
Uses inversion to generate a new exponential variate with parameter λ = lambda, using stream s.
-
getLambda
public double getLambda()
Returns the λ associated with this object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG