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

Extends the class DiscreteDistributionInt for the logarithmic distribution. More...

Inheritance diagram for umontreal.ssj.probdist.LogarithmicDist:
umontreal.ssj.probdist.DiscreteDistributionInt umontreal.ssj.probdist.Distribution

Public Member Functions

 LogarithmicDist (double theta)
 Constructs a logarithmic distribution with parameter \(\theta= \) theta.
double prob (int x)
 Returns \(p(x)\), the probability of \(x\).
double cdf (int x)
 Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
double barF (int x)
 Returns \(\bar{F}(x)\), the complementary distribution function.
int inverseFInt (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), where.
double getMean ()
 Returns the mean of the distribution function.
double getVariance ()
 Returns the variance of the distribution function.
double getStandardDeviation ()
 Returns the standard deviation of the distribution function.
double getTheta ()
 Returns the \(\theta\) associated with this object.
void setTheta (double theta)
 Sets the \(\theta\) associated with 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.DiscreteDistributionInt
double cdf (double x)
 Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
double barF (double x)
 Returns \(\bar{F}(x)\), the complementary distribution function.
int getXinf ()
 Returns the lower limit \(x_a\) of the support of the probability mass function.
int getXsup ()
 Returns the upper limit \(x_b\) of the support of the probability mass function.
double inverseF (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), where.

Static Public Member Functions

static double prob (double theta, int x)
 Computes the logarithmic probability \(p(x)\) given in ( flogar ) .
static double cdf (double theta, int x)
 Computes the distribution function \(F(x)\).
static double barF (double theta, int x)
 Computes the complementary distribution function.
static double[] getMLE (int[] x, int n)
 Estimates the parameter \(\theta\) of the logarithmic distribution using the maximum likelihood method, from the \(n\) observations.
static LogarithmicDist getInstanceFromMLE (int[] x, int n)
 Creates a new instance of a logarithmic distribution with parameter.
static double getMean (double theta)
 Computes and returns the mean.
static double getVariance (double theta)
 Computes and returns the variance.
static double getStandardDeviation (double theta)
 Computes and returns the standard deviation of the logarithmic distribution with parameter \(\theta= \) theta.

Additional Inherited Members

Static Public Attributes inherited from umontreal.ssj.probdist.DiscreteDistributionInt
static double EPSILON = 1.0e-16
 Environment variable that determines what probability terms can be considered as negligible when building precomputed tables for distribution and mass functions.

Detailed Description

Extends the class DiscreteDistributionInt for the logarithmic distribution.

It has shape parameter \(\theta\), where \(0 < \theta<1\). Its mass function is

\[ p(x) = \frac{-\theta^x}{x\log(1- \theta)} \qquad\mbox{for } x = 1,2,3,…\tag{flogar} \]

Its distribution function is

\[ F(x) = \frac{-1}{\log(1 - \theta)}\sum_{i=1}^x \frac{\theta^i}{i}, \qquad\mbox{ for } x = 1, 2, 3, … \]

and is 0 for \( x\le0\).

Definition at line 46 of file LogarithmicDist.java.

Constructor & Destructor Documentation

◆ LogarithmicDist()

umontreal.ssj.probdist.LogarithmicDist.LogarithmicDist ( double theta)

Constructs a logarithmic distribution with parameter \(\theta= \) theta.

Definition at line 68 of file LogarithmicDist.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.LogarithmicDist.barF ( double theta,
int x )
static

Computes the complementary distribution function.

WARNING: The complementary distribution function is defined as \(\bar{F}(x) = P[X \ge x]\).

Definition at line 153 of file LogarithmicDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.LogarithmicDist.barF ( int x)

Returns \(\bar{F}(x)\), the complementary distribution function.

See the WARNING above. The default implementation returns 1.0 - cdf(x - 1), which is not accurate when \(F(x)\) is near 1.

Parameters
xvalue at which the complementary distribution function must be evaluated
Returns
the complementary distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.

Definition at line 90 of file LogarithmicDist.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.LogarithmicDist.cdf ( double theta,
int x )
static

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

Definition at line 134 of file LogarithmicDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.LogarithmicDist.cdf ( int x)

Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).

Parameters
xvalue at which the distribution function must be evaluated
Returns
the distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.

