|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uah.math.distributions.Distribution edu.uah.math.distributions.FiniteDistribution edu.uah.math.distributions.DiscreteUniformDistribution
public class DiscreteUniformDistribution
This class models the discrete uniform distribution on a finite set.
Field Summary |
---|
Fields inherited from class edu.uah.math.distributions.Distribution |
---|
CONTINUOUS, DISCRETE, MIXED |
Constructor Summary | |
---|---|
DiscreteUniformDistribution()
This default constructor creates a new discrete uniform distribution on {1, 2, 3, 4, 5, 6}. |
|
DiscreteUniformDistribution(double a,
double b,
double w)
This general constructor creates a new discrete uniform distribution on a specified domain. |
Method Summary | |
---|---|
void |
setParameters(double a,
double b,
double w,
double[] p)
This method sets the finite distribution parameters to ensure that the uniform distribution is not changed. |
void |
setProbabilities(double[] p)
This method sets the probabilities to ensure that the uniform distribution is not changed. |
double |
simulate()
This method simulates a value from the distribution. |
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of the parameters. |
Methods inherited from class edu.uah.math.distributions.FiniteDistribution |
---|
getDensity, getLowerValue, getProbabilities, getProbabilities, getSize, getUpperValue, getWidth, setLowerValue, setParameters, setProbabilities, setUpperValue, setWidth |
Methods inherited from class edu.uah.math.distributions.Distribution |
---|
getCDF, getDomain, getFailureRate, getMaxDensity, getMean, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, getVariance, setDomain, setDomain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DiscreteUniformDistribution(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 DiscreteUniformDistribution()
Method Detail |
---|
public double simulate()
simulate
in class Distribution
public 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 valueb
- the upper valuew
- the widthp
- the array of probabilitiespublic java.lang.String toString()
toString
in class FiniteDistribution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |