SSJ
V. labo.

umontreal.iro.lecuyer.randvar
Class BetaGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.BetaGen
Direct Known Subclasses:
BetaRejectionLoglogisticGen, BetaStratifiedRejectionGen, BetaSymmetricalGen

public class BetaGen
extends RandomVariateGen

BetaGen

This class implements random variate generators with the beta distribution with shape parameters α > 0 and β > 0, over the interval (a, b), where a < b. The density function of this distribution is

f (x) = [Γ(α + β)/(Γ(α)Γ(β)(b - a)α+β-1)](x - a)α-1(b - x)β-1 for a < x < b,

and f (x) = 0 elsewhere, where Γ(x) is the gamma function defined in GammaGen. Local copies of the parameters α, β, a, and b are maintained in this class. The (non-static) nextDouble method simply calls inverseF on the distribution.


Constructor Summary
BetaGen(RandomStream s, BetaDist dist)
          .
BetaGen(RandomStream s, double alpha, double beta)
          .
BetaGen(RandomStream s, double alpha, double beta, double a, double b)
          .
 
Method Summary
 double getA()
          .
 double getAlpha()
          .
 double getB()
          .
 double getBeta()
          .
static double nextDouble(RandomStream s, double alpha, double beta, double a, double b)
          .
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BetaGen

public BetaGen(RandomStream s,
               double alpha,
               double beta,
               double a,
               double b)
. \begin{tabb}Creates a new beta generator with parameters $\alpha =$
 \texttt{al...
 ...he interval
 $($\texttt{a}$,$~\texttt{b}$)$, using stream \texttt{s}.
 \end{tabb}


BetaGen

public BetaGen(RandomStream s,
               double alpha,
               double beta)
. \begin{tabb}Creates a new beta generator with parameters $\alpha =$
 \texttt{al...
 ...\ \texttt{beta}, over the interval $(0,1)$,
 using stream \texttt{s}.
 \end{tabb}


BetaGen

public BetaGen(RandomStream s,
               BetaDist dist)
. \begin{tabb}Creates a new generator for the distribution \texttt{dist},
 using stream \texttt{s}.
 \end{tabb}

Method Detail

nextDouble

public static double nextDouble(RandomStream s,
                                double alpha,
                                double beta,
                                double a,
                                double b)
. \begin{tabb}Generates a variate from the {\em beta\/} distribution with
 paramet...
 ...~\texttt{beta}, over the
 interval $(a, b)$, using stream \texttt{s}.
 \end{tabb}


getAlpha

public double getAlpha()
. \begin{tabb}Returns the parameter $\alpha$\ of this object.
 \end{tabb}


getBeta

public double getBeta()
. \begin{tabb}Returns the parameter $\beta$\ of this object.
 \end{tabb}


getA

public double getA()
. \begin{tabb}Returns the parameter $a$\ of this object.
 \end{tabb}


getB

public double getB()
. \begin{tabb}Returns the parameter $b$\ of this object.
 \end{tabb}


SSJ
V. labo.

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