gov.sandia.cognition.statistics.distribution
Class NegativeBinomialDistribution.PMF

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.AbstractDistribution<NumberType>
          extended by gov.sandia.cognition.statistics.AbstractClosedFormUnivariateDistribution<Number>
              extended by gov.sandia.cognition.statistics.distribution.NegativeBinomialDistribution
                  extended by gov.sandia.cognition.statistics.distribution.NegativeBinomialDistribution.PMF
All Implemented Interfaces:
Evaluator<Number,Double>, Vectorizable, ClosedFormComputableDistribution<Number>, ClosedFormDiscreteUnivariateDistribution<Number>, ClosedFormDistribution<Number>, ClosedFormUnivariateDistribution<Number>, ComputableDistribution<Number>, DiscreteDistribution<Number>, Distribution<Number>, DistributionWithMean<Number>, EstimableDistribution<Number,NegativeBinomialDistribution>, ProbabilityFunction<Number>, ProbabilityMassFunction<Number>, UnivariateDistribution<Number>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
NegativeBinomialDistribution

public static class NegativeBinomialDistribution.PMF
extends NegativeBinomialDistribution
implements ProbabilityMassFunction<Number>

PMF of the NegativeBinomialDistribution.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.statistics.distribution.NegativeBinomialDistribution
NegativeBinomialDistribution.CDF, NegativeBinomialDistribution.MaximumLikelihoodEstimator, NegativeBinomialDistribution.PMF, NegativeBinomialDistribution.WeightedMaximumLikelihoodEstimator
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.distribution.NegativeBinomialDistribution
DEFAULT_P, DEFAULT_R, p, r
 
Constructor Summary
NegativeBinomialDistribution.PMF()
          Creates a new instance of PMF
NegativeBinomialDistribution.PMF(double r, double p)
          Creates a new instance of PMF
NegativeBinomialDistribution.PMF(NegativeBinomialDistribution other)
          Copy constructor
 
Method Summary
 Double evaluate(Number input)
          Evaluates the function on the given input and returns the output.
 double getEntropy()
          Gets the entropy of the values in the histogram.
 NegativeBinomialDistribution.PMF getProbabilityFunction()
          Gets the distribution function associated with this Distribution, either the PDF or PMF.
 double logEvaluate(Number input)
          Evaluate the natural logarithm of the distribution function.
 
Methods inherited from class gov.sandia.cognition.statistics.distribution.NegativeBinomialDistribution
clone, convertFromVector, convertToVector, getCDF, getDomain, getDomainSize, getEstimator, getMaxSupport, getMean, getMinSupport, getP, getR, getVariance, sample, setP, setR, toString
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractDistribution
sample
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.DiscreteDistribution
getDomain, getDomainSize
 
Methods inherited from interface gov.sandia.cognition.statistics.Distribution
sample, sample
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

NegativeBinomialDistribution.PMF

public NegativeBinomialDistribution.PMF()
Creates a new instance of PMF


NegativeBinomialDistribution.PMF

public NegativeBinomialDistribution.PMF(double r,
                                        double p)
Creates a new instance of PMF

Parameters:
r - Number of trials before the experiment is stopped, must be greater than zero.
p - Probability of a positive outcome (Bernoulli probability), [0,1]

NegativeBinomialDistribution.PMF

public NegativeBinomialDistribution.PMF(NegativeBinomialDistribution other)
Copy constructor

Parameters:
other - NegativeBinomialDistribution to copy
Method Detail

getProbabilityFunction

public NegativeBinomialDistribution.PMF getProbabilityFunction()
Description copied from interface: ComputableDistribution
Gets the distribution function associated with this Distribution, either the PDF or PMF.

Specified by:
getProbabilityFunction in interface ComputableDistribution<Number>
Specified by:
getProbabilityFunction in interface DiscreteDistribution<Number>
Specified by:
getProbabilityFunction in interface ProbabilityMassFunction<Number>
Overrides:
getProbabilityFunction in class NegativeBinomialDistribution
Returns:
Distribution function associated with this Distribution.

getEntropy

public double getEntropy()
Description copied from interface: ProbabilityMassFunction
Gets the entropy of the values in the histogram.

Specified by:
getEntropy in interface ProbabilityMassFunction<Number>
Returns:
The entropy of the values in the histogram.

logEvaluate

public double logEvaluate(Number input)
Description copied from interface: ProbabilityFunction
Evaluate the natural logarithm of the distribution function. This is sometimes more efficient than evaluating the distribution function itself, and when evaluating the product of many independent or exchangeable samples.

Specified by:
logEvaluate in interface ProbabilityFunction<Number>
Returns:
Natural logarithm of the distribution function.

evaluate

public Double evaluate(Number input)
Description copied from interface: Evaluator
Evaluates the function on the given input and returns the output.

Specified by:
evaluate in interface Evaluator<Number,Double>
Parameters:
input - The input to evaluate.
Returns:
The output produced by evaluating the input.