public class DieDistribution extends FiniteDistribution implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
FAIR |
static int |
FLAT16 |
static int |
FLAT25 |
static int |
FLAT34 |
static int |
LEFT |
static int |
RIGHT |
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
DieDistribution()
This default constructor creates a new fair die distribution.
|
DieDistribution(double[] p)
This general constructor creates a new die distribution with specified
probabilities.
|
DieDistribution(int n)
This special constructor creates a new die distribution of a special type (1-6 flat,
2-5 flat, 3-4 flat, skewed left, skewed right, or fair).
|
Modifier and Type | Method and Description |
---|---|
void |
setParameters(double a,
double b,
double w,
double[] p)
This method ensures that the finite distribution parameters are not changed
to inappropriate values.
|
void |
setProbabilities(double[] p)
This method sets the probabilities.
|
void |
setProbabilities(int n)
This method specifies the probabilities for the special types (fair, 1-6 flat,
2-5 flat, 3-4 flat, skewed left, or skewed right).
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getDensity, getLowerValue, getProbabilities, getProbabilities, getSize, getUpperValue, getWidth, setLowerValue, setParameters, setProbabilities, setUpperValue, setWidth
getCDF, getDomain, getFailureRate, getMaxDensity, getMean, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, getVariance, setDomain, setDomain, simulate
public static final int FAIR
public static final int FLAT16
public static final int FLAT25
public static final int FLAT34
public static final int LEFT
public static final int RIGHT
public DieDistribution(double[] p)
p
- the array of probabilitiespublic DieDistribution(int n)
n
- the type of distributionpublic DieDistribution()
public void setProbabilities(int n)
n
- the type of distributionpublic void setProbabilities(double[] p)
setProbabilities
in class FiniteDistribution
p
- the array of probabilitiespublic void setParameters(double a, double b, double w, double[] p)
setParameters
in class FiniteDistribution
a
- the lower value of the domainb
- the upper value of the domainw
- the step size of the domainp
- the array of probabilitiespublic java.lang.String toString()
toString
in class FiniteDistribution