Class DistErlang
java.lang.Object
nl.tudelft.simulation.jstats.distributions.Dist
nl.tudelft.simulation.jstats.distributions.DistContinuous
nl.tudelft.simulation.jstats.distributions.DistErlang
- All Implemented Interfaces:
Serializable
The Erlang distribution. For more information on this distribution see
http://mathworld.wolfram.com/ErlangDistribution.html
The Erlang distribution is the distribution of a sum of k independent exponential variables with the scale parameter as the mean. The scale parameter is equal to 1/rate or 1/λ, giving the entire Erlang distribution a mean of k*scale.
The Erlang distribution is the distribution of a sum of k independent exponential variables with the scale parameter as the mean. The scale parameter is equal to 1/rate or 1/λ, giving the entire Erlang distribution a mean of k*scale.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Peter Jacobs , Alexander Verbraeck
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDistErlang
(StreamInterface stream, double scale, int k) Construct a new Erlang distribution with k and a mean (so not k and a rate) as parameters. -
Method Summary
Modifier and TypeMethodDescriptiondouble
draw()
draws the next stream value according to the probability of this this distribution.int
getK()
double
getProbabilityDensity
(double x) returns the probability density value of a value x.double
getScale()
void
setStream
(StreamInterface stream) Replace the random number stream.toString()
-
Constructor Details
-
DistErlang
Construct a new Erlang distribution with k and a mean (so not k and a rate) as parameters. It is the distribution of a sum of k independent exponential variables with the scale parameter as the mean. The scale parameter is equal to 1/rate or 1/λ, giving the entire Erlang distribution a mean of k*scale.- Parameters:
stream
- StreamInterface; the random number streamscale
- double; the mean of a single sample from the exponential distribution, of which k are summed. Equal to 1/rate or 1/λ.k
- int; the shape parameter of the Erlang distribution. The shape k is the number of times a drawing is done from the exponential distribution, where the Erlang distribution is the sum of these k independent exponential variables.- Throws:
IllegalArgumentException
- when k <= 0 or scale <= 0
-
-
Method Details
-
draw
public double draw()draws the next stream value according to the probability of this this distribution.- Specified by:
draw
in classDistContinuous
- Returns:
- the next double value drawn.
-
getProbabilityDensity
public double getProbabilityDensity(double x) returns the probability density value of a value x.- Specified by:
getProbabilityDensity
in classDistContinuous
- Parameters:
x
- double; the value for which the density function needs to be calculated- Returns:
- double; the probability density for value x
-
getK
public int getK()- Returns:
- k
-
getScale
public double getScale()- Returns:
- scale parameter
-
setStream
Replace the random number stream. -
toString
-