# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.distribution.discrete

## Class ProbabilityMassQuantile<X>

• java.lang.Object
• com.numericalmethod.suanshu.stats.distribution.discrete.ProbabilityMassQuantile<X>

• public class ProbabilityMassQuantile<X>
extends Object
As probability mass function is discrete, there are gaps between values in the domain of its cdf, The quantile function is: $Q(p)\,=\,\inf\left\{ x\in R : p \le F(x) \right\}$
• ### Constructor Summary

Constructors
Constructor and Description
ProbabilityMassQuantile(Iterable<ProbabilityMassFunction.Mass<X>> outcomes)
Constructs the quantile function for a probability mass function.
ProbabilityMassQuantile(Iterable<ProbabilityMassFunction.Mass<X>> outcomes, double normalization)
Constructs the quantile function for a probability mass function.
• ### Method Summary

All Methods
Modifier and Type Method and Description
X quantile(double cm)
Gets the quantile at a cumulative probability mass.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### ProbabilityMassQuantile

public ProbabilityMassQuantile(Iterable<ProbabilityMassFunction.Mass<X>> outcomes,
double normalization)
Constructs the quantile function for a probability mass function.
Parameters:
outcomes - an ordered list of outcomes and their probabilities
normalization - a normalizing constant if the probabilities do not sum to 1; setting it to 1 speed up the initialization
• #### ProbabilityMassQuantile

public ProbabilityMassQuantile(Iterable<ProbabilityMassFunction.Mass<X>> outcomes)
Constructs the quantile function for a probability mass function. If the sum of the probabilities is not 1, it normalizes all probabilities by dividing them by the sum, which is automatically computed. To speed up the initialization phase, specify the normalizatoin constant instead.
Parameters:
outcomes - an ordered list of outcomes and their probabilities
• ### Method Detail

• #### quantile

public X quantile(double cm)
Gets the quantile at a cumulative probability mass.
Parameters:
cm - cumulative probability mass
Returns:
the quantile at cm; null if cm is smaller than the first sample