Extends the class ContinuousDistribution for the triangular distribution (see [96] (page 297) and. More...
Public Member Functions | |
| TriangularDist () | |
| Constructs a TriangularDist object with default parameters. | |
| TriangularDist (double m) | |
| Constructs a TriangularDist object with parameters \(a = 0\) ,. | |
| TriangularDist (double a, double b, double m) | |
| Constructs a TriangularDist object with parameters \(a\),. | |
| double | density (double x) |
| Returns \(f(x)\), the density evaluated at \(x\). | |
| double | cdf (double x) |
| Returns the distribution function \(F(x)\). | |
| double | barF (double x) |
| Returns the complementary distribution function. | |
| double | inverseF (double u) |
| Returns the inverse distribution function \(x = F^{-1}(u)\). | |
| double | getMean () |
| Returns the mean. | |
| double | getVariance () |
| Returns the variance. | |
| double | getStandardDeviation () |
| Returns the standard deviation. | |
| double | getA () |
| Returns the value of \(a\) for this object. | |
| double | getB () |
| Returns the value of \(b\) for this object. | |
| double | getM () |
| Returns the value of \(m\) for this object. | |
| void | setParams (double a, double b, double m) |
| Sets the value of the parameters \(a\), \(b\) and \(m\) for this object. | |
| double[] | getParams () |
| Return a table containing the parameters of the current distribution. | |
| String | toString () |
| Returns a String containing information about the current distribution. | |
| Public Member Functions inherited from umontreal.ssj.probdist.ContinuousDistribution | |
| double | inverseBrent (double a, double b, double u, double tol) |
| Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method. | |
| double | inverseBisection (double u) |
| Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection. | |
| double | getXinf () |
| Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). | |
| double | getXsup () |
| Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). | |
| void | setXinf (double xa) |
| Sets the value \(x_a=\) xa, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). | |
| void | setXsup (double xb) |
| Sets the value \(x_b=\) xb, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\). | |
Static Public Member Functions | |
| static double | density (double a, double b, double m, double x) |
| Computes the density function. | |
| static double | cdf (double a, double b, double m, double x) |
| Computes the distribution function. | |
| static double | barF (double a, double b, double m, double x) |
| Computes the complementary distribution function. | |
| static double | inverseF (double a, double b, double m, double u) |
| Computes the inverse distribution function. | |
| static double[] | getMLE (double[] x, int n, double a, double b) |
| Estimates the parameter \(m\) of the triangular distribution using the maximum likelihood method, from the \(n\) observations. | |
| static TriangularDist | getInstanceFromMLE (double[] x, int n, double a, double b) |
| Creates a new instance of a triangular distribution with parameters a and b. | |
| static double | getMean (double a, double b, double m) |
| Computes and returns the mean \(E[X] = (a + b + m)/3\) of the triangular distribution with parameters \(a\), \(b\), \(m\). | |
| static double | getVariance (double a, double b, double m) |
| Computes and returns the variance \(\mbox{Var}[X] = (a^2 + b^2 + m^2 - ab -
am - bm)/18\) of the triangular distribution with parameters \(a\), \(b\), \(m\). | |
| static double | getStandardDeviation (double a, double b, double m) |
| Computes and returns the standard deviation of the triangular distribution with parameters \(a\), \(b\), \(m\). | |
Extends the class ContinuousDistribution for the triangular distribution (see [96] (page 297) and.
[114] (page 317)) with domain \([a,b]\) and mode (or shape parameter) \(m\), where \(a\le m\le b\). The density function is
\[ f(x) = \left\{\begin{array}{ll} \frac{2(x-a)}{(b-a)(m-a)} & \mbox{ if } a\le x\le m, \\ \frac{2(b-x)}{(b-a)(b-m)} & \mbox{ if } m\le x\le b, \\ 0 & \mbox{ elsewhere, } \end{array}\right. \tag{ftrian} \]
the distribution function is
\[ F (x) = \left\{\begin{array}{ll} 0 & \mbox{ for } x < a, \\ \frac{(x - a)^2}{(b - a)(m - a)} & \mbox{ if } a\le x\le m, \\ 1 - \frac{(b - x)^2}{(b - a)(b - m)} & \mbox{ if } m\le x\le b, \\ 1 & \mbox{ for } x > b, \end{array}\right. \]
and the inverse distribution function is given by
\[ F^{-1}(u) = \left\{\begin{array}{ll} a + \sqrt{(b - a)(m - a)u} & \mbox{ if } 0\le u\le\frac{m-a}{b-a}, \\ b - \sqrt{(b - a)(b - m)(1 - u)} & \mbox{ if } \frac{m-a}{b-a}\le u \le1. \end{array}\right. \]
Definition at line 52 of file TriangularDist.java.
| umontreal.ssj.probdist.TriangularDist.TriangularDist | ( | ) |
Constructs a TriangularDist object with default parameters.
\(a=0\), \(b=1\), and \(m=0.5\).
Definition at line 62 of file TriangularDist.java.
| umontreal.ssj.probdist.TriangularDist.TriangularDist | ( | double | m | ) |
Constructs a TriangularDist object with parameters \(a = 0\) ,.
\(b = 1\) and \(m\) = m.
Definition at line 71 of file TriangularDist.java.
| umontreal.ssj.probdist.TriangularDist.TriangularDist | ( | double | a, |
| double | b, | ||
| double | m ) |
Constructs a TriangularDist object with parameters \(a\),.
\(b\) and \(m\).
Definition at line 80 of file TriangularDist.java.
|
static |
Computes the complementary distribution function.
Definition at line 145 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.barF | ( | double | x | ) |
Returns the complementary distribution function.
The default implementation computes \(\bar{F}(x) = 1 - F(x)\).
| x | value at which the complementary distribution function is evaluated |
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 92 of file TriangularDist.java.
|
static |
Computes the distribution function.
Definition at line 129 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.cdf | ( | double | x | ) |
Returns the distribution function \(F(x)\).
| x | value at which the distribution function is evaluated |
Implements umontreal.ssj.probdist.Distribution.
Definition at line 88 of file TriangularDist.java.
|
static |
Computes the density function.
Definition at line 115 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.density | ( | double | x | ) |
Returns \(f(x)\), the density evaluated at \(x\).
| x | value at which the density is evaluated |
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 84 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.getA | ( | ) |
Returns the value of \(a\) for this object.
Definition at line 287 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.getB | ( | ) |
Returns the value of \(b\) for this object.
Definition at line 294 of file TriangularDist.java.
|
static |
Creates a new instance of a triangular distribution with parameters a and b.
\(m\) is estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\).
| x | the list of observations used to evaluate parameters |
| n | the number of observations used to evaluate parameters |
| a | lower limit of range |
| b | upper limit of range |
Definition at line 238 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.getM | ( | ) |
Returns the value of \(m\) for this object.
Definition at line 301 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.getMean | ( | ) |
Returns the mean.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 100 of file TriangularDist.java.
|
static |
Computes and returns the mean \(E[X] = (a + b + m)/3\) of the triangular distribution with parameters \(a\), \(b\), \(m\).
Definition at line 249 of file TriangularDist.java.
|
static |
Estimates the parameter \(m\) of the triangular distribution using the maximum likelihood method, from the \(n\) observations.
\(x[i]\), \(i = 0, 1,…, n-1\). The estimated parameter is returned in a one-element array: [ \(\hat{m}\)]. See [183], [88], [110] .
| x | the list of observations used to evaluate parameters |
| n | the number of observations used to evaluate parameters |
| a | lower limit of range |
| b | upper limit of range |
Definition at line 189 of file TriangularDist.java.
| double[] umontreal.ssj.probdist.TriangularDist.getParams | ( | ) |
Return a table containing the parameters of the current distribution.
This table is put in regular order: [ \(a\), \(b\), \(m\)].
Implements umontreal.ssj.probdist.Distribution.
Definition at line 327 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.getStandardDeviation | ( | ) |
Returns the standard deviation.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 108 of file TriangularDist.java.
|
static |
Computes and returns the standard deviation of the triangular distribution with parameters \(a\), \(b\), \(m\).
Definition at line 280 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.getVariance | ( | ) |
Returns the variance.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 104 of file TriangularDist.java.
|
static |
Computes and returns the variance \(\mbox{Var}[X] = (a^2 + b^2 + m^2 - ab - am - bm)/18\) of the triangular distribution with parameters \(a\), \(b\), \(m\).
Definition at line 265 of file TriangularDist.java.
|
static |
Computes the inverse distribution function.
Definition at line 161 of file TriangularDist.java.
| double umontreal.ssj.probdist.TriangularDist.inverseF | ( | double | u | ) |
Returns the inverse distribution function \(x = F^{-1}(u)\).
Restrictions: \(u \in[0,1]\).
| u | value at which the inverse distribution function is evaluated |
| IllegalArgumentException | if \(u\) is not in the interval \([0,1]\) |
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 96 of file TriangularDist.java.
| void umontreal.ssj.probdist.TriangularDist.setParams | ( | double | a, |
| double | b, | ||
| double | m ) |
Sets the value of the parameters \(a\), \(b\) and \(m\) for this object.
Definition at line 309 of file TriangularDist.java.
| String umontreal.ssj.probdist.TriangularDist.toString | ( | ) |
Returns a String containing information about the current distribution.
Definition at line 335 of file TriangularDist.java.