umontreal.iro.lecuyer.randvar
Class BetaSymmetricalPolarGen
- java.lang.Object
-
- umontreal.iro.lecuyer.randvar.RandomVariateGen
-
- umontreal.iro.lecuyer.randvar.BetaGen
-
- umontreal.iro.lecuyer.randvar.BetaSymmetricalGen
-
- umontreal.iro.lecuyer.randvar.BetaSymmetricalPolarGen
-
public class BetaSymmetricalPolarGen extends BetaSymmetricalGen
This class implements symmetrical beta random variate generators using Ulrich's polar method. The method generates two uniform random variables x∈[0, 1] and y∈[- 1, 1] until x2 + y2 <= 1. Then it returns where S = x2 + y2, and α is the shape parameter of the beta distribution. The method is valid only when α > 1/2.
-
-
Constructor Summary
Constructors Constructor and Description BetaSymmetricalPolarGen(RandomStream s1, BetaSymmetricalDist dist)Creates a new generator for the distribution dist, using only one stream s1.BetaSymmetricalPolarGen(RandomStream s1, double alpha)Creates a symmetrical beta random variate generator with parameter α = alpha, using stream s1 to generate x and y, as in above.BetaSymmetricalPolarGen(RandomStream s1, RandomStream s2, BetaSymmetricalDist dist)Creates a new generator for the distribution dist, using stream s1 to generate x and stream s2 to generate y, as in above.BetaSymmetricalPolarGen(RandomStream s1, RandomStream s2, double alpha)Creates a symmetrical beta random variate generator with parameter α = alpha, using stream s1 to generate x and stream s2 to generate y, as in above.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description RandomStreamgetStream2()Returns stream s2 associated with this object.doublenextDouble()Generates a random number from the continuous distribution contained in this object.static doublenextDouble(RandomStream s, double alpha)Generates a random number by Ulrich's polar method using stream s.static doublenextDouble(RandomStream s1, RandomStream s2, double alpha)Generates a random number using Ulrich's polar method.-
Methods inherited from class umontreal.iro.lecuyer.randvar.BetaGen
getA, getAlpha, getB, getBeta, nextDouble
-
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, setStream, toString
-
-
-
-
Constructor Detail
-
BetaSymmetricalPolarGen
public BetaSymmetricalPolarGen(RandomStream s1, RandomStream s2, double alpha)
Creates a symmetrical beta random variate generator with parameter α = alpha, using stream s1 to generate x and stream s2 to generate y, as in above. Restriction: α > 1/2.
-
BetaSymmetricalPolarGen
public BetaSymmetricalPolarGen(RandomStream s1, double alpha)
Creates a symmetrical beta random variate generator with parameter α = alpha, using stream s1 to generate x and y, as in above. Restriction: α > 1/2.
-
BetaSymmetricalPolarGen
public BetaSymmetricalPolarGen(RandomStream s1, RandomStream s2, BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using stream s1 to generate x and stream s2 to generate y, as in above. Restriction: dist must have α > 1/2.
-
BetaSymmetricalPolarGen
public BetaSymmetricalPolarGen(RandomStream s1, BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using only one stream s1. Restriction: dist must have α > 1/2.
-
-
Method Detail
-
nextDouble
public static double nextDouble(RandomStream s1, RandomStream s2, double alpha)
Generates a random number using Ulrich's polar method. Stream s1 generates x and stream s2 generates y [see eq.]. Restriction: α > 1/2.
-
nextDouble
public static double nextDouble(RandomStream s, double alpha)
Generates a random number by Ulrich's polar method using stream s. Restriction: α > 1/2.
-
nextDouble
public double nextDouble()
Description copied from class:RandomVariateGenGenerates a random number from the continuous distribution contained in this object. By default, this method uses inversion by calling theinverseFmethod of the distribution object. Alternative generating methods are provided in subclasses.- Overrides:
nextDoublein classRandomVariateGen- Returns:
- the generated value
-
getStream2
public RandomStream getStream2()
Returns stream s2 associated with this object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG