|
||||||||||
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
public class FiniteDistribution
This class models a basic discrete distribution on a finite set of points, with specified probabilities.
Field Summary |
---|
Fields inherited from class edu.uah.math.distributions.Distribution |
---|
CONTINUOUS, DISCRETE, MIXED |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
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, simulate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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()
Method Detail |
---|
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 distribution
public 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 index
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |