SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Static Public Member Functions | List of all members
RayleighDist Class Reference

This class extends the class ContinuousDistribution for the Rayleigh distribution [57]  with location parameter \(a\), and scale parameter \(\beta> 0\). More...

Inheritance diagram for RayleighDist:
[legend]
Collaboration diagram for RayleighDist:
[legend]

Public Member Functions

 RayleighDist (double beta)
 Constructs a RayleighDist object with parameters \(a = 0\) and \(\beta\) = beta.
 
 RayleighDist (double a, double beta)
 Constructs a RayleighDist object with parameters \(a =\) a, and \(\beta\) = beta.
 
double density (double x)
 
double cdf (double x)
 Returns the distribution function \(F(x)\). More...
 
double barF (double x)
 Returns \(\bar{F}(x) = 1 - F(x)\). More...
 
double inverseF (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), defined in ( inverseF ). More...
 
double getMean ()
 Returns the mean of the distribution function.
 
double getVariance ()
 Returns the variance of the distribution function.
 
double getStandardDeviation ()
 Returns the standard deviation of the distribution function.
 
double getA ()
 Returns the parameter \(a\). More...
 
double getSigma ()
 Returns the parameter \(\beta\). More...
 
void setParams (double a, double beta)
 Sets the parameters \(a\) and \(\beta\) for this object. More...
 
double [] getParams ()
 Return an array containing the parameters of the current distribution in the order: [ \(a\), \(\beta\)]. More...
 
String toString ()
 Returns a String containing information about the current distribution. More...
 
- Public Member Functions inherited from ContinuousDistribution
abstract double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\). More...
 
double barF (double x)
 Returns the complementary distribution function. More...
 
double inverseBrent (double a, double b, double u, double tol)
 Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method. More...
 
double inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection. More...
 
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\). More...
 
double getMean ()
 Returns the mean. More...
 
double getVariance ()
 Returns the variance. More...
 
double getStandardDeviation ()
 Returns the standard deviation. More...
 
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 
void setXinf (double xa)
 Sets the value \(x_a=\) xa, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 
void setXsup (double xb)
 Sets the value \(x_b=\) xb, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). More...
 

Static Public Member Functions

static double density (double a, double beta, double x)
 Computes the density function ( frayleigh ). More...
 
static double density (double beta, double x)
 Same as density (0, beta, x). More...
 
static double cdf (double a, double beta, double x)
 Computes the distribution function ( Frayleigh ). More...
 
static double cdf (double beta, double x)
 Same as cdf (0, beta, x). More...
 
static double barF (double a, double beta, double x)
 Computes the complementary distribution function. More...
 
static double barF (double beta, double x)
 Same as barF (0, beta, x). More...
 
static double inverseF (double a, double beta, double u)
 Computes the inverse of the distribution function ( Invrayleigh ). More...
 
static double inverseF (double beta, double u)
 Same as inverseF (0, beta, u). More...
 
static double [] getMLE (double[] x, int n, double a)
 Estimates the parameter \(\beta\) of the Rayleigh distribution using the maximum likelihood method, assuming that \(a\) is known, from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\). More...
 
static RayleighDist getInstanceFromMLE (double[] x, int n, double a)
 Creates a new instance of a Rayleigh distribution with parameters \(a\) and \(\hat{\beta}\). More...
 
static double getMean (double a, double beta)
 Returns the mean \(a + \beta\sqrt{\pi/2}\) of the Rayleigh distribution with parameters \(a\) and \(\beta\). More...
 
static double getVariance (double beta)
 Returns the variance of the Rayleigh distribution with parameter \(\beta\). More...
 
static double getStandardDeviation (double beta)
 Returns the standard deviation \(\beta\sqrt{2 - \pi/2}\) of the Rayleigh distribution with parameter \(\beta\). More...
 

Additional Inherited Members

- Public Attributes inherited from ContinuousDistribution
int decPrec = 15
 
- Protected Attributes inherited from ContinuousDistribution
double supportA = Double.NEGATIVE_INFINITY
 
double supportB = Double.POSITIVE_INFINITY
 
- Static Protected Attributes inherited from ContinuousDistribution
static final double XBIG = 100.0
 
static final double XBIGM = 1000.0
 
static final double [] EPSARRAY
 

Detailed Description

This class extends the class ContinuousDistribution for the Rayleigh distribution [57]  with location parameter \(a\), and scale parameter \(\beta> 0\).

The density function is

\[ f(x) = \frac{(x-a)}{\beta^2}  e^{-(x-a)^2/(2\beta^2)} \qquad\mbox{for } x \ge a, \tag{frayleigh} \]

and \(f(x) = 0\) for \(x < a\). The distribution function is

\[ F(x) = 1 - e^{-(x - a)^2/(2\beta^2)} \qquad\mbox{for } x \ge a, \tag{Frayleigh} \]

and the inverse distribution function is

\[ F^{-1}(u) = x = a + \beta\sqrt{-2\ln(1-u)} \qquad\mbox{for } 0 \le u \le1. \tag{Invrayleigh} \]

Member Function Documentation

◆ barF() [1/3]

double barF ( double  x)

