SSJ  3.3.1 Stochastic Simulation in Java
ContinuousDistribution Class Referenceabstract

Classes implementing continuous distributions should inherit from this base class. More...

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

## Public Member Functions

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...

Public Member Functions inherited from Distribution
double cdf (double x)
Returns the distribution function $$F(x)$$. More...

double [] getParams ()
Returns the parameters of the distribution function in the same order as in the constructors.

int decPrec = 15

## Protected Attributes

double supportA = Double.NEGATIVE_INFINITY

double supportB = Double.POSITIVE_INFINITY

## Static Protected Attributes

static final double XBIG = 100.0

static final double XBIGM = 1000.0

static final double [] EPSARRAY

## Detailed Description

Classes implementing continuous distributions should inherit from this base class.

Such distributions are characterized by a density function $$f(x)$$, thus the signature of a density method is supplied here. This class also provides default implementations for $$\bar{F}(x)$$ and for $$F^{-1}(u)$$, the latter using the Brent-Dekker method to find the inverse of a generic distribution function $$F$$.

## ◆ barF()

 double barF ( double x )

Returns the complementary distribution function.

The default implementation computes $$\bar{F}(x) = 1 - F(x)$$.

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

Implements Distribution.

## ◆ density()

 abstract double density ( double x )
abstract

Returns $$f(x)$$, the density evaluated at $$x$$.

Parameters
 x value at which the density is evaluated
Returns
density function evaluated at x

## ◆ getMean()

 double getMean ( )

Returns the mean.

Returns
the mean

Implements Distribution.

## ◆ getStandardDeviation()

 double getStandardDeviation ( )

Returns the standard deviation.

Returns
the standard deviation

Implements Distribution.

## ◆ getVariance()

 double getVariance ( )

Returns the variance.

Returns
the variance

Implements Distribution.

## ◆ getXinf()

 double getXinf ( )

Returns $$x_a$$ such that the probability density is 0 everywhere outside the interval $$[x_a, x_b]$$.

Returns
lower limit of support

## ◆ getXsup()

 double getXsup ( )

Returns $$x_b$$ such that the probability density is 0 everywhere outside the interval $$[x_a, x_b]$$.

Returns
upper limit of support

## ◆ inverseBisection()

 double inverseBisection ( double u )

Computes and returns the inverse distribution function $$x = F^{-1}(u)$$, using bisection.

Restrictions: $$u \in[0,1]$$.

Parameters
 u value at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
 IllegalArgumentException if $$u$$ is not in the interval $$[0,1]$$

## ◆ inverseBrent()

 double inverseBrent ( double a, double b, double u, double tol )

Computes the inverse distribution function $$x = F^{-1}(u)$$, using the Brent-Dekker method.

The interval $$[a, b]$$ must contain the root $$x$$ such that $$F(a) \le u \le F(b)$$, where $$u=F(x)$$. The calculations are done with an approximate precision of tol. Returns $$x = F^{-1}(u)$$. Restrictions: $$u \in[0,1]$$.

Parameters
 a left endpoint of initial interval b right endpoint of initial interval u value at which the inverse distribution function is evaluated tol accuracy goal
Returns
inverse distribution function evaluated at u

## ◆ inverseF()

 double inverseF ( double u )

Returns the inverse distribution function $$x = F^{-1}(u)$$.

Restrictions: $$u \in[0,1]$$.

Parameters
 u value at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
 IllegalArgumentException if $$u$$ is not in the interval $$[0,1]$$

Implements Distribution.

## ◆ setXinf()

 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]$$.

Parameters
 xa lower limit of support

## ◆ setXsup()

 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]$$.

Parameters
 xb upper limit of support

## ◆ EPSARRAY

 final double [] EPSARRAY
staticprotected
Initial value:
= {
0.5, 0.5E-1, 0.5E-2, 0.5E-3, 0.5E-4, 0.5E-5, 0.5E-6, 0.5E-7, 0.5E-8,
0.5E-9, 0.5E-10, 0.5E-11, 0.5E-12, 0.5E-13, 0.5E-14, 0.5E-15, 0.5E-16,
0.5E-17, 0.5E-18, 0.5E-19, 0.5E-20, 0.5E-21, 0.5E-22, 0.5E-23, 0.5E-24,
0.5E-25, 0.5E-26, 0.5E-27, 0.5E-28, 0.5E-29, 0.5E-30, 0.5E-31, 0.5E-32,
0.5E-33, 0.5E-34, 0.5E-35
}

The documentation for this class was generated from the following file:
• ContinuousDistribution.java