jsat.distributions.discrete
Class DiscreteDistribution
- java.lang.Object
-
- jsat.distributions.Distribution
-
- jsat.distributions.discrete.DiscreteDistribution
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- Binomial, Poisson, UniformDiscrete, Zipf
public abstract class DiscreteDistribution extends Distribution
This abstract class defines the contract for a distribution over the integer values.
Thecdf(double)method will behave byrounding downand then calling the integercdf(int)counterpart.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DiscreteDistribution()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description doublecdf(double x)Computes the value of the Cumulative Density Function (CDF) at the given point.abstract doublecdf(int x)Computes the value of the Cumulative Density Function (CDF) at the given point.abstract DiscreteDistributionclone()doubleinvCdf(double p)Computes the inverse Cumulative Density Function (CDF-1) at the given point.doublelogPmf(int x)Computes the log of the Probability Mass Function.abstract doublepmf(int x)
-
-
-
Method Detail
-
logPmf
public double logPmf(int x)
Computes the log of the Probability Mass Function. Note, that then the probability is zero,Double.NEGATIVE_INFINITYwould be the true value. Instead, this method will always return the negative ofDouble.MAX_VALUE. This is to avoid propagating bad values through computation.- Parameters:
x- the value to get the log(PMF) of- Returns:
- the value of log(PMF(x))
-
pmf
public abstract double pmf(int x)
-
cdf
public abstract double cdf(int x)
Computes the value of the Cumulative Density Function (CDF) at the given point. The CDF returns a value in the range [0, 1], indicating what portion of values occur at or below that point.- Parameters:
x- the value to get the CDF of- Returns:
- the CDF(x)
-
cdf
public double cdf(double x)
Description copied from class:DistributionComputes the value of the Cumulative Density Function (CDF) at the given point. The CDF returns a value in the range [0, 1], indicating what portion of values occur at or below that point.- Specified by:
cdfin classDistribution- Parameters:
x- the value to get the CDF of- Returns:
- the CDF(x)
-
invCdf
public double invCdf(double p)
Description copied from class:DistributionComputes the inverse Cumulative Density Function (CDF-1) at the given point. It takes in a value in the range of [0, 1] and returns the value x, such that CDF(x) = p- Overrides:
invCdfin classDistribution- Parameters:
p- the probability value- Returns:
- the value such that the CDF would return p
-
clone
public abstract DiscreteDistribution clone()
- Specified by:
clonein classDistribution
-
-
DataMelt 3.0 © DataMelt by jWork.ORG