SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.randvar.BetaSymmetricalBestGen Class Reference

This class implements symmetrical beta random variate generators using Devroye’s one-liner method. More...

Inheritance diagram for umontreal.ssj.randvar.BetaSymmetricalBestGen:
umontreal.ssj.randvar.BetaSymmetricalGen umontreal.ssj.randvar.BetaGen umontreal.ssj.randvar.RandomVariateGen

Public Member Functions

 BetaSymmetricalBestGen (RandomStream s1, RandomStream s2, RandomStream s3, double alpha)
 Creates a symmetrical beta random variate generator with parameter.
 BetaSymmetricalBestGen (RandomStream s1, double alpha)
 Creates a symmetrical beta random variate generator with parameter.
 BetaSymmetricalBestGen (RandomStream s1, RandomStream s2, RandomStream s3, BetaSymmetricalDist dist)
 Creates a new generator for the distribution dist, using stream s1 to generate \(U_1\), stream s2 to generate \(U_2\) and stream s3 to generate \(S\) as given in equation ( eq.beta.best ).
 BetaSymmetricalBestGen (RandomStream s1, BetaSymmetricalDist dist)
 Creates a new generator for the distribution dist, using only one stream s1.
double nextDouble ()
 Generates a random number from the continuous distribution contained in this object.
RandomStream getStream2 ()
 Returns stream s2 associated with this object.
RandomStream getStream3 ()
 Returns stream s3 associated with this object.
Public Member Functions inherited from umontreal.ssj.randvar.BetaSymmetricalGen
 BetaSymmetricalGen (RandomStream s, double alpha)
 Creates a new symmetrical beta generator with parameters.
 BetaSymmetricalGen (RandomStream s, BetaSymmetricalDist dist)
 Creates a new generator for the distribution dist, using stream s.
Public Member Functions inherited from umontreal.ssj.randvar.BetaGen
 BetaGen (RandomStream s, double alpha, double beta, double a, double b)
 Creates a new beta generator with parameters \(\alpha=\) alpha and \(\beta=\) beta, over the interval.
 BetaGen (RandomStream s, double alpha, double beta)
 Creates a new beta generator with parameters \(\alpha=\) alpha and \(\beta=\) beta, over the interval \((0,1)\), using stream s.
 BetaGen (RandomStream s, BetaDist dist)
 Creates a new generator for the distribution dist, using stream s.
double getAlpha ()
 Returns the parameter \(\alpha\) of this object.
double getBeta ()
 Returns the parameter \(\beta\) of this object.
double getA ()
 Returns the parameter \(a\) of this object.
double getB ()
 Returns the parameter \(b\) of this object.
Public Member Functions inherited from umontreal.ssj.randvar.RandomVariateGen
 RandomVariateGen (RandomStream s, Distribution dist)
 Creates a new random variate generator from the distribution dist, using stream s.
void nextArrayOfDouble (double[] v, int start, int n)
 Generates n random numbers from the continuous distribution contained in this object.
double[] nextArrayOfDouble (int n)
 Generates n random numbers from the continuous distribution contained in this object, and returns them in a new array of size n.
RandomStream getStream ()
 Returns the umontreal.ssj.rng.RandomStream used by this generator.
void setStream (RandomStream stream)
 Sets the umontreal.ssj.rng.RandomStream used by this generator to stream.
Distribution getDistribution ()
 Returns the umontreal.ssj.probdist.Distribution used by this generator.
String toString ()
 Returns a String containing information about the current generator.

Static Public Member Functions

static double nextDouble (RandomStream s1, RandomStream s2, RandomStream s3, double alpha)
 Generates a random number using Devroye’s one-liner method.
static double nextDouble (RandomStream s, double alpha)
 Generates a random number using Devroye’s one-liner method with only one stream s.
Static Public Member Functions inherited from umontreal.ssj.randvar.BetaGen
static double nextDouble (RandomStream s, double alpha, double beta, double a, double b)
 Generates a variate from the beta distribution with parameters.

Detailed Description

This class implements symmetrical beta random variate generators using Devroye’s one-liner method.

It is based on Best’s relation

[17]  between a Student- \(t\) variate and a symmetrical beta variate:

\[ B_{\alpha, \alpha} \stackrel{\mathcal{L}}{=} \frac{1}{2} \left( 1 + \frac{T_{2\alpha}}{\sqrt{2\alpha+ T_{2\alpha}^2}}\right). \]

