|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.stats.AbstractDiscreteDistribution
com.aliasi.stats.MultivariateDistribution
com.aliasi.stats.MultivariateConstant
public class MultivariateConstant
A 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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class com.aliasi.stats.MultivariateDistribution |
|---|
log2Probability, maxOutcome, minOutcome, probability |
| Methods inherited from class com.aliasi.stats.AbstractDiscreteDistribution |
|---|
cumulativeProbability, cumulativeProbabilityGreater, cumulativeProbabilityLess, entropy, log2Probability, mean, variance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public 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.| Method Detail |
|---|
public int numDimensions()
MultivariateDistribution
numDimensions 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)
MultivariateDistribution
probability in interface DiscreteDistributionprobability in class MultivariateDistributionoutcome - Outcome whose probability is returned.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||