Class ProbabilityMassFunction.Mass<X>
- java.lang.Object
-
- dev.nm.stat.distribution.discrete.ProbabilityMassFunction.Mass<X>
-
- Type Parameters:
X
- the type of the value
- Enclosing interface:
- ProbabilityMassFunction<X>
public static final class ProbabilityMassFunction.Mass<X> extends Object
Stores a possible outcome for a probability distribution and its associated probability.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description X
outcome()
Gets the outcome.double
probability()
Gets the probability of the outcome.
-
-
-
Constructor Detail
-
Mass
public Mass(X outcome, double probability)
Creates an instance with an outcome and its associated probability.- Parameters:
outcome
- an outcomeprobability
- the probability that the given outcome will occur
-
-
Method Detail
-
outcome
public X outcome()
Gets the outcome.- Returns:
- the outcome
-
probability
public double probability()
Gets the probability of the outcome.- Returns:
- the probability
-
-