Definition at line 78 of file LogarithmicDist.java.

◆ getInstanceFromMLE()

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

Creates a new instance of a logarithmic distribution with parameter.

\(\theta\) 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 214 of file LogarithmicDist.java.

◆ getMean() [1/2]

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

Returns the mean of the distribution function.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 107 of file LogarithmicDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.LogarithmicDist.getMean ( double theta)
static

Computes and returns the mean.

\[ E[X] = \frac{-\theta}{(1 - \theta)\ln(1 - \theta)} \]

of the logarithmic distribution with parameter \(\theta= \) theta.

Returns
the mean of the logarithmic distribution \(E[X] = -\theta/ ((1 - \theta) ln(1 - \theta))\)

Definition at line 227 of file LogarithmicDist.java.

◆ getMLE()

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

Estimates the parameter \(\theta\) of the logarithmic distribution using the maximum likelihood method, from the \(n\) observations.

\(x[i]\), \(i = 0, 1, …, n-1\). The estimate is returned in element 0 of the returned array. The maximum likelihood estimator \(\hat{\theta}\) satisfies the equation (see [55]  (page 122))

\begin{align*} \bar{x}_n = \frac{-\hat{\theta}}{(1 - \hat{\theta}) \ln(1 - \hat{\theta})} \end{align*}

where \(\bar{x}_n\) is the average of \(x[0], …, x[n-1]\).

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

Definition at line 187 of file LogarithmicDist.java.

◆ getParams()

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

Return a table containing the parameters of the current distribution.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 282 of file LogarithmicDist.java.

◆ getStandardDeviation() [1/2]

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

Returns the standard deviation of the distribution function.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 115 of file LogarithmicDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.LogarithmicDist.getStandardDeviation ( double theta)
static

Computes and returns the standard deviation of the logarithmic distribution with parameter \(\theta= \) theta.

Returns
the standard deviation of the logarithmic distribution

Definition at line 257 of file LogarithmicDist.java.

◆ getTheta()

double umontreal.ssj.probdist.LogarithmicDist.getTheta ( )

Returns the \(\theta\) associated with this object.

Definition at line 264 of file LogarithmicDist.java.

◆ getVariance() [1/2]

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

Returns the variance of the distribution function.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 111 of file LogarithmicDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.LogarithmicDist.getVariance ( double theta)
static

Computes and returns the variance.

\[ \mbox{Var}[X] = \frac{-\theta(\theta+ \ln(1 - \theta))}{[(1 - \theta) \ln(1 - \theta)]^2} \]

of the logarithmic distribution with parameter \(\theta=\) theta.

Returns
the variance of the logarithmic distribution \(\mbox{Var}[X] = -\theta(\theta+ ln(1 - \theta)) / ((1 - \theta)^2 (ln(1 - \theta))^2)\)

Definition at line 243 of file LogarithmicDist.java.

◆ inverseFInt()

int umontreal.ssj.probdist.LogarithmicDist.inverseFInt ( double u)

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

\(0\le u\le1\). The default implementation uses binary search.

Parameters
uvalue in the interval \((0,1)\) for 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)\)
ArithmeticExceptionif the inverse cannot be computed, for example if it would give infinity in a theoritical context

Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.

Definition at line 103 of file LogarithmicDist.java.

◆ prob() [1/2]

double umontreal.ssj.probdist.LogarithmicDist.prob ( double theta,
int x )
static

Computes the logarithmic probability \(p(x)\) given in ( flogar ) .

Definition at line 123 of file LogarithmicDist.java.

◆ prob() [2/2]

double umontreal.ssj.probdist.LogarithmicDist.prob ( int x)

Returns \(p(x)\), the probability of \(x\).

Parameters
xvalue at which the mass function must be evaluated
Returns
the mass function evaluated at x

Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.

Definition at line 72 of file LogarithmicDist.java.

◆ setTheta()

void umontreal.ssj.probdist.LogarithmicDist.setTheta ( double theta)

Sets the \(\theta\) associated with this object.

Definition at line 271 of file LogarithmicDist.java.

◆ toString()

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

Returns a String containing information about the current distribution.

Definition at line 290 of file LogarithmicDist.java.


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