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

Extends the class GammaDist for the special case of the Erlang distribution with shape parameter \(k > 0\) and scale parameter. More...

Inheritance diagram for umontreal.ssj.probdist.ErlangDist:
umontreal.ssj.probdist.GammaDist umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution

Public Member Functions

 ErlangDist (int k)
 Constructs a ErlangDist object with parameters \(k\) = k and \(\lambda=1\).
 ErlangDist (int k, double lambda)
 Constructs a ErlangDist object with parameters \(k\) = k and.
int getK ()
 Returns the parameter \(k\) for this object.
void setParams (int k, double lambda, int d)
 Sets the parameters \(k\) and \(\lambda\) of the distribution for this object.
double[] getParams ()
 Return a table containing parameters of the current distribution.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.GammaDist
 GammaDist (double alpha)
 Constructs a GammaDist object with parameters \(\alpha\) = alpha and \(\lambda=1\).
 GammaDist (double alpha, double lambda)
 Constructs a GammaDist object with parameters \(\alpha\) = alpha and \(\lambda\) = lambda.
 GammaDist (double alpha, double lambda, int d)
 Constructs a GammaDist object with parameters \(\alpha\) = alpha and \(\lambda\) = lambda, and approximations of roughly d decimal digits of precision when computing functions.
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 getAlpha ()
 Return the parameter \(\alpha\) for this object.
double getLambda ()
 Return the parameter \(\lambda\) for this object.
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 (int k, double lambda, double x)
 Computes the density function.
static double cdf (int k, double lambda, int d, double x)
 Computes the distribution function using the gamma distribution function.
static double barF (int k, double lambda, int d, double x)
 Computes the complementary distribution function.
static double inverseF (int k, double lambda, int d, double u)
 Returns the inverse distribution function.
static double[] getMLE (double[] x, int n)
 Estimates the parameters \((k,\lambda)\) of the Erlang distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).
static ErlangDist getInstanceFromMLE (double[] x, int n)
 Creates a new instance of an Erlang distribution with parameters.
static double getMean (int k, double lambda)
 Computes and returns the mean, \(E[X] = k/\lambda\), of the Erlang distribution with parameters \(k\) and \(\lambda\).
static double getVariance (int k, double lambda)
 Computes and returns the variance, \(\mbox{Var}[X] = k/\lambda^2\), of the Erlang distribution with parameters \(k\) and \(\lambda\).
static double getStandardDeviation (int k, double lambda)
 Computes and returns the standard deviation of the Erlang distribution with parameters \(k\) and \(\lambda\).
Static Public Member Functions inherited from umontreal.ssj.probdist.GammaDist
static double density (double alpha, double lambda, double x)
 Computes the density function ( fgamma ) at \(x\).
static double cdf (double alpha, double lambda, int d, double x)
 Returns an approximation of the gamma distribution function with parameters \(\alpha\) = alpha and \(\lambda\) = lambda, whose density is given by ( fgamma ).
static double cdf (double alpha, int d, double x)
 Equivalent to cdf (alpha, 1.0, d, x).
static double barF (double alpha, double lambda, int d, double x)
 Computes the complementary distribution function.
static double barF (double alpha, int d, double x)
 Same as barF(alpha, 1.0, d, x).
static double inverseF (double alpha, double lambda, int d, double u)
 Computes the inverse distribution function.
static double inverseF (double alpha, int d, double u)
 Same as inverseF(alpha, 1, d, u).
static double getMean (double alpha, double lambda)
 Computes and returns the mean \(E[X] = \alpha/\lambda\) of the gamma distribution with parameters \(\alpha\) and \(\lambda\).
static double getVariance (double alpha, double lambda)
 Computes and returns the variance \(\mbox{Var}[X] = \alpha/\lambda^2\) of the gamma distribution with parameters.
static double getStandardDeviation (double alpha, double lambda)
 Computes and returns the standard deviation of the gamma distribution with parameters \(\alpha\) and \(\lambda\).

Detailed Description

Extends the class GammaDist for the special case of the Erlang distribution with shape parameter \(k > 0\) and scale parameter.

\(\lambda> 0\). This distribution is a special case of the gamma distribution for which the shape parameter \(k=\alpha\) is an integer.

Definition at line 39 of file ErlangDist.java.

Constructor & Destructor Documentation

◆ ErlangDist() [1/2]

umontreal.ssj.probdist.ErlangDist.ErlangDist ( int k)

Constructs a ErlangDist object with parameters \(k\) = k and \(\lambda=1\).

