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

This class implements the hypoexponential distribution, also called the generalized Erlang distribution. More...

Inheritance diagram for umontreal.ssj.probdist.HypoExponentialDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution umontreal.ssj.probdist.HypoExponentialDistEqual umontreal.ssj.probdist.HypoExponentialDistQuick

Public Member Functions

 HypoExponentialDist (double[] lambda)
 Constructs a HypoExponentialDist object, with rates \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).
double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\).
double cdf (double x)
 Returns the distribution function \(F(x)\).
double barF (double x)
 Returns the complementary distribution function.
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\).
double getMean ()
 Returns the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
double[] getLambda ()
 Returns the values \(\lambda_i\) for this object.
void setLambda (double[] lambda)
 Sets the values \(\lambda_i = \)lambda[ \(i-1\)], \(i = 1,…,k\) for this object.
double[] getParams ()
 Same as getLambda.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.ContinuousDistribution
double inverseBrent (double a, double b, double u, double tol)
 Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method.
double inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection.
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
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]\).
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]\).

Static Public Member Functions

static double density (double[] lambda, double x)
 Computes the density function \(f(x)\), with \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).
static double cdf (double[] lambda, double x)
 Computes the distribution function \(F(x)\), with \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).
static double cdf2 (double[] lambda, double x)
 Computes the distribution function \(F(x)\), with \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).
static double barF (double[] lambda, double x)
 Computes the complementary distribution \(\bar{F}(x)\), with.
static double inverseF (double[] lambda, double u)
 Computes the inverse distribution function \(F^{-1}(u)\), with.
static double getMean (double[] lambda)
 Returns the mean, \(E[X] = \sum_{i=1}^k 1/\lambda_i\), of the hypoexponential distribution with rates \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).
static double getVariance (double[] lambda)
 Returns the variance, \(\mbox{Var}[X] = \sum_{i=1}^k 1/\lambda_i^2\), of the hypoexponential distribution with rates.
static double getStandardDeviation (double[] lambda)
 Returns the standard deviation of the hypoexponential distribution with rates \(\lambda_i = \) lambda[ \(i-1\)],.

Detailed Description

This class implements the hypoexponential distribution, also called the generalized Erlang distribution.

Let the \(X_j\), \(j=1,…,k\), be

\(k\) independent exponential random variables with different rates \(\lambda_j\), i.e. assume that \(\lambda_j \neq\lambda_i\) for \(i \neq j\). Then the sum \(\sum_{j=1}^kX_j\) is called a hypoexponential random variable.

Let the \(k\times k\) upper triangular bidiagonal matrix

\[ \tag{tail-hypomatrix} \mathbf{A}= \begin{pmatrix} -\lambda_1 & \lambda_1 & 0 & … & 0 \\ 0 & -\lambda_2 & \lambda_2 & … & 0 \\ \vdots & \vdots & \ddots &   \ddots & \vdots \\ 0 & … & 0 & -\lambda_{k-1} & \lambda_{k-1} \\ 0 & … & 0 & 0 & -\lambda_k \end{pmatrix} \]

with \(\lambda_j\) the rates of the \(k\) exponential random variables; then the cumulative complementary probability of the hypoexponential distribution is given by [pNEU81a], [112]

\[ \tag{tail-hypoexp} \bar{F}(x) = \mathbb P \left[X_1 + \cdots+ X_k > x \right] = \sum_{j=1}^k \left(e^{\mathbf{A}x}\right)_{1j}, \]

i.e., it is the sum of the elements of the first row of matrix \(e^{\mathbf{A}x}\). The density of the hypoexponential distribution is

\[ f(x) = \left(-e^{\mathbf{A}x}\mathbf{A}\right)_{1k} = \lambda_k \left(e^{\mathbf{A}x}\right)_{1k}, \tag{fhypoexp} \]

i.e., it is element \((1,k)\) of matrix \(-e^{\mathbf{A}x}\mathbf{A}\). The distribution function is as usual \(F(x) = 1 - \bar{F}(x)\).

See the class HypoExponentialDistQuick for alternative formulae for the probabilities.

Definition at line 74 of file HypoExponentialDist.java.

Constructor & Destructor Documentation

◆ HypoExponentialDist()

umontreal.ssj.probdist.HypoExponentialDist.HypoExponentialDist ( double[] lambda)

Constructs a HypoExponentialDist object, with rates \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution

Definition at line 120 of file HypoExponentialDist.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.HypoExponentialDist.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

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistEqual, and umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 133 of file HypoExponentialDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.HypoExponentialDist.barF ( double[] lambda,
double x )
static

