Extends the class ContinuousDistribution for the Laplace distribution (see, e.g., [96] (page 165)). More...
Public Member Functions | |
| LaplaceDist () | |
| Constructs a LaplaceDist object with default parameters \(\mu= 0\) and \(\beta= 1\). | |
| LaplaceDist (double mu, double beta) | |
| Constructs a LaplaceDist object with parameters \(\mu\) = mu and \(\beta\) = beta. | |
| 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 | getMu () |
| Returns the parameter \(\mu\). | |
| double | getBeta () |
| Returns the parameter \(\beta\). | |
| 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 mu, double beta, double x) |
| Computes the Laplace density function. | |
| static double | cdf (double mu, double beta, double x) |
| Computes the Laplace distribution function. | |
| static double | barF (double mu, double beta, double x) |
| Computes the Laplace complementary distribution function. | |
| static double | inverseF (double mu, double beta, double u) |
| Computes the inverse Laplace distribution function. | |
| static double[] | getMLE (double[] x, int n) |
| Estimates the parameters \((\mu, \beta)\) of the Laplace distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i
= 0, 1,…, n-1\). | |
| static LaplaceDist | getInstanceFromMLE (double[] x, int n) |
| Creates a new instance of a Laplace distribution with parameters. | |
| static double | getMean (double mu, double beta) |
| Computes and returns the mean \(E[X] = \mu\) of the Laplace distribution with parameters \(\mu\) and \(\beta\). | |
| static double | getVariance (double mu, double beta) |
| Computes and returns the variance \(\mbox{Var}[X] = 2 \beta^2\) of the Laplace distribution with parameters \(\mu\) and. | |
| static double | getStandardDeviation (double mu, double beta) |
| Computes and returns the standard deviation of the Laplace distribution with parameters \(\mu\) and \(\beta\). | |
Extends the class ContinuousDistribution for the Laplace distribution (see, e.g., [96] (page 165)).
It has location parameter \(\mu\) and scale parameter \(\beta> 0\). The density function is given by
\[ f(x) = \frac{e^{-|x - \mu|/\beta}}{2\beta} \qquad\mbox{ for }-\infty< x < \infty. \tag{flaplace} \]
The distribution function is
\[ F (x) = \left\{\begin{array}{ll} \frac{1}{2} e^{(x - \mu)/\beta} & \mbox{ if } x\le\mu, \\ 1 - \frac{1}{2} e^{(\mu- x)/\beta} & \mbox{ otherwise, } \end{array}\right. \]
and its inverse is
\[ F^{-1} (u) = \left\{\begin{array}{ll} \beta\log(2u) + \mu & \mbox{ if } 0\le u\le\frac{1}{2}, \\ \mu- \beta\log(2(1-u)) & \mbox{ otherwise. } \end{array}\right. \]
Definition at line 47 of file LaplaceDist.java.
| umontreal.ssj.probdist.LaplaceDist.LaplaceDist | ( | ) |
Constructs a LaplaceDist object with default parameters \(\mu= 0\) and \(\beta= 1\).
Definition at line 55 of file LaplaceDist.java.
| umontreal.ssj.probdist.LaplaceDist.LaplaceDist | ( | double | mu, |
| double | beta ) |
Constructs a LaplaceDist object with parameters \(\mu\) = mu and \(\beta\) = beta.
Definition at line 64 of file LaplaceDist.java.
|
static |
Computes the Laplace complementary distribution function.
Definition at line 122 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.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 80 of file LaplaceDist.java.
|
static |
Computes the Laplace distribution function.
Definition at line 112 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.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 76 of file LaplaceDist.java.
|
static |
Computes the Laplace density function.
Definition at line 103 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.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 72 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.getBeta | ( | ) |
Returns the parameter \(\beta\).
Definition at line 246 of file LaplaceDist.java.
|
static |
Creates a new instance of a Laplace distribution with parameters.
\(\mu\) and \(\beta\) estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\).
| x | the list of observations to use to evaluate parameters |
| n | the number of observations to use to evaluate parameters |
Definition at line 191 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.getMean | ( | ) |
Returns the mean.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 88 of file LaplaceDist.java.
|
static |
Computes and returns the mean \(E[X] = \mu\) of the Laplace distribution with parameters \(\mu\) and \(\beta\).
Definition at line 202 of file LaplaceDist.java.
|
static |
Estimates the parameters \((\mu, \beta)\) of the Laplace distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).
The estimates are returned in a two-element array, in regular order: [ \(\mu\), \(\beta\)]. The maximum likelihood estimators are the values
\((\hat{\mu}, \hat{\beta})\) that satisfy the equations:
\begin{align*} \hat{\mu} & = \mbox{the median of } \{x_1,…,x_n\} \\ \hat{\beta} & = \frac{1}{n} \sum_{i=1}^n |x_i - \hat{\mu}|. \end{align*}
See [96] (page 172).
| x | the list of observations used to evaluate parameters |
| n | the number of observations used to evaluate parameters |
Definition at line 166 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.getMu | ( | ) |
Returns the parameter \(\mu\).
Definition at line 239 of file LaplaceDist.java.
| double[] umontreal.ssj.probdist.LaplaceDist.getParams | ( | ) |
Return a table containing the parameters of the current distribution.
This table is put in regular order: [ \(\mu\), \(\beta\)].
Implements umontreal.ssj.probdist.Distribution.
Definition at line 254 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.getStandardDeviation | ( | ) |
Returns the standard deviation.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 96 of file LaplaceDist.java.
|
static |
Computes and returns the standard deviation of the Laplace distribution with parameters \(\mu\) and \(\beta\).
Definition at line 229 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.getVariance | ( | ) |
Returns the variance.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 92 of file LaplaceDist.java.
|
static |
Computes and returns the variance \(\mbox{Var}[X] = 2 \beta^2\) of the Laplace distribution with parameters \(\mu\) and.
\(\beta\).
Definition at line 216 of file LaplaceDist.java.
|
static |
Computes the inverse Laplace distribution function.
Definition at line 137 of file LaplaceDist.java.
| double umontreal.ssj.probdist.LaplaceDist.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 84 of file LaplaceDist.java.
| String umontreal.ssj.probdist.LaplaceDist.toString | ( | ) |
Returns a String containing information about the current distribution.
Definition at line 262 of file LaplaceDist.java.