public abstract class Distribution
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CONTINUOUS |
static int |
DISCRETE |
static int |
MIXED |
Constructor and Description |
---|
Distribution() |
Modifier and Type | Method and Description |
---|---|
double |
getCDF(double x)
This method returns a default approximate cumulative distribution function.
|
abstract double |
getDensity(double x)
This method defines the probability density function of the distribution.
|
Domain |
getDomain()
This method returns the domain of the distribution.
|
double |
getFailureRate(double x)
This method computes the failure rate function.
|
double |
getMaxDensity()
This method returns the largest (finite) value of the probability density function
on the finite set of domain values.
|
double |
getMean()
This method returns a default approximate mean.
|
double |
getMedian()
This method computes a default approximate median.
|
double |
getMGF(double t)
This method computes a default approximation to the moment generating function.
|
double |
getMoment(double a,
int n)
This method returns a default approximation of the moment of a specified order
about a specified point.
|
double |
getMoment(int n)
This method returns a default approximation of the moment of a specified order
about 0.
|
double |
getPGF(double t)
This method computes a default approximation to the probability generating function.
|
double |
getQuantile(double p)
This method computes an approximate quantile function.
|
double |
getSD()
This method returns the standard deviation, as the square root of the variance.
|
int |
getType()
This method returns the type of the distribution (discrete or continuous).
|
double |
getVariance()
This method returns a default approximate variance.
|
protected void |
setDomain(Domain d)
This method sets the domain of the distribution for purposes of data collection
and for default computations.
|
void |
setDomain(double a,
double b,
double w,
int t)
This method sets the domain of the distribution for purposes of data collection
and for default computations.
|
double |
simulate()
This method computes a default simulation of a value from the distribution,
as a random quantile.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
public static final int DISCRETE
public static final int CONTINUOUS
public static final int MIXED
public abstract double getDensity(double x)
x
- a number in the domain of the distributionprotected void setDomain(Domain d)
d
- the domainpublic void setDomain(double a, double b, double w, int t)
a
- lower value or bound of the domainb
- the upper value or bound of the domainw
- the width (step size) of the domaint
- the type of domain (DISCRETE or CONTINUOUS)public Domain getDomain()
public final int getType()
public double getMaxDensity()
public double getMoment(double a, int n)
a
- the centern
- the orderpublic double getMoment(int n)
n
- the orderpublic double getMean()
public double getVariance()
public double getSD()
public double getCDF(double x)
x
- a number in the domain of the distributionpublic double getQuantile(double p)
p
- a probability in (0, 1)public double simulate()
public double getMedian()
public double getFailureRate(double x)
x
- a number in the domain of the distributionpublic double getMGF(double t)
t
- a real numberpublic double getPGF(double t)
t
- a real numberpublic java.lang.String toString()
toString
in class java.lang.Object