# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.distribution.discrete

## Interface ProbabilityMassFunction<X>

• Type Parameters:
X - the discrete random variable (domain) type
All Superinterfaces:
Iterable<ProbabilityMassFunction.Mass<X>>

public interface ProbabilityMassFunction<X>
extends Iterable<ProbabilityMassFunction.Mass<X>>
A probability mass function (pmf) is a function that gives the probability that a discrete random variable is exactly equal to some value. Suppose that X: S → R is a discrete random variable defined on a sample space S. The probability mass function fX: R → [0, 1] for X is defined as
fX(x) = Pr(X = x) = Pr({s ∈ S : X(s) = x})
Wikipedia: Probability mass function
• ### Nested Class Summary

Nested Classes
Modifier and Type Interface and Description
static class  ProbabilityMassFunction.Mass<X>
Stores a possible outcome for a probability distribution and its associated probability.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double evaluate(X x)
Compute the probability mass for a discrete realization x.
• ### Methods inherited from interface java.lang.Iterable

forEach, iterator, spliterator
• ### Method Detail

• #### evaluate

double evaluate(X x)
Compute the probability mass for a discrete realization x.
Parameters:
x - a realization
Returns:
pmf(x)