Class DistGamma

    • Constructor Detail

      • DistGamma

        public DistGamma​(StreamInterface stream,
                         double shape,
                         double scale)
        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 stream
        shape - double; is the shape parameter > 0, also known as α or k
        scale - double; is the scale parameter> 0, also known as θ
        Throws:
        IllegalArgumentException - when shape <= 0.0 or scale <= 0.0
    • Method Detail

      • draw

        public double draw()
        draws the next stream value according to the probability of this this distribution.
        Specified by:
        draw in class DistContinuous
        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 class DistContinuous
        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