public interface DiscreteDistribution
DiscreteDistribution provides a probability
distribution over long integer outcomes. Mathematically, such a
distribution defines a discrete-valued random variable.
Discrete probability distributions return values between
0.0 and 1.0 inclusive for outcomes. The
sum of the probabilities over all integers should be
1.0, but it may be less than 1.0 for the
sum of all integers representable as longs (64 bits). Discrete
distributions are also required to return log (base 2)
probabilities to support probabilities very close to 0.0 or 1.0.
Cumulative probabilities may be calculated over discrete distributions. A cumulative probabilty is a sum of probabilities within a given range.
Discrete distributions optionally implement methods to return their mean, variance and entropy. Discrete distributions are required to indicate the minimum and maximum outcome with non-zero probability. This allows cumulative probabilities, means, variances and entropies to be computed by iterating over values in range. If there are no minimum or maximum values, these methods should return the minimum and maximum long values respectively.
For more information, see:
| Modifier and Type | Method and Description |
|---|---|
double |
cumulativeProbability(long lowerBound,
long upperBound)
Returns the probability that an outcome will fall in the range
between the specified lower and upper bounds inclusive.
|
double |
cumulativeProbabilityGreater(long lowerBound)
Returns the probability an outcome will be greater than or
equal to the specified outcome.
|
double |
cumulativeProbabilityLess(long upperBound)
Returns the probability an outcome will be less than or
equal to the specified outcome.
|
double |
entropy()
Returns the entropy of this distribution.
|
double |
log2Probability(long outcome)
Returns the log (base 2) probability of the specified outcome.
|
long |
maxOutcome()
Returns the maximum outcome with non-zero
probability.
|
double |
mean()
Returns the mean of this distribution.
|
long |
minOutcome()
Returns the minimum outcome with non-zero probability.
|
double |
probability(long outcome)
Returns the probability of the specified outcome.
|
double |
variance()
Returns the variance of this distribution.
|
double probability(long outcome)
outcome - The discrete outcome.double log2Probability(long outcome)
outcome - The discrete outcome.double cumulativeProbabilityLess(long upperBound)
upperBound - Upper bound of the outcome.double cumulativeProbabilityGreater(long lowerBound)
lowerBound - Lower bound of outcomes considered.double cumulativeProbability(long lowerBound,
long upperBound)
lowerBound - Lower bound of outcomes considered.upperBound - Upper bound of the outcome.long minOutcome()
Long.MIN_VALUE.long maxOutcome()
Long.MAX_VALUE.double mean()
UnsupportedOperationException - If this operation is not
supported.double variance()
UnsupportedOperationException - If this operation is not
supported.double entropy()
UnsupportedOperationException - If this operation is not
supported.Copyright © 2019 Alias-i, Inc.. All rights reserved.