SSJ
V. labo.

umontreal.iro.lecuyer.probdist
Class ErlangDist

java.lang.Object
  extended by umontreal.iro.lecuyer.probdist.ContinuousDistribution
      extended by umontreal.iro.lecuyer.probdist.GammaDist
          extended by umontreal.iro.lecuyer.probdist.ErlangDist
All Implemented Interfaces:
Distribution

public class ErlangDist
extends GammaDist

ErlangDist

Extends the class GammaDist for the special case of the Erlang distribution with shape parameter k > 0 and scale parameter λ > 0. This distribution is a special case of the gamma distribution for which the shape parameter k = α is an integer.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
decPrec
 
Constructor Summary
ErlangDist(int k)
          .
ErlangDist(int k, double lambda)
          .
 
Method Summary
static double barF(int k, double lambda, int d, double x)
          .
static double cdf(int k, double lambda, int d, double x)
          .
static double density(int k, double lambda, double x)
          .
static ErlangDist getInstanceFromMLE(double[] x, int n)
          .
 int getK()
          .
static double getMean(int k, double lambda)
          .
static double[] getMLE(double[] x, int n)
          .
 double[] getParams()
          .
static double getStandardDeviation(int k, double lambda)
          .
static double getVariance(int k, double lambda)
          .
static double inverseF(int k, double lambda, int d, double u)
          .
 void setParams(int k, double lambda, int d)
          .
 String toString()
          .
 
Methods inherited from class umontreal.iro.lecuyer.probdist.GammaDist
barF, barF, barF, cdf, cdf, cdf, density, density, getAlpha, getLambda, getMean, getMean, getStandardDeviation, getStandardDeviation, getVariance, getVariance, inverseF, inverseF, inverseF, setParams
 
Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsup
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErlangDist

public ErlangDist(int k)
. \begin{tabb}Constructs a \texttt{ErlangDist} object with parameters
 $k$\ = \texttt{k} and $\lambda=1$.
 \end{tabb}


ErlangDist

public ErlangDist(int k,
                  double lambda)
. \begin{tabb}Constructs a \texttt{ErlangDist} object with parameters
 $k$\ = \texttt{k} and $\lambda$\ = \texttt{lambda}.
 \end{tabb}

Method Detail

density

public static double density(int k,
                             double lambda,
                             double x)
. \begin{tabb}Computes the density function.
 \end{tabb}


cdf

public static double cdf(int k,
                         double lambda,
                         int d,
                         double x)
. \begin{tabb}Computes the distribution function using
 the gamma distribution function.
 \end{tabb}


barF

public static double barF(int k,
                          double lambda,
                          int d,
                          double x)
. \begin{tabb}Computes the complementary distribution function.
 \end{tabb}


inverseF

public static double inverseF(int k,
                              double lambda,
                              int d,
                              double u)
. \begin{tabb}Returns the inverse distribution function.
 \end{tabb}


getMLE

public static double[] getMLE(double[] x,
                              int n)
. \begin{tabb}
 Estimates the parameters $(k,\lambda)$\ of the Erlang distribution...
 ...l to the $\beta$\ parameter of the gamma distribution.
 \end{detailed}\end{tabb}
xthe list of observations used to evaluate parameters nthe number of observations used to evaluate parameters returns the parameters [$ \hat{{k}}$, $ \hat{{\lambda}}$]


getInstanceFromMLE

public static ErlangDist getInstanceFromMLE(double[] x,
                                            int n)
. \begin{tabb}
 Creates a new instance of an Erlang distribution with parameters $...
 ...thod based on the $n$\ observations $x[i]$,
 $i = 0, 1, \ldots, n-1$.
 \end{tabb}
xthe list of observations to use to evaluate parameters nthe number of observations to use to evaluate parameters


getMean

public static double getMean(int k,
                             double lambda)
. \begin{tabb}Computes and returns the mean, $E[X] = k/\lambda$,
 of the Erlang distribution with parameters $k$\ and $\lambda$.
 \end{tabb}
the mean of the Erlang distribution E[X] = k/λ


getVariance

public static double getVariance(int k,
                                 double lambda)
. \begin{tabb}Computes and returns the variance, $\mbox{Var}[X] = k/\lambda^2$,
 of the Erlang distribution with parameters $k$\ and $\lambda$.
 \end{tabb}
the variance of the Erlang distribution Var[X] = k/λ2


getStandardDeviation

public static double getStandardDeviation(int k,
                                          double lambda)
. \begin{tabb}Computes and returns the standard deviation of the Erlang
 distribution with parameters $k$\ and $\lambda$.
 \end{tabb}
the standard deviation of the Erlang distribution


getK

public int getK()
. \begin{tabb}Returns the parameter $k$\ for this object.
 \end{tabb}


setParams

public void setParams(int k,
                      double lambda,
                      int d)
. \begin{tabb}Sets the parameters $k$\ and $\lambda$\ of the distribution for this...
 ...uted with a rough target of
 \texttt{d} decimal digits of precision.
 \end{tabb}


getParams

public double[] getParams()
. \begin{tabb}
 Return a table containing parameters of the current distribution.
 This table is put in regular order: [$k$, $\lambda$].
 \end{tabb}

 

Specified by:
getParams in interface Distribution
Overrides:
getParams in class GammaDist

toString

public String toString()
. \begin{hide}
 \par
 \begin{tabb}
 Returns a \texttt{String} containing information about the current distribution.
 \end{tabb}\end{hide}

Overrides:
toString in class GammaDist

SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.