Computes the complementary distribution \(\bar{F}(x)\), with.

\(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution
xvalue at which the complementary distribution is evaluated
Returns
complementary distribution at \(x\)

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 227 of file HypoExponentialDist.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.HypoExponentialDist.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 umontreal.ssj.probdist.Distribution.

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistEqual, and umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 129 of file HypoExponentialDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.HypoExponentialDist.cdf ( double[] lambda,
double x )
static

Computes the distribution function \(F(x)\), with \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution
xvalue at which the distribution is evaluated
Returns
distribution at \(x\)

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 178 of file HypoExponentialDist.java.

◆ cdf2()

double umontreal.ssj.probdist.HypoExponentialDist.cdf2 ( double[] lambda,
double x )
static

Computes the distribution function \(F(x)\), with \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Returns \(1 - \)barF(lambda, x), which is much faster than cdf but loses precision in the lower tail.

Parameters
lambdarates of the hypoexponential distribution
xvalue at which the distribution is evaluated
Returns
distribution at \(x\)

Definition at line 211 of file HypoExponentialDist.java.

◆ density() [1/2]

double umontreal.ssj.probdist.HypoExponentialDist.density ( double x)

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

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

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistEqual, and umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 125 of file HypoExponentialDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.HypoExponentialDist.density ( double[] lambda,
double x )
static

Computes the density function \(f(x)\), with \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution
xvalue at which the density is evaluated
Returns
density at \(x\)

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 161 of file HypoExponentialDist.java.

◆ getLambda()

double[] umontreal.ssj.probdist.HypoExponentialDist.getLambda ( )

Returns the values \(\lambda_i\) for this object.

Definition at line 324 of file HypoExponentialDist.java.

◆ getMean() [1/2]

double umontreal.ssj.probdist.HypoExponentialDist.getMean ( )

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 141 of file HypoExponentialDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.HypoExponentialDist.getMean ( double[] lambda)
static

Returns the mean, \(E[X] = \sum_{i=1}^k 1/\lambda_i\), of the hypoexponential distribution with rates \(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution
Returns
mean of the hypoexponential distribution

Definition at line 282 of file HypoExponentialDist.java.

◆ getParams()

double[] umontreal.ssj.probdist.HypoExponentialDist.getParams ( )

◆ getStandardDeviation() [1/2]

double umontreal.ssj.probdist.HypoExponentialDist.getStandardDeviation ( )

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 149 of file HypoExponentialDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.HypoExponentialDist.getStandardDeviation ( double[] lambda)
static

Returns the standard deviation of the hypoexponential distribution with rates \(\lambda_i = \) lambda[ \(i-1\)],.

\(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution
Returns
standard deviation of the hypoexponential distribution

Definition at line 316 of file HypoExponentialDist.java.

◆ getVariance() [1/2]

double umontreal.ssj.probdist.HypoExponentialDist.getVariance ( )

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 145 of file HypoExponentialDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.HypoExponentialDist.getVariance ( double[] lambda)
static

Returns the variance, \(\mbox{Var}[X] = \sum_{i=1}^k 1/\lambda_i^2\), of the hypoexponential distribution with rates.

\(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution
Returns
variance of the hypoexponential distribution

Definition at line 299 of file HypoExponentialDist.java.

◆ inverseF() [1/2]

double umontreal.ssj.probdist.HypoExponentialDist.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]\)

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistEqual, and umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 137 of file HypoExponentialDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.HypoExponentialDist.inverseF ( double[] lambda,
double u )
static

Computes the inverse distribution function \(F^{-1}(u)\), with.

\(\lambda_i = \) lambda[ \(i-1\)], \(i = 1,…,k\).

Parameters
lambdarates of the hypoexponential distribution
uvalue at which the inverse distribution is evaluated
Returns
inverse distribution at \(u\)

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 248 of file HypoExponentialDist.java.

◆ setLambda()

void umontreal.ssj.probdist.HypoExponentialDist.setLambda ( double[] lambda)

Sets the values \(\lambda_i = \)lambda[ \(i-1\)], \(i = 1,…,k\) for this object.

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 333 of file HypoExponentialDist.java.

◆ toString()

String umontreal.ssj.probdist.HypoExponentialDist.toString ( )

Returns a String containing information about the current distribution.

Reimplemented in umontreal.ssj.probdist.HypoExponentialDistEqual, and umontreal.ssj.probdist.HypoExponentialDistQuick.

Definition at line 352 of file HypoExponentialDist.java.


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