umontreal.iro.lecuyer.randvar
Class PowerGen
- java.lang.Object
-
- umontreal.iro.lecuyer.randvar.RandomVariateGen
-
- umontreal.iro.lecuyer.randvar.PowerGen
-
public class PowerGen extends RandomVariateGen
This class implements random variate generators for the power distribution with shape parameter c > 0, over the interval [a, b]. Its density isf (x) = c(x - a)c-1/(b - a)cfor a <= x <= b, and 0 elsewhere.
-
-
Constructor Summary
Constructors Constructor and Description PowerGen(RandomStream s, double c)Creates a Power random variate generator with parameters a = 0, b = 1 and c = c, using stream s.PowerGen(RandomStream s, double a, double b, double c)Creates a Power random variate generator with parameters a = a, b = b and c = c, using stream s.PowerGen(RandomStream s, PowerDist dist)Creates a new generator for the power distribution dist and stream s.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetA()Returns the parameter a.doublegetB()Returns the parameter b.doublegetC()Returns the parameter c.static doublenextDouble(RandomStream s, double a, double b, double c)Uses inversion to generate a new variate from the power distribution with parameters a = a, b = b, and c = c, using stream s.voidsetParams(double a, double b, double c)Sets the parameters a, b and c for this object.-
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
-
-
-
-
Constructor Detail
-
PowerGen
public PowerGen(RandomStream s, double a, double b, double c)
Creates a Power random variate generator with parameters a = a, b = b and c = c, using stream s.
-
PowerGen
public PowerGen(RandomStream s, double c)
Creates a Power random variate generator with parameters a = 0, b = 1 and c = c, using stream s.
-
PowerGen
public PowerGen(RandomStream s, PowerDist dist)
Creates a new generator for the power distribution dist and stream s.
-
-
Method Detail
-
nextDouble
public static double nextDouble(RandomStream s, double a, double b, double c)
Uses inversion to generate a new variate from the power distribution with parameters a = a, b = b, and c = c, using stream s.
-
getA
public double getA()
Returns the parameter a.
-
getB
public double getB()
Returns the parameter b.
-
getC
public double getC()
Returns the parameter c.
-
setParams
public void setParams(double a, double b, double c)Sets the parameters a, b and c for this object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG