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

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

Inheritance diagram for umontreal.ssj.randvar.CauchyGen:
umontreal.ssj.randvar.RandomVariateGen

Public Member Functions

 CauchyGen (RandomStream s, double alpha, double beta)
 Creates a Cauchy random variate generator with parameters.
 CauchyGen (RandomStream s)
 Creates a Cauchy random variate generator with parameters \(\alpha=0 \) and \(\beta= 1\), using stream s.
 CauchyGen (RandomStream s, CauchyDist dist)
 Create a new generator for the distribution dist, using stream s.
double getAlpha ()
 Returns the parameter \(\alpha\) of this object.
double getBeta ()
 Returns the parameter \(\beta\) of 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, double alpha, double beta)
 Generates a new variate from the Cauchy distribution with parameters \(\alpha= \) alpha and \(\beta= \) beta, using stream s.

Detailed Description

This class implements random variate generators for the Cauchy distribution.

The density is (see, e.g., [95]  p. 299):

\[ f (x) = \frac{\beta}{\pi[(x-\alpha)^2 + \beta^2]}, \qquad\mbox{for } -\infty< x < \infty, \tag{fcauchy} \]

where \(\beta> 0\).

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

Definition at line 45 of file CauchyGen.java.

Constructor & Destructor Documentation

◆ CauchyGen() [1/3]

umontreal.ssj.randvar.CauchyGen.CauchyGen ( RandomStream s,
double alpha,
double beta )

Creates a Cauchy random variate generator with parameters.

\(\alpha=\) alpha and \(\beta\) = beta, using stream s.

Definition at line 54 of file CauchyGen.java.

◆ CauchyGen() [2/3]

umontreal.ssj.randvar.CauchyGen.CauchyGen ( RandomStream s)

Creates a Cauchy random variate generator with parameters \(\alpha=0 \) and \(\beta= 1\), using stream s.

Definition at line 63 of file CauchyGen.java.

◆ CauchyGen() [3/3]

umontreal.ssj.randvar.CauchyGen.CauchyGen ( RandomStream s,
CauchyDist dist )

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

Definition at line 70 of file CauchyGen.java.

Member Function Documentation

◆ getAlpha()

double umontreal.ssj.randvar.CauchyGen.getAlpha ( )

Returns the parameter \(\alpha\) of this object.

Definition at line 89 of file CauchyGen.java.

◆ getBeta()

double umontreal.ssj.randvar.CauchyGen.getBeta ( )

Returns the parameter \(\beta\) of this object.

Definition at line 96 of file CauchyGen.java.

◆ nextDouble()

double umontreal.ssj.randvar.CauchyGen.nextDouble ( RandomStream s,
double alpha,
double beta )
static

Generates a new variate from the Cauchy distribution with parameters \(\alpha= \) alpha and \(\beta= \) beta, using stream s.

Definition at line 82 of file CauchyGen.java.


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