SSJ
V. 1.2.5.

umontreal.iro.lecuyer.randvar
Class BetaSymmetricalPolarGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.BetaGen
          extended by umontreal.iro.lecuyer.randvar.BetaSymmetricalGen
              extended by 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

$\displaystyle {\textstyle\frac{1}{2}}$ + $\displaystyle {\frac{{xy}}{{S}}}$(1 - S^2/(2α- 1))1/2

where S = x2 + y2, and α is the shape parameter of the beta distribution. The method is valid only when α > 1/2.


Constructor Summary
BetaSymmetricalPolarGen(RandomStream stream, BetaSymmetricalDist dist)
          Creates a new generator for the distribution dist, using only one stream stream.
BetaSymmetricalPolarGen(RandomStream stream, RandomStream s2, BetaSymmetricalDist dist)
          Creates a new generator for the distribution dist, using stream stream to generate x, and stream s2 to generate y as described in eq.
 
Method Summary
 RandomStream getStream2()
          Returns stream s2 associated with this object.
 double nextDouble()
          Generates a random number from the continuous distribution contained in this object.
static double nextDouble(RandomStream s, double alpha)
          Generates a random number using Ulrich's polar method with only one stream s.
static double nextDouble(RandomStream s1, RandomStream s2, double alpha)
          Generates a random number using Ulrich's polar method.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.BetaGen
nextDouble
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, setStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BetaSymmetricalPolarGen

public BetaSymmetricalPolarGen(RandomStream stream,
                               RandomStream s2,
                               BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using stream stream to generate x, and stream s2 to generate y as described in eq. above. Restriction: dist must have α > 1/2.


BetaSymmetricalPolarGen

public BetaSymmetricalPolarGen(RandomStream stream,
                               BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using only one stream stream. 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 using Ulrich's polar method with only one stream s. Restriction: α > 1/2.


nextDouble

public double nextDouble()
Description copied from class: RandomVariateGen
Generates a random number from the continuous distribution contained in this object. By default, this method uses inversion by calling the inverseF method of the distribution object. Alternative generating methods are provided in subclasses.

Overrides:
nextDouble in class BetaSymmetricalGen
Returns:
the generated value

getStream2

public RandomStream getStream2()
Returns stream s2 associated with this object.


SSJ
V. 1.2.5.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.