public static class BinomialDistribution.PMF extends BinomialDistribution implements ProbabilityMassFunction<java.lang.Number>
BinomialDistribution.CDF, BinomialDistribution.MaximumLikelihoodEstimator, BinomialDistribution.PMF
DEFAULT_N, DEFAULT_P
Constructor and Description |
---|
PMF()
Default constructor.
|
PMF(BinomialDistribution other)
Copy constructor
|
PMF(int N,
double p)
Creates a new instance of PMF
|
Modifier and Type | Method and Description |
---|---|
static double |
evaluate(int N,
int k,
double p)
Returns the binomial CDF for the parameters N, k, p, which is the
probability of exactly k successes in N experiments with expected
per-trial success probability (Bernoulli) p
|
java.lang.Double |
evaluate(java.lang.Number input)
Returns the binomial PMF for the parameters N, k, p, which is the
probability of exactly k successes in N experiments with expected
per-trial success probability (Bernoulli) p
|
double |
getEntropy()
Gets the entropy of the values in the histogram.
|
BinomialDistribution.PMF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
static double |
logEvaluate(int N,
int k,
double p)
Computes the natural logarithm of the PMF.
|
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, getN, getP, getVariance, sampleAsInt, sampleInto, sampleInto, setN, setP
sampleAsInts
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDomain, getDomainSize
sample, sample, sampleInto
clone
public PMF()
public PMF(int N, double p)
N
- Total number of experiments, must be greater than zerop
- Probability of a positive outcome (Bernoulli probability), [0,1]public PMF(BinomialDistribution other)
other
- BinomialDistribution to copypublic java.lang.Double evaluate(java.lang.Number input)
public static double evaluate(int N, int k, double p)
N
- Total number of experimentsk
- Total number of successesp
- Expected probability of success, Bernoulli parameterpublic double logEvaluate(java.lang.Number input)
ProbabilityFunction
logEvaluate
in interface ProbabilityFunction<java.lang.Number>
input
- The input to be evaluatedpublic static double logEvaluate(int N, int k, double p)
N
- Total number of experimentsk
- Total number of successesp
- Expected probability of success, Bernoulli parameterpublic double getEntropy()
ProbabilityMassFunction
getEntropy
in interface ProbabilityMassFunction<java.lang.Number>
public BinomialDistribution.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 BinomialDistribution