Class DistEmpiricalDiscreteDouble

All Implemented Interfaces:
Serializable

public class DistEmpiricalDiscreteDouble extends DistContinuous
The empirical distribution is a distribution where the information is stored in an EmpiricalDistribution, consisting of pairs of values and cumulative probabilities.
Note that interpolated is false for the EmpiricalDistribution to be used in this class, so the function in essence behaves as a discrete distribution, albeit with double values as the outcome. The probability density function returns the equivalent of the discrete distribution function; of course the real probability density function from the viewpoint of a continuous distribution does not exist.

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:
Alexander Verbraeck
See Also:
  • Constructor Details

    • DistEmpiricalDiscreteDouble

      public DistEmpiricalDiscreteDouble(StreamInterface stream, DiscreteEmpiricalDistribution empiricalDistribution)
      constructs a new DistEmpirical.
      Parameters:
      stream - StreamInterface; the stream to use
      empiricalDistribution - EmpiricalDistributionInterface; the cumulative distribution to use
  • Method Details

    • 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