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

This class implements random variate generators for the power distribution with shape parameter \(c > 0\), over the interval. More...

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

Public Member Functions

 PowerGen (RandomStream s, double a, double b, double c)
 Creates a Power random variate generator with parameters \(a =\) a, \(b =\) b and \(c =\) c, using stream s.
 PowerGen (RandomStream s, double c)
 Creates a Power random variate generator with parameters \(a =0\),.
 PowerGen (RandomStream s, PowerDist dist)
 Creates a new generator for the power distribution dist and stream s.
double getA ()
 Returns the parameter \(a\).
double getB ()
 Returns the parameter \(b\).
double getC ()
 Returns the parameter \(c\).
void setParams (double a, double b, double c)
 Sets the parameters \(a\), \(b\) and \(c\) 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, double a, double b, double c)
 Uses inversion to generate a new variate from the power distribution with parameters \(a = \) a, \(b = \) b, and \(c = \) c, using stream s.

Detailed Description

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) = \frac{c(x-a)^{c - 1}}{(b - a)^c}, \tag{fpower} \]

for \(a \le x \le b\), and 0 elsewhere.

Definition at line 42 of file PowerGen.java.

Constructor & Destructor Documentation

◆ PowerGen() [1/3]

umontreal.ssj.randvar.PowerGen.PowerGen ( RandomStream s,
double a,
double b,
double c )

Creates a Power random variate generator with parameters \(a =\) a, \(b =\) b and \(c =\) c, using stream s.

Definition at line 51 of file PowerGen.java.

◆ PowerGen() [2/3]

umontreal.ssj.randvar.PowerGen.PowerGen ( RandomStream s,
double c )

Creates a Power random variate generator with parameters \(a =0\),.

\(b =1\) and \(c =\) c, using stream s.

Definition at line 61 of file PowerGen.java.

◆ PowerGen() [3/3]

umontreal.ssj.randvar.PowerGen.PowerGen ( RandomStream s,
PowerDist dist )

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

Definition at line 69 of file PowerGen.java.

Member Function Documentation

◆ getA()

double umontreal.ssj.randvar.PowerGen.getA ( )

Returns the parameter \(a\).

Definition at line 88 of file PowerGen.java.

◆ getB()

double umontreal.ssj.randvar.PowerGen.getB ( )

Returns the parameter \(b\).

Definition at line 95 of file PowerGen.java.

◆ getC()

double umontreal.ssj.randvar.PowerGen.getC ( )

Returns the parameter \(c\).

Definition at line 102 of file PowerGen.java.

◆ nextDouble()

double umontreal.ssj.randvar.PowerGen.nextDouble ( RandomStream s,
double a,
double b,
double c )
static

Uses inversion to generate a new variate from the power distribution with parameters \(a = \) a, \(b = \) b, and \(c = \) c, using stream s.

Definition at line 81 of file PowerGen.java.

◆ setParams()

void umontreal.ssj.randvar.PowerGen.setParams ( double a,
double b,
double c )

Sets the parameters \(a\), \(b\) and \(c\) for this object.

Definition at line 109 of file PowerGen.java.


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