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

Extends the class ContinuousDistribution for the logistic distribution (e.g., [96]  (page 115)). More...

Inheritance diagram for umontreal.ssj.probdist.LogisticDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution

Public Member Functions

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

Detailed Description

Extends the class ContinuousDistribution for the logistic distribution (e.g., [96]  (page 115)).

It has location parameter \(\alpha\) and scale parameter \(\lambda> 0\). The density is

\[ f (x) = \frac{\lambda e^{-\lambda(x - \alpha)}}{(1 + e^{-\lambda(x - \alpha)})^2} \qquad\qquad\mbox{for } -\infty< x < \infty, \tag{flogistic} \]

and the distribution function is

\[ F(x) = \frac{1}{1 + e^{-\lambda(x - \alpha)}} \qquad\qquad\mbox{for } -\infty< x < \infty. \tag{Flogistic} \]

For \(\lambda=1\) and \(\alpha=0\), one can write

\[ F(x) = \frac{1 + \tanh({x/2})}{2}. \]

The inverse distribution function is given by

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

Definition at line 48 of file LogisticDist.java.

Constructor & Destructor Documentation

◆ LogisticDist() [1/2]

umontreal.ssj.probdist.LogisticDist.LogisticDist ( )

Constructs a LogisticDist object with default parameters.

\(\alpha= 0\) and \(\lambda=1\).

Definition at line 128 of file LogisticDist.java.

◆ LogisticDist() [2/2]

umontreal.ssj.probdist.LogisticDist.LogisticDist ( double alpha,
double lambda )

Constructs a LogisticDist object with parameters \(\alpha\) = alpha and \(\lambda\) = lambda.

Definition at line 136 of file LogisticDist.java.

Member Function Documentation

◆ barF() [1/2]

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

Computes the complementary distribution function \(1-F(x)\).

Definition at line 197 of file LogisticDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.LogisticDist.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 148 of file LogisticDist.java.

◆ cdf() [1/2]

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

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

Definition at line 185 of file LogisticDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.LogisticDist.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 144 of file LogisticDist.java.

◆ density() [1/2]

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

Computes the density function \(f(x)\).

Definition at line 171 of file LogisticDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.LogisticDist.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 140 of file LogisticDist.java.

◆ getAlpha()

double umontreal.ssj.probdist.LogisticDist.getAlpha ( )

Return the parameter \(\alpha\) of this object.

Definition at line 331 of file LogisticDist.java.

◆ getInstanceFromMLE()

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

Creates a new instance of a logistic distribution with parameters.

\(\alpha\) and \(\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 282 of file LogisticDist.java.

◆ getLambda()

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

Returns the parameter \(\lambda\) of this object.

Definition at line 338 of file LogisticDist.java.

◆ getMean() [1/2]

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

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 156 of file LogisticDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.LogisticDist.getMean ( double alpha,
double lambda )
static

Computes and returns the mean \(E[X] = \alpha\) of the logistic distribution with parameters \(\alpha\) and \(\lambda\).

Returns
the mean of the logistic distribution \(E[X] = \alpha\)

Definition at line 293 of file LogisticDist.java.

◆ getMLE()

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

Estimates the parameters \((\alpha, \lambda)\) of the logistic 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: [ \(\alpha\), \(\lambda\)]. The maximum likelihood estimators are the values

\((\hat{\alpha}, \hat{\lambda})\) that satisfy the equations:

\begin{align*} \sum_{i=1}^n \frac{1}{1 + e^{\hat{\lambda} (x_i - \hat{\alpha})}} & = \frac{n}{2} \\ \sum_{i=1}^n \hat{\lambda} (x_i - \hat{\alpha}) \frac{1 - e^{\hat{\lambda} (x_i - \hat{\alpha})}}{1 + e^{\hat{\lambda} (x_i - \hat{\alpha})}} & = n. \end{align*}

See [55]  (page 128).

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

Definition at line 240 of file LogisticDist.java.

◆ getParams()

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

Return a table containing the parameters of the current distribution.

This table is put in regular order: [ \(\alpha\), \(\lambda\)].

Implements umontreal.ssj.probdist.Distribution.

Definition at line 356 of file LogisticDist.java.

◆ getStandardDeviation() [1/2]

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

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 164 of file LogisticDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.LogisticDist.getStandardDeviation ( double alpha,
double lambda )
static

Computes and returns the standard deviation of the logistic distribution with parameters \(\alpha\) and \(\lambda\).

Returns
the standard deviation of the logistic distribution

Definition at line 321 of file LogisticDist.java.

◆ getVariance() [1/2]

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

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 160 of file LogisticDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.LogisticDist.getVariance ( double alpha,
double lambda )
static

Computes and returns the variance \(\mbox{Var}[X] = \pi^2 /(3\lambda^2)\) of the logistic distribution with parameters.

\(\alpha\) and \(\lambda\).

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

Definition at line 308 of file LogisticDist.java.

◆ inverseF() [1/2]

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

Computes the inverse distribution function \(F^{-1}(u)\).

Definition at line 209 of file LogisticDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.LogisticDist.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 152 of file LogisticDist.java.

◆ setParams()

void umontreal.ssj.probdist.LogisticDist.setParams ( double alpha,
double lambda )

Sets the parameters \(\alpha\) and \(\lambda\) of this object.

Definition at line 345 of file LogisticDist.java.

◆ toString()

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

Returns a String containing information about the current distribution.

Definition at line 364 of file LogisticDist.java.


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