Interface EmpiricalDistributionInterface
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractEmpiricalDistribution
,DiscreteEmpiricalDistribution
,InterpolatedEmpiricalDistribution
The EmpiricalDistributionInterface describes a cumulative distribution function for an empirical distribution. In other
words, it describes an ordered list of pairs (cumulative probability, value) from which values can be drawn using the inverse
function method with a Uniform(0, 1) random distribution.
Copyright (c) 2021-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
-
Method Summary
Modifier and TypeMethodDescriptiongetCeilingEntry
(double cumulativeProbability) Return the cumulative probability and number above or at the given probability, or null when the cumulative probability is larger than the highest cumulative probability (1.0).getCeilingEntryForValue
(Number value) Return the cumulative probability and number above or at the given value, or null when the value is larger than the highest value in the distribution.Returns the cumulative probabilities as a list.getFloorEntry
(double cumulativeProbability) Return the cumulative probability and number below or at the given probability, or null when the cumulative probability is smaller than the lowest cumulative probability.getFloorEntryForValue
(Number value) Return the cumulative probability and number below or at the given value, or null when the value is smaller than the lowest value in the distribution.Return the highest value that this empirical distribution can return.Return the lowest value that this empirical distribution can return.getNextEntry
(double cumulativeProbability) Return the cumulative probability and number that follows in the sequence with respect to the given probability, or null when the cumulative probability is larger than the highest cumulative probability.getPrevEntry
(double cumulativeProbability) Return the cumulative probability and number that precedes in the sequence with respect to the given probability, or null when the cumulative probability is smaller than the lowest cumulative probability.Returns the values as a list.int
size()
Returns the number of probability-value mappings in this structure.
-
Method Details
-
size
int size()Returns the number of probability-value mappings in this structure.- Returns:
- int; the number of probability-value mappings in this structure.
-
getValues
Returns the values as a list.- Returns:
- the list of values
-
getCumulativeProbabilities
Returns the cumulative probabilities as a list.- Returns:
- the list of cumulative probabilities
-
getFloorEntry
Return the cumulative probability and number below or at the given probability, or null when the cumulative probability is smaller than the lowest cumulative probability.- Parameters:
cumulativeProbability
- double; the cumulative probability to look up- Returns:
- DistributionEntry; an entry object with the probability and corresponding value below or at the provided cumulative probability. Return null when the cumulative probability is smaller than the lowest cumulative probability
-
getCeilingEntry
Return the cumulative probability and number above or at the given probability, or null when the cumulative probability is larger than the highest cumulative probability (1.0).- Parameters:
cumulativeProbability
- double; the cumulative probability to look up- Returns:
- DistributionEntry; an entry object with the probability and corresponding value above or at the provided cumulative probability. Return null when the cumulative probability is larger than the highest cumulative probability (1.0)
-
getPrevEntry
Return the cumulative probability and number that precedes in the sequence with respect to the given probability, or null when the cumulative probability is smaller than the lowest cumulative probability. When cumulativeProbability is not a key, the floorEntry is returned instead.- Parameters:
cumulativeProbability
- double; the cumulative probability to look up- Returns:
- DistributionEntry; the first entry object with the probability and corresponding value below (but not at) the provided cumulative probability. Return null when the cumulative probability is smaller than the lowest cumulative probability
-
getNextEntry
Return the cumulative probability and number that follows in the sequence with respect to the given probability, or null when the cumulative probability is larger than the highest cumulative probability. When cumulativeProbability is not a key, the ceilingEntry is returned instead.- Parameters:
cumulativeProbability
- double; the cumulative probability to look up- Returns:
- DistributionEntry; the first entry object with the probability and corresponding value above (but not at) the provided cumulative probability. Return null when the cumulative probability is larger than the highest cumulative probability
-
getFloorEntryForValue
Return the cumulative probability and number below or at the given value, or null when the value is smaller than the lowest value in the distribution.- Parameters:
value
- Number; the value to look up- Returns:
- DistributionEntry; an entry object with the probability and corresponding value below or at the provided cumulative probability. Return null when the cumulative probability is smaller than the lowest cumulative probability
-
getCeilingEntryForValue
Return the cumulative probability and number above or at the given value, or null when the value is larger than the highest value in the distribution.- Parameters:
value
- Number; the value to look up- Returns:
- DistributionEntry; an entry object with the probability and corresponding value above or at the provided cumulative probability. Return null when the cumulative probability is larger than the highest cumulative probability
-
getHighestValue
Number getHighestValue()Return the highest value that this empirical distribution can return.- Returns:
- Number; the highest value that this empirical distribution can return
-
getLowestValue
Number getLowestValue()Return the lowest value that this empirical distribution can return.- Returns:
- Number; the lowest value that this empirical distribution can return
-