SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdist.ExponentialDist Class Reference

Extends the class ContinuousDistribution for the exponential distribution [95]  (page 494) with mean \(1/\lambda\) where \(\lambda> 0\) is the rate parameter. More...

Inheritance diagram for umontreal.ssj.probdist.ExponentialDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution umontreal.ssj.probdist.ExponentialDistFromMean

Public Member Functions

 ExponentialDist ()
 Constructs an ExponentialDist object with rate parameter \(\lambda\) = 1.
 ExponentialDist (double lambda)
 Constructs an ExponentialDist object with rate parameter \(\lambda\) = lambda.
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 getLambda ()
 Returns the value of \(\lambda\) for this object.
void setLambda (double lambda)
 Sets the value of \(\lambda\) 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 lambda, double x)
 Computes the density function.
static double cdf (double lambda, double x)
 Computes the distribution function.
static double barF (double lambda, double x)
 Computes the complementary distribution function.
static double inverseF (double lambda, double u)
 Computes the inverse distribution function.
static double[] getMLE (double[] x, int n)
 Estimates the rate parameter \(\lambda\) of the exponential distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).
static ExponentialDist getInstanceFromMLE (double[] x, int n)
 Creates a new instance of an exponential distribution with rate parameter.
static double getMean (double lambda)
 Computes and returns the mean, \(E[X] = 1/\lambda\), of the exponential distribution with rate parameter \(\lambda\).
static double getVariance (double lambda)
 Computes and returns the variance, \(\mbox{Var}[X] = 1/\lambda^2\), of the exponential distribution with rate parameter.
static double getStandardDeviation (double lambda)
 Computes and returns the standard deviation of the exponential distribution with rate parameter \(\lambda\).

Detailed Description

Extends the class ContinuousDistribution for the exponential distribution [95]  (page 494) with mean \(1/\lambda\) where \(\lambda> 0\) is the rate parameter.

Its density is

\[ f(x) = \lambda e^{-\lambda x} \qquad\mbox{for }x\ge0, \tag{fexpon} \]

its distribution function is

\[ F(x) = 1 - e^{-\lambda x},\qquad\mbox{for }x \ge0, \tag{Fexpon} \]

and its inverse distribution function is

\[ F^{-1}(u) = -\ln(1-u)/\lambda, \qquad\mbox{for } 0 < u < 1. \]

Definition at line 44 of file ExponentialDist.java.

Constructor & Destructor Documentation

◆ ExponentialDist() [1/2]

umontreal.ssj.probdist.ExponentialDist.ExponentialDist ( )

Constructs an ExponentialDist object with rate parameter \(\lambda\) = 1.

Definition at line 50 of file ExponentialDist.java.

◆ ExponentialDist() [2/2]

umontreal.ssj.probdist.ExponentialDist.ExponentialDist ( double lambda)

Constructs an ExponentialDist object with rate parameter \(\lambda\) = lambda.

Definition at line 58 of file ExponentialDist.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.ExponentialDist.barF ( double lambda,
double x )
static

Computes the complementary distribution function.

Definition at line 116 of file ExponentialDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.ExponentialDist.barF ( double x)

Returns the complementary distribution function.

The default implementation computes \(\bar{F}(x) = 1 - F(x)\).

Parameters
xvalue at which the complementary distribution function is evaluated
Returns
complementary distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 70 of file ExponentialDist.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.ExponentialDist.cdf ( double lambda,
double x )
static

Computes the distribution function.

Definition at line 102 of file ExponentialDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.ExponentialDist.cdf ( double x)

Returns the distribution function \(F(x)\).

Parameters
xvalue at which the distribution function is evaluated
Returns
distribution function evaluated at x

Implements umontreal.ssj.probdist.Distribution.

Definition at line 66 of file ExponentialDist.java.

◆ density() [1/2]

double umontreal.ssj.probdist.ExponentialDist.density ( double lambda,
double x )
static

