Class DistGamma
java.lang.Object
nl.tudelft.simulation.jstats.distributions.Dist
nl.tudelft.simulation.jstats.distributions.DistContinuous
nl.tudelft.simulation.jstats.distributions.DistGamma
- All Implemented Interfaces:
Serializable
The Gamma distribution. For more information on this distribution see
https://mathworld.wolfram.com/GammaDistribution.html
The parameters are not rate-related, but average-related, so the mean is shape*scale (or αθ), and the variance is αθ2.
The parameters are not rate-related, but average-related, so the mean is shape*scale (or αθ), and the variance is αθ2.
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
ConstructorDescriptionDistGamma
(StreamInterface stream, double shape, double scale) constructs a new gamma distribution. -
Method Summary
-
Constructor Details
-
DistGamma
constructs a new gamma distribution. The gamma distribution represents the time to complete some task, e.g. customer service or machine repair. The parameters are not rate-related, but average-related, so the mean is shape*scale (or αθ or kθ), and the variance is αθ2.- Parameters:
stream
- StreamInterface; the random number streamshape
- double; is the shape parameter > 0, also known as α or kscale
- double; is the scale parameter> 0, also known as θ- Throws:
IllegalArgumentException
- when shape <= 0.0 or scale <= 0.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
-
getShape
public double getShape()- Returns:
- alpha
-
getScale
public double getScale()- Returns:
- beta
-
toString
-