public static class ChineseRestaurantProcess.PMF extends ChineseRestaurantProcess implements ProbabilityMassFunction<Vector>
ChineseRestaurantProcess.PMF
alpha, DEFAULT_ALPHA, DEFAULT_NUM_CUSTOMERS, numCustomers
Constructor and Description |
---|
PMF()
Creates a new instance of ChineseRestaurantProcess
|
PMF(ChineseRestaurantProcess other)
Copy constructor
|
PMF(double alpha,
int numCustomers)
Creates a new instance of ChineseRestaurantProcess
|
Modifier and Type | Method and Description |
---|---|
java.lang.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.
|
clone, convertFromVector, convertToVector, getAlpha, getDomain, getDomainSize, getMean, getNumCustomers, sample, sampleInto, sampleNextCustomer, setAlpha, setNumCustomers
sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDomain, getDomainSize
sample, sample, sampleInto
clone
public PMF()
public PMF(double alpha, int numCustomers)
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.public PMF(ChineseRestaurantProcess other)
other
- CRP to copypublic ChineseRestaurantProcess.PMF getProbabilityFunction()
ComputableDistribution
getProbabilityFunction
in interface ComputableDistribution<Vector>
getProbabilityFunction
in interface DiscreteDistribution<Vector>
getProbabilityFunction
in interface ProbabilityMassFunction<Vector>
getProbabilityFunction
in class ChineseRestaurantProcess
public double getEntropy()
ProbabilityMassFunction
getEntropy
in interface ProbabilityMassFunction<Vector>
public double logEvaluate(Vector input)
ProbabilityFunction
logEvaluate
in interface ProbabilityFunction<Vector>
input
- The input to be evaluated