Extends the class GammaDist for the special case of the Erlang distribution with shape parameter \(k > 0\) and scale parameter. More...
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\). | |
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.
| 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.
| 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.
|
static |
Computes the complementary distribution function.
Definition at line 75 of file ErlangDist.java.
|
static |
Computes the distribution function using the gamma distribution function.
Definition at line 68 of file ErlangDist.java.
|
static |
Computes the density function.
Definition at line 61 of file ErlangDist.java.
|
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\).
| x | the list of observations to use to evaluate parameters |
| n | the number of observations to use to evaluate parameters |
Reimplemented from umontreal.ssj.probdist.GammaDist.
Definition at line 115 of file ErlangDist.java.
| int umontreal.ssj.probdist.ErlangDist.getK | ( | ) |
Returns the parameter \(k\) for this object.
Definition at line 168 of file ErlangDist.java.
|
static |
Computes and returns the mean, \(E[X] = k/\lambda\), of the Erlang distribution with parameters \(k\) and \(\lambda\).
Definition at line 126 of file ErlangDist.java.
|
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.
| x | the list of observations used to evaluate parameters |
| n | the number of observations used to evaluate parameters |
Reimplemented from umontreal.ssj.probdist.GammaDist.
Definition at line 101 of file ErlangDist.java.
| 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.
|
static |
Computes and returns the standard deviation of the Erlang distribution with parameters \(k\) and \(\lambda\).
Definition at line 156 of file ErlangDist.java.
|
static |
Computes and returns the variance, \(\mbox{Var}[X] = k/\lambda^2\), of the Erlang distribution with parameters \(k\) and \(\lambda\).
Definition at line 141 of file ErlangDist.java.
|
static |
Returns the inverse distribution function.
Definition at line 82 of file ErlangDist.java.
| 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.
| 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.