Returns \(\bar{F}(x) = 1 - F(x)\).

Parameters
xvalue at which the complementary distribution function is evaluated
Returns
complementary distribution function evaluated at x

Implements Distribution.

◆ barF() [2/3]

static double barF ( double  a,
double  beta,
double  x 
)
static

Computes the complementary distribution function.

Parameters
athe location parameter
betathe scale parameter
xthe value at which the complementary distribution is evaluated
Returns
returns the complementary distribution function

◆ barF() [3/3]

static double barF ( double  beta,
double  x 
)
static

Same as barF (0, beta, x).

Parameters
betathe scale parameter
xthe value at which the complementary distribution is evaluated
Returns
returns the complementary distribution function

◆ cdf() [1/3]

double cdf ( double  x)

Returns the distribution function \(F(x)\).

Parameters
xvalue at which the distribution function is evaluated
Returns
distribution function evaluated at x

Implements Distribution.

◆ cdf() [2/3]

static double cdf ( double  a,
double  beta,
double  x 
)
static

Computes the distribution function ( Frayleigh ).

Parameters
athe location parameter
betathe scale parameter
xthe value at which the distribution is evaluated
Returns
returns the distribution function

◆ cdf() [3/3]

static double cdf ( double  beta,
double  x 
)
static

Same as cdf (0, beta, x).

Parameters
betathe scale parameter
xthe value at which the distribution is evaluated
Returns
returns the distribution function

◆ density() [1/2]

static double density ( double  a,
double  beta,
double  x 
)
static

Computes the density function ( frayleigh ).

Parameters
athe location parameter
betathe scale parameter
xthe value at which the density is evaluated
Returns
the density function

◆ density() [2/2]

static double density ( double  beta,
double  x 
)
static

Same as density (0, beta, x).

Parameters
betathe scale parameter
xthe value at which the density is evaluated
Returns
returns the density function

◆ getA()

double getA ( )

Returns the parameter \(a\).

Returns
the location parameter \(a\)

◆ getInstanceFromMLE()

static RayleighDist getInstanceFromMLE ( double []  x,
int  n,
double  a 
)
static

Creates a new instance of a Rayleigh distribution with parameters \(a\) and \(\hat{\beta}\).

This last is estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, …, n-1\).

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters
athe location parameter

◆ getMean()

static double getMean ( double  a,
double  beta 
)
static

Returns the mean \(a + \beta\sqrt{\pi/2}\) of the Rayleigh distribution with parameters \(a\) and \(\beta\).

Parameters
athe location parameter
betathe scale parameter
Returns
the mean of the Rayleigh distribution

◆ getMLE()

static double [] getMLE ( double []  x,
int  n,
double  a 
)
static

Estimates the parameter \(\beta\) of the Rayleigh distribution using the maximum likelihood method, assuming that \(a\) is known, from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\).

The estimate is returned in a one-element array: [ \(\hat{\beta}\)]. The maximum likelihood estimator is the value \(\hat{\beta}\) that satisfies the equation

\[ \hat{\beta} = \sqrt{\frac{1}{2n}\sum_{i=1}^n x_i^2} \]

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters
athe location parameter
Returns
returns the parameter [ \(\hat{\beta}\)]

◆ getParams()

double [] getParams ( )

Return an array containing the parameters of the current distribution in the order: [ \(a\), \(\beta\)].

Returns
[ \(a\), \(\beta\)]

Implements Distribution.

◆ getSigma()

double getSigma ( )

Returns the parameter \(\beta\).

Returns
the scale parameter \(beta\)

◆ getStandardDeviation()

static double getStandardDeviation ( double  beta)
static

Returns the standard deviation \(\beta\sqrt{2 - \pi/2}\) of the Rayleigh distribution with parameter \(\beta\).

Parameters
betathe scale parameter
Returns
the standard deviation of the Rayleigh distribution

◆ getVariance()

static double getVariance ( double  beta)
static

Returns the variance of the Rayleigh distribution with parameter \(\beta\).

Parameters
betathe scale parameter
Returns
the variance of the Rayleigh distribution

◆ inverseF() [1/3]

double inverseF ( double  u)

Returns the inverse distribution function \(F^{-1}(u)\), defined in ( inverseF ).

Parameters
uvalue in the interval \((0,1)\) for which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u

Implements Distribution.

◆ inverseF() [2/3]

static double inverseF ( double  a,
double  beta,
double  u 
)
static

Computes the inverse of the distribution function ( Invrayleigh ).

Parameters
athe location parameter
betathe scale parameter
uthe value at which the inverse distribution is evaluated
Returns
returns the inverse of the distribution function

◆ inverseF() [3/3]

static double inverseF ( double  beta,
double  u 
)
static

Same as inverseF (0, beta, u).

Parameters
betathe scale parameter
uthe value at which the inverse distribution is evaluated
Returns
returns the inverse of the distribution function

◆ setParams()

void setParams ( double  a,
double  beta 
)

Sets the parameters \(a\) and \(\beta\) for this object.

Parameters
athe location parameter
betathe scale parameter

◆ toString()

String toString ( )

Returns a String containing information about the current distribution.

Returns
a String containing information about the current distribution

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