public interface CategoricalDistribution extends ProbabilityMass
Modifier and Type | Interface and Description |
---|---|
static interface |
CategoricalDistribution.Iterator
Interface to be implemented by an object/algorithm that wishes to iterate
over the possible assignments for the random variables comprising this
categorical distribution.
|
Modifier and Type | Method and Description |
---|---|
CategoricalDistribution |
divideBy(CategoricalDistribution divisor)
Divide the dividend (this) CategoricalDistribution by the divisor to
create a new CategoricalDistribution representing the quotient.
|
int |
getIndex(java.lang.Object... values)
Retrieve the index into the CategoricalDistribution for the provided set
of values for the random variables comprising the Distribution.
|
double |
getSum() |
double[] |
getValues()
Note: Do not modify the double[] returned by this method directly.
|
void |
iterateOver(CategoricalDistribution.Iterator cdi)
Iterate over all the possible value assignments for the Random Variables
comprising this CategoricalDistribution.
|
void |
iterateOver(CategoricalDistribution.Iterator cdi,
AssignmentProposition... fixedValues)
Iterate over all possible values assignments for the Random Variables
comprising this CategoricalDistribution that are not in the fixed set of
values.
|
CategoricalDistribution |
marginal(RandomVariable... vars)
Get the marginal probability for the provided variables from this
Distribution creating a new Distribution of the remaining variables with
their values updated with the summed out random variables.
see: AIMA3e page 492. |
CategoricalDistribution |
multiplyBy(CategoricalDistribution multiplier)
Multiplication of this Distribution by a given multiplier, creating a new
Distribution representing the product of the two.
|
CategoricalDistribution |
multiplyByPOS(CategoricalDistribution multiplier,
RandomVariable... prodVarOrder)
Multiplication - Product Order Specified (POS).
|
CategoricalDistribution |
normalize()
Normalize the values comprising this distribution.
|
void |
setValue(int idx,
double value)
Set the value at a specified index within the distribution.
|
contains, getFor, getValue, getValue
double[] getValues()
setValue(int, double)
void setValue(int idx, double value)
idx
- value
- double getSum()
CategoricalDistribution normalize()
int getIndex(java.lang.Object... values)
values
- an ordered set of values for the random variables comprising
the Distribution (Note: the order must match the order
of the random variables describing the distribution)getValues()
,
ProbabilityDistribution.getFor()
CategoricalDistribution marginal(RandomVariable... vars)
vars
- the random variables to marginalize/sum out.CategoricalDistribution divideBy(CategoricalDistribution divisor)
divisor
- java.lang.IllegalArgumentException
- if the variables of the divisor distribution are not a subset
of the dividend.CategoricalDistribution multiplyBy(CategoricalDistribution multiplier)
multiplier
- multiplyByPOS(CategoricalDistribution,
RandomVariable...)
CategoricalDistribution multiplyByPOS(CategoricalDistribution multiplier, RandomVariable... prodVarOrder)
multiplier
- prodVarOrder
- the order the variables comprising the product are to be in.multiplyBy(CategoricalDistribution)
void iterateOver(CategoricalDistribution.Iterator cdi)
cdi
- the CategoricalDistribution Iterator to iterate.void iterateOver(CategoricalDistribution.Iterator cdi, AssignmentProposition... fixedValues)
cdi
- the CategoricalDistribution Iterator to iteratefixedValues
- Fixed values for a subset of the Random Variables comprising
this CategoricalDistribution.