public static class BernoulliDistribution.PMF extends BernoulliDistribution implements ProbabilityMassFunction<java.lang.Number>
BernoulliDistribution.CDF, BernoulliDistribution.PMF
DEFAULT_P
Constructor and Description |
---|
PMF()
Default constructor
|
PMF(BernoulliDistribution other)
Copy constructor
|
PMF(double p)
Creates a new instance of PMF
|
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
evaluate(java.lang.Number input)
Evaluates the function on the given input and returns the output.
|
double |
getEntropy()
Gets the entropy of the values in the histogram.
|
BernoulliDistribution.PMF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
double |
logEvaluate(java.lang.Number input)
Evaluate the natural logarithm of the distribution function.
|
convertFromVector, convertToVector, getCDF, getDomain, getDomainSize, getMaxSupport, getMean, getMeanAsDouble, getMinSupport, getP, getVariance, sampleAsBoolean, sampleAsInt, sampleInto, setP, toString
sampleAsInts, sampleInto
clone
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDomain, getDomainSize
sample, sample, sampleInto
clone
clone
public PMF()
public PMF(double p)
p
- Bernoulli parameter, where the distribution takes value "1" with
probability "p" and value "0" with probability 1-p.public PMF(BernoulliDistribution other)
other
- BernoulliDistribution to copypublic double getEntropy()
ProbabilityMassFunction
getEntropy
in interface ProbabilityMassFunction<java.lang.Number>
public java.lang.Double evaluate(java.lang.Number input)
Evaluator
public double logEvaluate(java.lang.Number input)
ProbabilityFunction
logEvaluate
in interface ProbabilityFunction<java.lang.Number>
input
- The input to be evaluatedpublic BernoulliDistribution.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 BernoulliDistribution