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

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.distribution.ChineseRestaurantProcess
          extended by gov.sandia.cognition.statistics.distribution.ChineseRestaurantProcess.PMF
All Implemented Interfaces:
Evaluator<Vector,Double>, Vectorizable, ClosedFormComputableDiscreteDistribution<Vector>, ClosedFormComputableDistribution<Vector>, ClosedFormDistribution<Vector>, ComputableDistribution<Vector>, DiscreteDistribution<Vector>, Distribution<Vector>, DistributionWithMean<Vector>, ProbabilityFunction<Vector>, ProbabilityMassFunction<Vector>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
ChineseRestaurantProcess

public static class ChineseRestaurantProcess.PMF
extends ChineseRestaurantProcess
implements ProbabilityMassFunction<Vector>

PMF of the Chinese Restaurant Process

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.statistics.distribution.ChineseRestaurantProcess
ChineseRestaurantProcess.PMF
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.distribution.ChineseRestaurantProcess
alpha, DEFAULT_ALPHA, DEFAULT_NUM_CUSTOMERS, numCustomers
 
Constructor Summary
ChineseRestaurantProcess.PMF()
          Creates a new instance of ChineseRestaurantProcess
ChineseRestaurantProcess.PMF(ChineseRestaurantProcess other)
          Copy constructor
ChineseRestaurantProcess.PMF(double alpha, int numCustomers)
          Creates a new instance of ChineseRestaurantProcess
 
Method Summary
 Double evaluate(Vector input)
          Evaluates the function on the given input and returns the output.
 double getEntropy()
          Gets the entropy of the values in the histogram.
 ChineseRestaurantProcess.PMF getProbabilityFunction()
          Gets the distribution function associated with this Distribution, either the PDF or PMF.
 double logEvaluate(Vector input)
          Evaluate the natural logarithm of the distribution function.
 
Methods inherited from class gov.sandia.cognition.statistics.distribution.ChineseRestaurantProcess
clone, convertFromVector, convertToVector, getAlpha, getDomain, getDomainSize, getMean, getNumCustomers, sample, sample, sampleNextCustomer, setAlpha, setNumCustomers
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

ChineseRestaurantProcess.PMF

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


ChineseRestaurantProcess.PMF

public ChineseRestaurantProcess.PMF(double alpha,
                                    int numCustomers)
Creates a new instance of ChineseRestaurantProcess

Parameters:
alpha - CRP concentration parameter, must be greater than zero.
numCustomers - Total number of customers that we will arrange around tables, must be greater than zero.

ChineseRestaurantProcess.PMF

public ChineseRestaurantProcess.PMF(ChineseRestaurantProcess other)
Copy constructor

Parameters:
other - CRP to copy
Method Detail

getProbabilityFunction

public ChineseRestaurantProcess.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<Vector>
Specified by:
getProbabilityFunction in interface DiscreteDistribution<Vector>
Specified by:
getProbabilityFunction in interface ProbabilityMassFunction<Vector>
Overrides:
getProbabilityFunction in class ChineseRestaurantProcess
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<Vector>
Returns:
The entropy of the values in the histogram.

logEvaluate

public double logEvaluate(Vector 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<Vector>
Returns:
Natural logarithm of the distribution function.

evaluate

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

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