public static class UniformIntegerDistribution.PMF extends UniformIntegerDistribution implements ProbabilityMassFunction<java.lang.Number>
UniformIntegerDistribution.CDF, UniformIntegerDistribution.MaximumLikelihoodEstimator, UniformIntegerDistribution.PMF
DEFAULT_MAX_SUPPORT, DEFAULT_MIN_SUPPORT
Constructor and Description |
---|
PMF()
Creates a new
UniformIntegerDistribution.PMF with min and
max 0. |
PMF(int minSupport,
int maxSupport)
Creates a new
UniformIntegerDistribution.PMF with the given
min and max. |
PMF(UniformIntegerDistribution other)
Creates a new
UniformIntegerDistribution.PMF as a copy
of the given other uniform distribution. |
Modifier and Type | Method and Description |
---|---|
static double |
evaluate(int input,
int minSupport,
int maxSupport)
Evaluates the probability mass function of the discrete uniform
distribution.
|
java.lang.Double |
evaluate(java.lang.Number input)
Evaluates the function on the given input and returns the output.
|
double |
evaluateAsDouble(int input)
Evaluates the input value for the PMF to compute its mass as a
double.
|
double |
getEntropy()
Gets the entropy of the values in the histogram.
|
UniformIntegerDistribution.PMF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
static double |
logEvaluate(int input,
int minSupport,
int maxSupport)
Evaluates the log of the probability mass function of the discrete
uniform distribution.
|
double |
logEvaluate(java.lang.Number input)
Evaluate the natural logarithm of the distribution function.
|
clone, convertFromVector, convertToVector, getCDF, getDomain, getDomainSize, getEstimator, getMaxSupport, getMean, getMeanAsDouble, getMinSupport, getVariance, sampleAsInt, sampleInto, setMaxSupport, setMinSupport
sampleAsInts, sampleInto
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDomain, getDomainSize
sample, sample, sampleInto
clone
public PMF()
UniformIntegerDistribution.PMF
with min and
max 0.public PMF(int minSupport, int maxSupport)
UniformIntegerDistribution.PMF
with the given
min and max.minSupport
- The minimum support. Should be less-than-or-equal to the max
support.maxSupport
- The maximum support. Should be greater-than-or-equal to the min
support.public PMF(UniformIntegerDistribution other)
UniformIntegerDistribution.PMF
as a copy
of the given other uniform distribution.other
- The other distribution.public double getEntropy()
ProbabilityMassFunction
getEntropy
in interface ProbabilityMassFunction<java.lang.Number>
public double logEvaluate(java.lang.Number input)
ProbabilityFunction
logEvaluate
in interface ProbabilityFunction<java.lang.Number>
input
- The input to be evaluatedpublic java.lang.Double evaluate(java.lang.Number input)
Evaluator
public double evaluateAsDouble(int input)
input
- The input value.public static double evaluate(int input, int minSupport, int maxSupport)
input
- The input value.minSupport
- The minimum support. Should be less-than-or-equal to the max
support.maxSupport
- The maximum support. Should be greater-than-or-equal to the min
support.public static double logEvaluate(int input, int minSupport, int maxSupport)
input
- The input value.minSupport
- The minimum support. Should be less-than-or-equal to the max
support.maxSupport
- The maximum support. Should be greater-than-or-equal to the min
support.public UniformIntegerDistribution.PMF getProbabilityFunction()
ComputableDistribution
getProbabilityFunction
in interface ComputableDistribution<java.lang.Number>
getProbabilityFunction
in interface DiscreteDistribution<java.lang.Number>
getProbabilityFunction
in interface ProbabilityMassFunction<java.lang.Number>
getProbabilityFunction
in class UniformIntegerDistribution