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

This class implements random variate generators for the chi distribution. More...

Inheritance diagram for umontreal.ssj.randvar.ChiGen:
umontreal.ssj.randvar.RandomVariateGen umontreal.ssj.randvar.ChiRatioOfUniformsGen

Public Member Functions

 ChiGen (RandomStream s, int nu)
 Creates a chi random variate generator with \(\nu=\) nu degrees of freedom, using stream s.
 ChiGen (RandomStream s, ChiDist dist)
 Create a new generator for the distribution dist, using stream s.
int getNu ()
 Returns the value of \(\nu\) for 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.
double nextDouble ()
 Generates a random number from the continuous distribution contained in this object.
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 s, int nu)
 Generates a random variate from the chi distribution with \(\nu= \) nu degrees of freedom, using stream s.

Detailed Description

This class implements random variate generators for the chi distribution.

It has \(\nu>0\) degrees of freedom and its density function is (see [95] , page 417)

\[ f (x) = \frac{e^{-x^2 /2} x^{\nu-1}}{2^{(\nu/2) - 1}\Gamma(\nu/2)} \qquad\mbox{for } x > 0, \tag{Fchi} \]

where \(\Gamma(x)\) is the gamma function defined in ( Gamma ).

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

Definition at line 47 of file ChiGen.java.

Constructor & Destructor Documentation

◆ ChiGen() [1/2]

umontreal.ssj.randvar.ChiGen.ChiGen ( RandomStream s,
int nu )

Creates a chi random variate generator with \(\nu=\) nu degrees of freedom, using stream s.

Definition at line 54 of file ChiGen.java.

◆ ChiGen() [2/2]

umontreal.ssj.randvar.ChiGen.ChiGen ( RandomStream s,
ChiDist dist )

Create a new generator for the distribution dist, using stream s.

Definition at line 62 of file ChiGen.java.

Member Function Documentation

◆ getNu()

int umontreal.ssj.randvar.ChiGen.getNu ( )

Returns the value of \(\nu\) for this object.

Definition at line 82 of file ChiGen.java.

◆ nextDouble()

double umontreal.ssj.randvar.ChiGen.nextDouble ( RandomStream s,
int nu )
static

Generates a random variate from the chi distribution with \(\nu= \) nu degrees of freedom, using stream s.

Reimplemented in umontreal.ssj.randvar.ChiRatioOfUniformsGen.

Definition at line 73 of file ChiGen.java.


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