Definition at line 45 of file ErlangDist.java.

◆ ErlangDist() [2/2]

umontreal.ssj.probdist.ErlangDist.ErlangDist ( int k,
double lambda )

Constructs a ErlangDist object with parameters \(k\) = k and.

\(\lambda\) = lambda.

Definition at line 54 of file ErlangDist.java.

Member Function Documentation

◆ barF()

double umontreal.ssj.probdist.ErlangDist.barF ( int k,
double lambda,
int d,
double x )
static

Computes the complementary distribution function.

Definition at line 75 of file ErlangDist.java.

◆ cdf()

double umontreal.ssj.probdist.ErlangDist.cdf ( int k,
double lambda,
int d,
double x )
static

Computes the distribution function using the gamma distribution function.

Definition at line 68 of file ErlangDist.java.

◆ density()

double umontreal.ssj.probdist.ErlangDist.density ( int k,
double lambda,
double x )
static

Computes the density function.

Definition at line 61 of file ErlangDist.java.

◆ getInstanceFromMLE()

ErlangDist umontreal.ssj.probdist.ErlangDist.getInstanceFromMLE ( double[] x,
int n )
static

Creates a new instance of an Erlang distribution with parameters.

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

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters

Reimplemented from umontreal.ssj.probdist.GammaDist.

Definition at line 115 of file ErlangDist.java.

◆ getK()

int umontreal.ssj.probdist.ErlangDist.getK ( )

Returns the parameter \(k\) for this object.

Definition at line 168 of file ErlangDist.java.

◆ getMean()

double umontreal.ssj.probdist.ErlangDist.getMean ( int k,
double lambda )
static

Computes and returns the mean, \(E[X] = k/\lambda\), of the Erlang distribution with parameters \(k\) and \(\lambda\).

Returns
the mean of the Erlang distribution \(E[X] = k / \lambda\)

Definition at line 126 of file ErlangDist.java.

◆ getMLE()

double[] umontreal.ssj.probdist.ErlangDist.getMLE ( double[] x,
int n )
static

Estimates the parameters \((k,\lambda)\) of the Erlang distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).

The estimates are returned in a two-element array, in regular order: [ \(k\), \(\lambda\)]. The equations of the maximum likelihood are the same as for the gamma distribution. The \(k\) parameter is the rounded value of the \(\alpha\) parameter of the gamma distribution, and the \(\lambda\) parameter is equal to the

\(\beta\) parameter of the gamma distribution.

Parameters
xthe list of observations used to evaluate parameters
nthe number of observations used to evaluate parameters
Returns
returns the parameters [ \(\hat{k}\), \(\hat{\lambda}\)]

Reimplemented from umontreal.ssj.probdist.GammaDist.

Definition at line 101 of file ErlangDist.java.

◆ getParams()

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

Return a table containing parameters of the current distribution.

This table is put in regular order: [ \(k\), \(\lambda\)].

Reimplemented from umontreal.ssj.probdist.GammaDist.

Definition at line 185 of file ErlangDist.java.

◆ getStandardDeviation()

double umontreal.ssj.probdist.ErlangDist.getStandardDeviation ( int k,
double lambda )
static

Computes and returns the standard deviation of the Erlang distribution with parameters \(k\) and \(\lambda\).

Returns
the standard deviation of the Erlang distribution

Definition at line 156 of file ErlangDist.java.

◆ getVariance()

double umontreal.ssj.probdist.ErlangDist.getVariance ( int k,
double lambda )
static

Computes and returns the variance, \(\mbox{Var}[X] = k/\lambda^2\), of the Erlang distribution with parameters \(k\) and \(\lambda\).

Returns
the variance of the Erlang distribution \(\mbox{Var}[X] = k / \lambda^2\)

Definition at line 141 of file ErlangDist.java.

◆ inverseF()

double umontreal.ssj.probdist.ErlangDist.inverseF ( int k,
double lambda,
int d,
double u )
static

Returns the inverse distribution function.

Definition at line 82 of file ErlangDist.java.

◆ setParams()

void umontreal.ssj.probdist.ErlangDist.setParams ( int k,
double lambda,
int d )

Sets the parameters \(k\) and \(\lambda\) of the distribution for this object.

Non-static methods are computed with a rough target of d decimal digits of precision.

Definition at line 177 of file ErlangDist.java.

◆ toString()

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

Returns a String containing information about the current distribution.

Reimplemented from umontreal.ssj.probdist.GammaDist.

Definition at line 192 of file ErlangDist.java.


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