SSJ
V. labo.

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

BetaSymmetricalPolarGen

This class implements symmetrical beta random variate generators using Ulrich's polar method[#!rULR84a!#]. The method generates two uniform random variables x∈[0, 1] and y∈[- 1, 1] until x2 + y2≤1. Then it returns

(1/2) + (xy$\displaystyle \sqrt{{1 - S^{2/(2\alpha - 1)}}}$)/S

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 s1, BetaSymmetricalDist dist)
          .
BetaSymmetricalPolarGen(RandomStream s1, double alpha)
          .
BetaSymmetricalPolarGen(RandomStream s1, RandomStream s2, BetaSymmetricalDist dist)
          .
BetaSymmetricalPolarGen(RandomStream s1, RandomStream s2, double alpha)
          .
 
Method Summary
 RandomStream getStream2()
          .
 double nextDouble()
          Generates a random number from the continuous distribution contained in this object.
static double nextDouble(RandomStream s, double alpha)
          .
static double nextDouble(RandomStream s1, RandomStream s2, double alpha)
          .
 
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

BetaSymmetricalPolarGen

public BetaSymmetricalPolarGen(RandomStream s1,
                               RandomStream s2,
                               double alpha)
. \begin{tabb}Creates a symmetrical beta random variate generator with
 parameter ...
 ...texttt{s2} to generate $y$, as in above. Restriction: $\alpha > 1/2$.
 \end{tabb}


BetaSymmetricalPolarGen

public BetaSymmetricalPolarGen(RandomStream s1,
                               double alpha)
. \begin{tabb}Creates a symmetrical beta random variate generator with
 parameter ...
 ...} to generate $x$
 and $y$, as in above. Restriction: $\alpha > 1/2$.
 \end{tabb}


BetaSymmetricalPolarGen

public BetaSymmetricalPolarGen(RandomStream s1,
                               RandomStream s2,
                               BetaSymmetricalDist dist)
. \begin{tabb}Creates a new generator for the distribution \texttt{dist}, using
 s...
 ...
 as in above.
 Restriction: \texttt{dist} must have $\alpha > 1/2$.
 \end{tabb}


BetaSymmetricalPolarGen

public BetaSymmetricalPolarGen(RandomStream s1,
                               BetaSymmetricalDist dist)
. \begin{tabb}Creates a new generator for the distribution \texttt{dist},
 using o...
 ...m \texttt{s1}.
 Restriction: \texttt{dist} must have $\alpha > 1/2$.
 \end{tabb}

Method Detail

nextDouble

public static double nextDouble(RandomStream s1,
                                RandomStream s2,
                                double alpha)
. \begin{tabb}Generates a random number using Ulrich's polar method. Stream
 \text...
 ... \texttt{s2} generates $y$
 [see eq.].
 Restriction: $\alpha > 1/2$.
 \end{tabb}


nextDouble

public static double nextDouble(RandomStream s,
                                double alpha)
. \begin{tabb}Generates a random number by Ulrich's polar method using
 stream \texttt{s}. Restriction: $\alpha > 1/2$.
 \end{tabb}


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()
. \begin{tabb}Returns stream \texttt{s2} associated with this object.
 \end{tabb}


SSJ
V. labo.

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