If \(S\) is a random sign and \(U_1\), \(U_2\) are two independent uniform \([0,1]\) random variates, then the following gives a symmetrical beta variate [rDEV96a] :

\[ B_{\alpha, \alpha} \stackrel{\mathcal{L}}{=} \frac{1}{2} + \frac{S}{2 \sqrt{1 + \frac{1}{\left(U_1^{-1/\alpha} - 1\right)\cos^2(2\pi U_2)}}} \tag{eq.beta.best} \]

valid for any shape parameter \(\alpha> 0\).

Definition at line 51 of file BetaSymmetricalBestGen.java.

Constructor & Destructor Documentation

◆ BetaSymmetricalBestGen() [1/4]

umontreal.ssj.randvar.BetaSymmetricalBestGen.BetaSymmetricalBestGen ( RandomStream s1,
RandomStream s2,
RandomStream s3,
double alpha )

Creates a symmetrical beta random variate generator with parameter.

\(\alpha=\) alpha, using stream s1 to generate \(U_1\), stream s2 to generate \(U_2\) and stream s3 to generate \(S\), as given in equation ( eq.beta.best ).

Definition at line 66 of file BetaSymmetricalBestGen.java.

◆ BetaSymmetricalBestGen() [2/4]

umontreal.ssj.randvar.BetaSymmetricalBestGen.BetaSymmetricalBestGen ( RandomStream s1,
double alpha )

Creates a symmetrical beta random variate generator with parameter.

\(\alpha=\) alpha, using only one stream s1 to generate \(U_1\), \(U_2\), and \(S\) as given in equation ( eq.beta.best ).

Definition at line 82 of file BetaSymmetricalBestGen.java.

◆ BetaSymmetricalBestGen() [3/4]

umontreal.ssj.randvar.BetaSymmetricalBestGen.BetaSymmetricalBestGen ( RandomStream s1,
RandomStream s2,
RandomStream s3,
BetaSymmetricalDist dist )

Creates a new generator for the distribution dist, using stream s1 to generate \(U_1\), stream s2 to generate \(U_2\) and stream s3 to generate \(S\) as given in equation ( eq.beta.best ).

Definition at line 92 of file BetaSymmetricalBestGen.java.

◆ BetaSymmetricalBestGen() [4/4]

umontreal.ssj.randvar.BetaSymmetricalBestGen.BetaSymmetricalBestGen ( RandomStream s1,
BetaSymmetricalDist dist )

Creates a new generator for the distribution dist, using only one stream s1.

Definition at line 105 of file BetaSymmetricalBestGen.java.

Member Function Documentation

◆ getStream2()

RandomStream umontreal.ssj.randvar.BetaSymmetricalBestGen.getStream2 ( )

Returns stream s2 associated with this object.

Definition at line 149 of file BetaSymmetricalBestGen.java.

◆ getStream3()

RandomStream umontreal.ssj.randvar.BetaSymmetricalBestGen.getStream3 ( )

Returns stream s3 associated with this object.

Definition at line 156 of file BetaSymmetricalBestGen.java.

◆ nextDouble() [1/3]

double umontreal.ssj.randvar.BetaSymmetricalBestGen.nextDouble ( )

Generates a random number from the continuous distribution contained in this object.

By default, this method uses inversion by calling the umontreal.ssj.probdist.ContinuousDistribution.inverseF method of the distribution object. Alternative generating methods are provided in subclasses.

Returns
the generated value

Reimplemented from umontreal.ssj.randvar.RandomVariateGen.

Definition at line 133 of file BetaSymmetricalBestGen.java.

◆ nextDouble() [2/3]

double umontreal.ssj.randvar.BetaSymmetricalBestGen.nextDouble ( RandomStream s,
double alpha )
static

Generates a random number using Devroye’s one-liner method with only one stream s.

Restriction: \(\alpha> 0\).

Reimplemented from umontreal.ssj.randvar.BetaSymmetricalGen.

Definition at line 129 of file BetaSymmetricalBestGen.java.

◆ nextDouble() [3/3]

double umontreal.ssj.randvar.BetaSymmetricalBestGen.nextDouble ( RandomStream s1,
RandomStream s2,
RandomStream s3,
double alpha )
static

Generates a random number using Devroye’s one-liner method.

Restriction: \(\alpha> 0\).

Definition at line 113 of file BetaSymmetricalBestGen.java.


The documentation for this class was generated from the following file: