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

This class implements Student random variate generators using the polar method of [13] . More...

Inheritance diagram for umontreal.ssj.randvar.StudentPolarGen:
umontreal.ssj.randvar.StudentGen umontreal.ssj.randvar.RandomVariateGen

Public Member Functions

 StudentPolarGen (RandomStream s, int n)
 Creates a Student random variate generator with \(n\) degrees of freedom, using stream s.
 StudentPolarGen (RandomStream s, StudentDist dist)
 Creates a new generator for the Student distribution dist and stream s.
double nextDouble ()
 Generates a random number from the continuous distribution contained in this object.
Public Member Functions inherited from umontreal.ssj.randvar.StudentGen
 StudentGen (RandomStream s, int n)
 Creates a Student random variate generator with \(n\) degrees of freedom, using stream s.
 StudentGen (RandomStream s, StudentDist dist)
 Creates a new generator for the Student distribution dist and stream s.
int getN ()
 Returns the value of \(n\) 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.
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 n)
 Generates a new variate from the Student distribution with \(n = \) n degrees of freedom, using stream s.

Detailed Description

This class implements Student random variate generators using the polar method of [13] .

The code is adapted from UNURAN (see [162] ).

The non-static nextDouble method generates two variates at a time and the second one is saved for the next call. A pair of variates is generated every second call. In the static case, two variates are generated per call but only the first one is returned and the second is discarded.

Definition at line 44 of file StudentPolarGen.java.

Constructor & Destructor Documentation

◆ StudentPolarGen() [1/2]

umontreal.ssj.randvar.StudentPolarGen.StudentPolarGen ( RandomStream s,
int n )

Creates a Student random variate generator with \(n\) degrees of freedom, using stream s.

Definition at line 55 of file StudentPolarGen.java.

◆ StudentPolarGen() [2/2]

umontreal.ssj.randvar.StudentPolarGen.StudentPolarGen ( RandomStream s,
StudentDist dist )

Creates a new generator for the Student distribution dist and stream s.

Definition at line 63 of file StudentPolarGen.java.

Member Function Documentation

◆ nextDouble() [1/2]

double umontreal.ssj.randvar.StudentPolarGen.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 69 of file StudentPolarGen.java.

◆ nextDouble() [2/2]

double umontreal.ssj.randvar.StudentPolarGen.nextDouble ( RandomStream s,
int n )
static

Generates a new variate from the Student distribution with \(n = \) n degrees of freedom, using stream s.

Reimplemented from umontreal.ssj.randvar.StudentGen.

Definition at line 85 of file StudentPolarGen.java.


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