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

Extends the class ContinuousDistribution for the power distribution [57]  (page 161) with shape parameter \(c > 0\), over the interval \([a,b]\), where \(a < b\). More...

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

Public Member Functions

 PowerDist (double a, double b, double c)
 Constructs a PowerDist object with parameters \(a =\) a, \(b =\) b and \(c =\) c.
 
 PowerDist (double b, double c)
 Constructs a PowerDist object with parameters \(a = 0\), \(b =\) b and \(c =\) c.
 
 PowerDist (double c)
 Constructs a PowerDist object with parameters \(a = 0\), \(b =1\) and \(c =\) c.
 
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 getB ()
 Returns the parameter \(b\). More...
 
double getC ()
 Returns the parameter \(c\). More...
 
void setParams (double a, double b, double c)
 Sets the parameters \(a\), \(b\) and \(c\) for this object. More...
 
double [] getParams ()
 Return a table containing the parameters of the current distribution. 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 b, double c, double x)
 Computes the density function ( fpower ). More...
 
static double cdf (double a, double b, double c, double x)
 Computes the distribution function ( Fpower ). More...
 
static double barF (double a, double b, double c, double x)
 Computes the complementary distribution function. More...
 
static double inverseF (double a, double b, double c, double u)
 Computes the inverse of the distribution function. More...
 
static double [] getMLE (double[] x, int n, double a, double b)
 Estimates the parameter \(c\) of the power distribution from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\), using the maximum likelihood method and assuming that \(a\) and \(b\) are known. More...
 
static PowerDist getInstanceFromMLE (double[] x, int n, double a, double b)
 Creates a new instance of a power distribution with parameters \(a\) and \(b\), with \(c\) estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, …, n-1\). More...
 
static double getMean (double a, double b, double c)
 Returns the mean \(a + (b-a)c/(c+1)\) of the power distribution with parameters \(a\), \(b\) and \(c\). More...
 
static double getVariance (double a, double b, double c)
 Computes and returns the variance \((b-a)^2 c / [(c+1)^2(c+2)]\) of the power distribution with parameters \(a\), \(b\) and \(c\). More...
 
static double getStandardDeviation (double a, double b, double c)
 Computes and returns the standard deviation of the power distribution with parameters \(a\), \(b\) and \(c\). 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

Extends the class ContinuousDistribution for the power distribution [57]  (page 161) with shape parameter \(c > 0\), over the interval \([a,b]\), where \(a < b\).

This distribution has density

\[ f(x) = \frac{c(x-a)^{c - 1}}{(b - a)^c}, \qquad\mbox{for } a \le x \le b, \tag{fpower} \]

and \(f(x) = 0\) elsewhere. Its distribution function is

\[ F(x) = \frac{(x - a)^c}{(b - a)^c}, \qquad\mbox{for } a \le x \le b, \tag{Fpower} \]

with \(F(x) = 0\) for \(x \le a\) and \(F(x) = 1\) for \(x \ge b\).

Member Function Documentation

◆ barF() [1/2]

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/2]

static double barF ( double  a,
double  b,
double  c,
double  x 
)
static

Computes the complementary distribution function.

Parameters
aleft limit of interval
bright limit of interval
cshape parameter
xthe value at which the complementary distribution is evaluated
Returns
returns the complementary distribution function

◆ cdf() [1/2]

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/2]

static double cdf ( double  a,
double  b,
double  c,
double  x 
)
static

Computes the distribution function ( Fpower ).

Parameters
aleft limit of interval
bright limit of interval
cshape parameter
xthe value at which the distribution is evaluated
Returns
returns the distribution function

◆ density()

static double density ( double  a,
double  b,
double  c,
double  x 
)
static

Computes the density function ( fpower ).

Parameters
aleft limit of interval
bright limit of interval
cshape parameter
xthe value at which the density is evaluated
Returns
returns the density function

◆ getA()

double getA ( )

Returns the parameter \(a\).

Returns
the left limit of interval \(a\)

◆ getB()

double getB ( )

Returns the parameter \(b\).

Returns
the right limit of interval \(b\)

◆ getC()

double getC ( )

Returns the parameter \(c\).

Returns
the shape parameter \(c\)

◆ getInstanceFromMLE()

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

Creates a new instance of a power distribution with parameters \(a\) and \(b\), with \(c\) 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
aleft limit of interval
bright limit of interval

◆ getMean()

static double getMean ( double  a,
double  b,
double  c 
)
static

Returns the mean \(a + (b-a)c/(c+1)\) of the power distribution with parameters \(a\), \(b\) and \(c\).

Parameters
aleft limit of interval
bright limit of interval
cshape parameter
Returns
returns the mean

◆ getMLE()

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

Estimates the parameter \(c\) of the power distribution from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\), using the maximum likelihood method and assuming that \(a\) and \(b\) are known.

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

\begin{align*} \frac{1}{\hat{c}} = -\frac{1}{n} \sum_{i=1}^n \ln\left(\frac{x_i - a}{b - a} \right) \end{align*}

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters
aleft limit of interval
bright limit of interval
Returns
returns the shape parameter [ \(\hat{c}\)]

◆ getParams()

double [] getParams ( )

Return a table containing the parameters of the current distribution.

This table is put in regular order: [ \(a\), \(b\), \(c\)].

Returns
[ \(a\), \(b, \)c]

Implements Distribution.

◆ getStandardDeviation()

static double getStandardDeviation ( double  a,
double  b,
double  c 
)
static

Computes and returns the standard deviation of the power distribution with parameters \(a\), \(b\) and \(c\).

Returns
the standard deviation of the power distribution

◆ getVariance()

static double getVariance ( double  a,
double  b,
double  c 
)
static

Computes and returns the variance \((b-a)^2 c / [(c+1)^2(c+2)]\) of the power distribution with parameters \(a\), \(b\) and \(c\).

Parameters
aleft limit of interval
bright limit of interval
cshape parameter
Returns
returns the variance

◆ inverseF() [1/2]

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/2]

static double inverseF ( double  a,
double  b,
double  c,
double  u 
)
static

Computes the inverse of the distribution function.

Parameters
aleft limit of interval
bright limit of interval
cshape parameter
uthe value at which the inverse distribution is evaluated
Returns
returns the inverse of the distribution function

◆ setParams()

void setParams ( double  a,
double  b,
double  c 
)

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

Parameters
aleft limit of interval
bright limit of interval
cshape 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: