public abstract class Distribution extends Object implements Cloneable, Serializable
Constructor and Description |
---|
Distribution() |
Modifier and Type | Method and Description |
---|---|
abstract double |
cdf(double x)
Computes the value of the Cumulative Density Function (CDF) at the given
point.
|
abstract Distribution |
clone() |
static Function |
getFunctionCDF(Distribution dist)
Wraps the
cdf(double) function of the given distribution in a
function object for use. |
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.
|
abstract double |
max()
The maximum value for which the
#pdf(double) is meant to return
a value. |
abstract double |
mean()
Computes the mean value of the distribution
|
double |
median()
Computes the median value of the distribution
|
abstract double |
min()
The minimum value for which the
#pdf(double) is meant to return
a value. |
abstract double |
mode()
Computes the mode of the distribution.
|
double[] |
sample(int numSamples,
Random rand)
This method returns a double array containing the values of random samples from this distribution.
|
DenseVector |
sampleVec(int numSamples,
Random rand)
This method returns a double array containing the values of random samples from this distribution.
|
abstract double |
skewness()
Computes the skewness of the distribution.
|
double |
standardDeviation()
Computes the standard deviation of the distribution.
|
abstract double |
variance()
Computes the variance of the distribution.
|
public abstract double cdf(double x)
x
- the value to get the CDF ofpublic double invCdf(double p)
p
- the probability valueprotected double invCdf(double p, Function cdf)
p
- the [0,1] probability valuecdf
- a function that provides the CDF we want to emulate the
inverse ofpublic abstract double mean()
public double median()
public abstract double mode()
NaN
may be returned if the mode is not defined for the current values of the
distribution.public abstract double variance()
NaN
may be
returned if the variance is not defined for the current values of the distribution.
Infinity
is a possible value to be returned
by some distributions.public abstract double skewness()
NaN
may be
returned if the skewness is not defined for the current values of the distribution.public double standardDeviation()
NaN
may be
returned if the variance is not defined for the current values of the distribution.
Infinity
is a possible value to be returned
by some distributions.public abstract double min()
#pdf(double)
is meant to return
a value. Note that Double.NEGATIVE_INFINITY
is a valid return
value.#pdf(double)
is meant to
return a value.public abstract double max()
#pdf(double)
is meant to return
a value. Note that Double.POSITIVE_INFINITY
is a valid return
value.#pdf(double)
is meant to
return a value.public double[] sample(int numSamples, Random rand)
numSamples
- the number of random samples to takerand
- the source of randomnesspublic DenseVector sampleVec(int numSamples, Random rand)
numSamples
- the number of random samples to takerand
- the source of randomnesspublic abstract Distribution clone()
public static Function getFunctionCDF(Distribution dist)
cdf(double)
function of the given distribution in a
function object for use.dist
- the distribution to wrap the cdf ofCopyright © 2017. All rights reserved.