public class MultivariateConstant extends MultivariateDistribution
MultivariateConstant provides a multinomial
distribution with constant probabilities and labels. A range
of constructors allow a constant multivariate to be constructed
from integer counts, floating point probability ratios, with
an optional set of labels.| Constructor and Description |
|---|
MultivariateConstant(double[] probabilityRatios)
Construct a constant multinomial distribution with
probabilities proportional to the specified ratios.
|
MultivariateConstant(double[] probabilityRatios,
String[] labels)
Construct a constant multinomial distribution with the
specified labels and probabilities proportional to the
specified counts.
|
MultivariateConstant(int numOutcomes)
Construct a uniform constant multinomial distribution with the
specified number of outcomes.
|
MultivariateConstant(long[] counts)
Construct a constant multinomial distribution with
probabilities proportional to the specified counts.
|
MultivariateConstant(long[] counts,
String[] labels)
Construct a constant multinomial distribution with the
specified labels and probabilities proportional to the
specified counts.
|
MultivariateConstant(String[] labels)
Construct a uniform constant multinomial distribution with the
specified labels.
|
| Modifier and Type | Method and Description |
|---|---|
String |
label(long outcome)
Return the label for the specified outcome.
|
int |
numDimensions()
Returns the number of dimensions of this multivariate distribution.
|
long |
outcome(String outcomeLabel)
Return the outcome for the specified label.
|
double |
probability(long outcome)
Return the probability of the specified outcome in
this multivariate distribution.
|
log2Probability, maxOutcome, minOutcome, probabilitycumulativeProbability, cumulativeProbabilityGreater, cumulativeProbabilityLess, entropy, log2Probability, mean, variancepublic MultivariateConstant(int numOutcomes)
MultivariateDistribution.numOutcomes - Number of outcomes.IllegalArgumentException - If the number of outcomes is
less than one.public MultivariateConstant(long[] counts)
MultivariateDistribution.counts - Counts for each outcome.IllegalArgumentException - If any of the counts are less
than zero.public MultivariateConstant(double[] probabilityRatios)
MultivariateDistribution.probabilityRatios - Probability ratios of outcomes.IllegalArgumentException - If any of the ratios are less
than zero.public MultivariateConstant(String[] labels)
labels - Labels of outcomes in order of their indices.IllegalArgumentException - If any of the labels are
duplicated.public MultivariateConstant(long[] counts,
String[] labels)
counts - Counts for outcomes.labels - Labels of outcomes.IllegalArgumentException - If any count is negative,
if there are not the same number of counts and labels, or
if there are duplicate labels.public MultivariateConstant(double[] probabilityRatios,
String[] labels)
probabilityRatios - Counts for outcomes.labels - Labels of outcomes.IllegalArgumentException - If any count is negative or if
there are not the same number of counts and labels.public int numDimensions()
MultivariateDistributionnumDimensions in class MultivariateDistributionpublic long outcome(String outcomeLabel)
MultivariateDistributionLong.parseLong(String) to the specified label. If the
label is not a number, -1 is returned.outcome in class MultivariateDistributionoutcomeLabel - Label whose outcome is returned.public String label(long outcome)
MultivariateDistributionLong.toString(long) applied to the outcome.label in class MultivariateDistributionoutcome - Outcome whose label is returned.public double probability(long outcome)
MultivariateDistributionprobability in interface DiscreteDistributionprobability in class MultivariateDistributionoutcome - Outcome whose probability is returned.Copyright © 2019 Alias-i, Inc.. All rights reserved.