public abstract class MultivariateDistribution extends AbstractDiscreteDistribution
MultivariateDistribution implements a discrete
distribution over a finite set of outcomes numbered consecutively
from zero. The total number of outcomes is given by the abstract
method numDimensions(). The minimum outcome is zero and
the maximum outcome is the number of dimensions minus one.
Concrete subclasses must also implement the method probability(long).
Outcomes in multivariate distributions are labeled by strings.
The method label(long) returns the label for an outcome.
The inverse method outcome(String) maps labels to
outcomes. The default implementation in this class provides labels
defined by converting the long integer outcomes to strings.
Subclasses may override these methods (together) to implement a
more meaningful notion of label.
Note that the multivariate distribution forms the basis of the mulitnomial distribution. The Bernoulli distribution is a special case of the multivariate distribution with two outcomes.
For more information, see:
| Constructor and Description |
|---|
MultivariateDistribution()
Construct a multivariate distribution.
|
| Modifier and Type | Method and Description |
|---|---|
String |
label(long outcome)
Return the label for the specified outcome.
|
double |
log2Probability(String label)
Returns the log (base 2) probability of the outcome specified
by label.
|
long |
maxOutcome()
Returns the maximum outcome with non-zero probability for a
multivariate distribution.
|
long |
minOutcome()
Returns zero, the minimum outcome with non-zero probability for
a multivariate distribution.
|
abstract int |
numDimensions()
Returns the number of dimensions of this multivariate distribution.
|
long |
outcome(String label)
Return the outcome for the specified label.
|
abstract double |
probability(long outcome)
Return the probability of the specified outcome in
this multivariate distribution.
|
double |
probability(String label)
Returns the probability of the outcome specified by label.
|
cumulativeProbability, cumulativeProbabilityGreater, cumulativeProbabilityLess, entropy, log2Probability, mean, variancepublic MultivariateDistribution()
public long minOutcome()
minOutcome in interface DiscreteDistributionminOutcome in class AbstractDiscreteDistributionpublic long maxOutcome()
numDimensions() minus one.maxOutcome in interface DiscreteDistributionmaxOutcome in class AbstractDiscreteDistributionpublic long outcome(String label)
Long.parseLong(String) to the specified label. If the
label is not a number, -1 is returned.label - Label whose outcome is returned.public String label(long outcome)
Long.toString(long) applied to the outcome.outcome - Outcome whose label is returned.IllegalArgumentException - If the outcome index is out of range.public double probability(String label)
0.0.label - Label of outcome.public double log2Probability(String label)
Double.NEGATIVE_INFINITY.label - Label of outcome.public abstract int numDimensions()
public abstract double probability(long outcome)
probability in interface DiscreteDistributionprobability in class AbstractDiscreteDistributionoutcome - Outcome whose probability is returned.Copyright © 2016 Alias-i, Inc.. All rights reserved.