public class TriangleDistribution extends Distribution implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
DOWN |
static int |
UP |
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
TriangleDistribution()
This default constructor creates a new triangle distribution on the interval
(0, 1) with positive slope.
|
TriangleDistribution(double a,
double b,
int i)
This general constructor creates a new triangle distribution on a specified
interval and with a specified orientation.
|
Modifier and Type | Method and Description |
---|---|
double |
getCDF(double x)
This method computes the cumulative distribution function.
|
double |
getDensity(double x)
This method computes the density.
|
double |
getLowerBound()
This method returns the lower bound
|
double |
getMaxDensity()
This method computes the maximum value of the density function.
|
double |
getMean()
This method computes the mean.
|
int |
getOrientation()
This method returns the orientation.
|
double |
getUpperBound()
This method returns the upper bound.
|
double |
getVariance()
This method computes the variance.
|
void |
setLowerBound(double a)
This method sets the lower bound
|
void |
setOrientation(int i)
This method sets the orientation.
|
void |
setParameters(double a,
double b,
int i)
This method sets the parameters: the minimum value, maximum value, and
orientation.
|
void |
setUpperBound(double b)
This method sets the upper bound.
|
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.
|
getDomain, getFailureRate, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomain
public static final int UP
public static final int DOWN
public TriangleDistribution(double a, double b, int i)
a
- the left endpoint of the domainb
- the right endpoint of the domain
param i the orientation (UP or DOWN)public TriangleDistribution()
public void setParameters(double a, double b, int i)
a
- the left endpoint of the domainb
- the right endpoint of the domaini
- the orientation (UP or DOWN)public double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain of the distributionpublic double getMaxDensity()
getMaxDensity
in class Distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public void setLowerBound(double a)
a
- the lower boundpublic double getLowerBound()
public void setUpperBound(double b)
b
- the upper boundpublic double getUpperBound()
public void setOrientation(int i)
i
- the orientation (UP or DOWN)public int getOrientation()
public double simulate()
simulate
in class Distribution
public double getCDF(double x)
getCDF
in class Distribution
x
- a number in the domain of the distributionpublic java.lang.String toString()
toString
in class Distribution