SSJ
V. labo.

umontreal.iro.lecuyer.randvar
Class PowerGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.PowerGen

public class PowerGen
extends RandomVariateGen

PowerGen

This class implements random variate generators for the power distribution with shape parameter c > 0, over the interval [a, b]. Its density is

f (x) = c(x - a)c-1/(b - a)c

for axb, and 0 elsewhere.


Constructor Summary
PowerGen(RandomStream s, double c)
          .
PowerGen(RandomStream s, double a, double b, double c)
          .
PowerGen(RandomStream s, PowerDist dist)
          .
 
Method Summary
 double getA()
          .
 double getB()
          .
 double getC()
          .
static double nextDouble(RandomStream s, double a, double b, double c)
          .
 void setParams(double a, double b, double c)
          .
 
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

PowerGen

public PowerGen(RandomStream s,
                double a,
                double b,
                double c)
. \begin{tabb}Creates a Power random variate generator with parameters
 $a =$\ \te...
 ...}, $b =$\ \texttt{b} and $c =$\ \texttt{c},
 using stream \texttt{s}.
 \end{tabb}


PowerGen

public PowerGen(RandomStream s,
                double c)
. \begin{tabb}Creates a Power random variate generator with parameters
 $a =0$, $b =1$\ and $c =$\ \texttt{c}, using stream \texttt{s}.
 \end{tabb}


PowerGen

public PowerGen(RandomStream s,
                PowerDist dist)
. \begin{tabb}Creates a new generator for the power distribution \texttt{dist}
 and stream \texttt{s}.
 \end{tabb}

Method Detail

nextDouble

public static double nextDouble(RandomStream s,
                                double a,
                                double b,
                                double c)
. \begin{tabb}
 Uses inversion to generate a new variate from the power
 distribut...
 ..., $b = $~\texttt{b}, and
 $c = $~\texttt{c}, using stream \texttt{s}.
 \end{tabb}


getA

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


getB

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


getC

public double getC()
. \begin{tabb}Returns the parameter $c$.
 \end{tabb}


setParams

public void setParams(double a,
                      double b,
                      double c)
. \begin{tabb}Sets the parameters $a$, $b$\ and $c$\ for this object.
 \end{tabb}

 


SSJ
V. labo.

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