SSJ
V. 2.6.2.

umontreal.iro.lecuyer.randvar
Class BetaSymmetricalBestGen

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.BetaSymmetricalBestGen

public class BetaSymmetricalBestGen
extends BetaSymmetricalGen

This class implements symmetrical beta random variate generators using Devroye's one-liner method. It is based on Best's relation between a Student-t variate and a symmetrical beta variate:

Bα, α$\displaystyle \;\stackrel{{ L}}{{=}}\;$$\displaystyle {\textstyle\frac{1}{2}}$(1 + $\displaystyle {\frac{{T_{2\alpha}}}{{\sqrt{2\alpha + T_{2\alpha}^2}}}}$).

If S is a random sign and U1, U2 are two independent uniform [0, 1] random variates, then the following gives a symmetrical beta variate:

Bα, α[tex2html_wrap_indisplay283][tex2html_wrap_indisplay284] + $\displaystyle {\frac{{S}}{{2
 \sqrt{1 + \frac{1}{(U_1^{-1/\alpha} - 1)\cos^2(2\pi U_2)}}}}}$

valid for any shape parameter α > 0.


Constructor Summary
BetaSymmetricalBestGen(RandomStream s1, BetaSymmetricalDist dist)
          Creates a new generator for the distribution dist, using only one stream s1.
BetaSymmetricalBestGen(RandomStream s1, double alpha)
          Creates a symmetrical beta random variate generator with parameter α = alpha, using only one stream s1 to generate U1, U2, and S as given in equation.
BetaSymmetricalBestGen(RandomStream s1, RandomStream s2, RandomStream s3, BetaSymmetricalDist dist)
          Creates a new generator for the distribution dist, using stream s1 to generate U1, stream s2 to generate U2 and stream s3 to generate S as given in equation.
BetaSymmetricalBestGen(RandomStream s1, RandomStream s2, RandomStream s3, double alpha)
          Creates a symmetrical beta random variate generator with parameter α = alpha, using stream s1 to generate U1, stream s2 to generate U2 and stream s3 to generate S, as given in equation.
 
Method Summary
 RandomStream getStream2()
          Returns stream s2 associated with this object.
 RandomStream getStream3()
          Returns stream s3 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 Devroye's one-liner method with only one stream s.
static double nextDouble(RandomStream s1, RandomStream s2, RandomStream s3, double alpha)
          Generates a random number using Devroye's one-liner 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BetaSymmetricalBestGen

public BetaSymmetricalBestGen(RandomStream s1,
                              RandomStream s2,
                              RandomStream s3,
                              double alpha)
Creates a symmetrical beta random variate generator with parameter α = alpha, using stream s1 to generate U1, stream s2 to generate U2 and stream s3 to generate S, as given in equation.


BetaSymmetricalBestGen

public BetaSymmetricalBestGen(RandomStream s1,
                              double alpha)
Creates a symmetrical beta random variate generator with parameter α = alpha, using only one stream s1 to generate U1, U2, and S as given in equation.


BetaSymmetricalBestGen

public BetaSymmetricalBestGen(RandomStream s1,
                              RandomStream s2,
                              RandomStream s3,
                              BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using stream s1 to generate U1, stream s2 to generate U2 and stream s3 to generate S as given in equation.


BetaSymmetricalBestGen

public BetaSymmetricalBestGen(RandomStream s1,
                              BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using only one stream s1.

Method Detail

nextDouble

public static double nextDouble(RandomStream s1,
                                RandomStream s2,
                                RandomStream s3,
                                double alpha)
Generates a random number using Devroye's one-liner method. Restriction: α > 0.


nextDouble

public static double nextDouble(RandomStream s,
                                double alpha)
Generates a random number using Devroye's one-liner method with only one stream s. Restriction: α > 0.


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 RandomVariateGen
Returns:
the generated value

getStream2

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


getStream3

public RandomStream getStream3()
Returns stream s3 associated with this object.


SSJ
V. 2.6.2.

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