SSJ
V. labo.

umontreal.iro.lecuyer.randvar
Class ChiGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.ChiGen
Direct Known Subclasses:
ChiRatioOfUniformsGen

public class ChiGen
extends RandomVariateGen

ChiGen

This class implements random variate generators for the chi distribution. It has ν > 0 degrees of freedom and its density function is

f (x) = e-x2/2xν-1/(2(ν/2)-1Γ(ν/2))        for x > 0

where Γ(x) is the gamma function defined in GammaGen.

The (non-static) nextDouble method simply calls inverseF on the distribution (slow).


Constructor Summary
ChiGen(RandomStream s, ChiDist dist)
          .
ChiGen(RandomStream s, int nu)
          .
 
Method Summary
 int getNu()
          .
static double nextDouble(RandomStream s, int nu)
          .
 
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

ChiGen

public ChiGen(RandomStream s,
              int nu)
. \begin{tabb}Creates a \emph{chi} random variate generator with
 $\nu =$\ \texttt{nu} degrees of freedom, using stream \texttt{s}.
 \end{tabb}


ChiGen

public ChiGen(RandomStream s,
              ChiDist dist)
. \begin{tabb}Create a new generator for the distribution \texttt{dist},
 using stream \texttt{s}.
 \end{tabb}

Method Detail

nextDouble

public static double nextDouble(RandomStream s,
                                int nu)
. \begin{tabb}
 Generates a random variate from the chi distribution with $\nu = $~\texttt{nu}
 degrees of freedom, using stream \texttt{s}.
 \end{tabb}


getNu

public int getNu()
. \begin{tabb}
 Returns the value of $\nu$\ for this object.
 \end{tabb}

 


SSJ
V. labo.

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