public class FiniteDistribution extends Distribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
FiniteDistribution()
This special constructor creates a new uniform distribution on {1, 2..., 6}.
|
FiniteDistribution(double a,
double b,
double w)
This special constructor creates the uniform distribuiton on the finite set
of points.
|
FiniteDistribution(double a,
double b,
double w,
double[] p)
This general constructor creates a new finite distribution on a finite set of
points with a specified array of probabilities.
|
Modifier and Type | Method and Description |
---|---|
double |
getDensity(double x)
This method computes the probability density function.
|
double |
getLowerValue()
This method returns the lower value.
|
double[] |
getProbabilities()
This method gets the entire array of probabilities.
|
double |
getProbabilities(int i)
This method gets the probability for a specified index.
|
int |
getSize()
This method returns the size (the number of values).
|
double |
getUpperValue()
This method returns the lower value.
|
double |
getWidth()
This method returns the width.
|
void |
setLowerValue(double a)
This method sets the lower value.
|
void |
setParameters(double a,
double b,
double w)
This method sets the domain parameters.
|
void |
setParameters(double a,
double b,
double w,
double[] p)
This method sets the parameters: the domain and the probabilities.
|
void |
setProbabilities(double[] p)
This method sets the probabilities.
|
void |
setProbabilities(int i,
double p)
This method sets an individual probability.
|
void |
setUpperValue(double b)
This method sets the upper value.
|
void |
setWidth(double w)
This method sets the step size.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getCDF, getDomain, getFailureRate, getMaxDensity, getMean, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, getVariance, setDomain, setDomain, simulate
public FiniteDistribution(double a, double b, double w, double[] p)
a
- the lower value of the domainb
- the upper value of the domainw
- the step size of the domainp
- the array of probabilitiespublic FiniteDistribution(double a, double b, double w)
a
- the lower value of the domainb
- the upper value of the domainw
- the step size of the domainpublic FiniteDistribution()
public void setParameters(double a, double b, double w, double[] p)
a
- the lower value of the domainb
- the upper value of the domainw
- the step size of the domainp
- the array of probabilitiespublic void setParameters(double a, double b, double w)
a
- the lower value of the domainb
- the upper value of the domainw
- the step size of the domainpublic double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain of the distributionpublic void setProbabilities(double[] p)
p
- the array of probabilitiespublic void setProbabilities(int i, double p)
i
- the indexp
- the probabilitypublic double getProbabilities(int i)
i
- the indexpublic double[] getProbabilities()
public void setLowerValue(double a)
a
- the lower valuepublic double getLowerValue()
public void setUpperValue(double b)
b
- the upper valuepublic double getUpperValue()
public void setWidth(double w)
w
- the widthpublic double getWidth()
public int getSize()
public java.lang.String toString()
toString
in class Distribution