Computes the density function.

Definition at line 93 of file ExponentialDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.ExponentialDist.density ( double x)

Returns \(f(x)\), the density evaluated at \(x\).

Parameters
xvalue at which the density is evaluated
Returns
density function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 62 of file ExponentialDist.java.

◆ getInstanceFromMLE()

ExponentialDist umontreal.ssj.probdist.ExponentialDist.getInstanceFromMLE ( double[] x,
int n )
static

Creates a new instance of an exponential distribution with rate parameter.

\(\lambda\) estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\).

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters

Definition at line 176 of file ExponentialDist.java.

◆ getLambda()

double umontreal.ssj.probdist.ExponentialDist.getLambda ( )

Returns the value of \(\lambda\) for this object.

Definition at line 224 of file ExponentialDist.java.

◆ getMean() [1/2]

double umontreal.ssj.probdist.ExponentialDist.getMean ( )

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 78 of file ExponentialDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.ExponentialDist.getMean ( double lambda)
static

Computes and returns the mean, \(E[X] = 1/\lambda\), of the exponential distribution with rate parameter \(\lambda\).

Returns
the mean of the exponential distribution \(E[X] = 1 / \lambda\)

Definition at line 187 of file ExponentialDist.java.

◆ getMLE()

double[] umontreal.ssj.probdist.ExponentialDist.getMLE ( double[] x,
int n )
static

Estimates the rate parameter \(\lambda\) of the exponential distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1,…, n-1\).

The estimate is returned in a one-element array, as element 0. The equation of the maximum likelihood is defined as \(\hat{\lambda} = 1/\bar{x}_n\), where \(\bar{x}_n\) is the average of \(x[0],…,x[n-1]\) (see

[95]  (page 506)).

Parameters
xthe list of observations used to evaluate parameters
nthe number of observations used to evaluate parameters
Returns
returns the parameter [ \(\hat{\lambda}\)]

Definition at line 154 of file ExponentialDist.java.

◆ getParams()

double[] umontreal.ssj.probdist.ExponentialDist.getParams ( )

Return a table containing the parameters of the current distribution.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 241 of file ExponentialDist.java.

◆ getStandardDeviation() [1/2]

double umontreal.ssj.probdist.ExponentialDist.getStandardDeviation ( )

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 86 of file ExponentialDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.ExponentialDist.getStandardDeviation ( double lambda)
static

Computes and returns the standard deviation of the exponential distribution with rate parameter \(\lambda\).

Returns
the standard deviation of the exponential distribution

Definition at line 214 of file ExponentialDist.java.

◆ getVariance() [1/2]

double umontreal.ssj.probdist.ExponentialDist.getVariance ( )

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 82 of file ExponentialDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.ExponentialDist.getVariance ( double lambda)
static

Computes and returns the variance, \(\mbox{Var}[X] = 1/\lambda^2\), of the exponential distribution with rate parameter.

\(\lambda\).

Returns
the variance of the Exponential distribution \(\mbox{Var}[X] = 1 / \lambda^2\)

Definition at line 201 of file ExponentialDist.java.

◆ inverseF() [1/2]

double umontreal.ssj.probdist.ExponentialDist.inverseF ( double lambda,
double u )
static

Computes the inverse distribution function.

Definition at line 129 of file ExponentialDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.ExponentialDist.inverseF ( double u)

Returns the inverse distribution function \(x = F^{-1}(u)\).

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 74 of file ExponentialDist.java.

◆ setLambda()

void umontreal.ssj.probdist.ExponentialDist.setLambda ( double lambda)

Sets the value of \(\lambda\) for this object.

Definition at line 231 of file ExponentialDist.java.

◆ toString()

String umontreal.ssj.probdist.ExponentialDist.toString ( )

Returns a String containing information about the current distribution.

Definition at line 249 of file ExponentialDist.java.


The documentation for this class was generated from the following file: