public abstract class DiscreteDistribution extends Distribution
cdf(double)
method will behave by
rounding down
and then calling the integer cdf(int)
counterpart.Constructor and Description |
---|
DiscreteDistribution() |
Modifier and Type | Method and Description |
---|---|
double |
cdf(double x)
Computes the value of the Cumulative Density Function (CDF) at the given
point.
|
abstract double |
cdf(int x)
Computes the value of the Cumulative Density Function (CDF) at the given point.
|
abstract DiscreteDistribution |
clone() |
double |
invCdf(double p)
Computes the inverse Cumulative Density Function (CDF-1) at
the given point.
|
protected double |
invCdf(double p,
Function cdf)
This method is provided as a quick helper function, as any CDF has a 1 to
1 mapping with an inverse, CDF.-1.
|
double |
logPmf(int x)
Computes the log of the Probability Mass Function.
|
abstract double |
pmf(int x) |
getFunctionCDF, max, mean, median, min, mode, sample, sampleVec, skewness, standardDeviation, variance
public double logPmf(int x)
Double.NEGATIVE_INFINITY
would be the true
value. Instead, this method will always return the negative of
Double.MAX_VALUE
. This is to avoid propagating bad values through
computation.x
- the value to get the log(PMF) ofpublic abstract double pmf(int x)
public abstract double cdf(int x)
x
- the value to get the CDF ofpublic double cdf(double x)
Distribution
cdf
in class Distribution
x
- the value to get the CDF ofpublic double invCdf(double p)
Distribution
invCdf
in class Distribution
p
- the probability valueprotected double invCdf(double p, Function cdf)
Distribution
invCdf
in class Distribution
p
- the [0,1] probability valuecdf
- a function that provides the CDF we want to emulate the
inverse ofpublic abstract DiscreteDistribution clone()
clone
in class Distribution
Copyright © 2017. All rights reserved.