SSJ  3.2.1
Stochastic Simulation in Java
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
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.
 

Public Attributes

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

Member Function Documentation

double barF ( double  x)

Returns the complementary distribution function.

The default implementation computes \(\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.

abstract double density ( double  x)
abstract

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

Parameters
xvalue at which the density is evaluated
Returns
density function evaluated at x
double getMean ( )

Returns the mean.

Returns
the mean

Implements Distribution.

double getStandardDeviation ( )

Returns the standard deviation.

Returns
the standard deviation

Implements Distribution.

double getVariance ( )

Returns the variance.

Returns
the variance

Implements Distribution.

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
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
double inverseBisection ( double  u)

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

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)
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
aleft endpoint of initial interval
bright endpoint of initial interval
uvalue at which the inverse distribution function is evaluated
tolaccuracy goal
Returns
inverse distribution function evaluated at u
double inverseF ( double  u)

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

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)

Implements Distribution.

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
xalower limit of support
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
xbupper limit of support

Member Data Documentation

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: