SSJ
V. labo.

umontreal.iro.lecuyer.probdist
Class LogarithmicDist

java.lang.Object
  extended by umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
      extended by umontreal.iro.lecuyer.probdist.LogarithmicDist
All Implemented Interfaces:
Distribution

public class LogarithmicDist
extends DiscreteDistributionInt

LogarithmicDist

Extends the class DiscreteDistributionInt for the logarithmic distribution. It has shape parameter θ, where 0 < θ < 1. Its mass function is

p(x) = - θx/(x log(1 - θ)        for x = 1, 2, 3,...$\displaystyle \eqlabel$eq:flogar

Its distribution function is

F(x) = -1/log(1-θ)$\displaystyle \htsum_{{i=1}}^{x}$θi/i, & for x > 0.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
EPSILON
 
Constructor Summary
LogarithmicDist(double theta)
          .
 
Method Summary
static double barF(double theta, int x)
          .
 double barF(int x)
          Returns bar(F)(x), the complementary distribution function.
static double cdf(double theta, int x)
          .
 double cdf(int x)
          Returns the distribution function F evaluated at x (see).
static LogarithmicDist getInstanceFromMLE(int[] x, int n)
          .
 double getMean()
          .
static double getMean(double theta)
          .
static double[] getMLE(int[] x, int n)
          .
 double[] getParams()
          .
 double getStandardDeviation()
          .
static double getStandardDeviation(double theta)
          .
 double getTheta()
          .
 double getVariance()
          .
static double getVariance(double theta)
          .
static int inverseF(double theta, double u)
           
 int inverseFInt(double u)
          Returns the inverse distribution function F-1(u), where 0 <= u <= 1.
static double prob(double theta, int x)
          .
 double prob(int x)
          Returns p(x), the probability of x.
 void setTheta(double theta)
          .
 String toString()
          .
 
Methods inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
barF, cdf, getXinf, getXsup, inverseF
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogarithmicDist

public LogarithmicDist(double theta)
. \begin{tabb}Constructs a logarithmic distribution with parameter $\theta = $
 \texttt{theta}.
 \end{tabb}

Method Detail

prob

public double prob(int x)
Description copied from class: DiscreteDistributionInt
Returns p(x), the probability of x.

Specified by:
prob in class DiscreteDistributionInt
Parameters:
x - value at which the mass function must be evaluated
Returns:
the mass function evaluated at x

cdf

public double cdf(int x)
Description copied from class: DiscreteDistributionInt
Returns the distribution function F evaluated at x (see).

Specified by:
cdf in class DiscreteDistributionInt
Parameters:
x - value at which the distribution function must be evaluated
Returns:
the distribution function evaluated at x

barF

public double barF(int x)
Description copied from class: DiscreteDistributionInt
Returns bar(F)(x), the complementary distribution function. See the WARNING above.

Overrides:
barF in class DiscreteDistributionInt
Parameters:
x - value at which the complementary distribution function must be evaluated
Returns:
the complementary distribution function evaluated at x

inverseFInt

public int inverseFInt(double u)
Description copied from class: DiscreteDistributionInt
Returns the inverse distribution function F-1(u), where 0 <= u <= 1. The default implementation uses binary search.

Overrides:
inverseFInt in class DiscreteDistributionInt
Parameters:
u - value in the interval (0, 1) for which the inverse distribution function is evaluated
Returns:
the inverse distribution function evaluated at u

getMean

public double getMean()
Description copied from interface: Distribution
. \begin{tabb}Returns the mean of the distribution function.
 \end{tabb}


getVariance

public double getVariance()
Description copied from interface: Distribution
. \begin{tabb}Returns the variance of the distribution function.
 \end{tabb}


getStandardDeviation

public double getStandardDeviation()
Description copied from interface: Distribution
. \begin{tabb}Returns the standard deviation of the distribution function.
 \end{tabb}


prob

public static double prob(double theta,
                          int x)
. \begin{tabb}
 Computes the logarithmic probability $p(x)$%
 .
 \end{tabb}


cdf

public static double cdf(double theta,
                         int x)
. \begin{tabb}Computes the distribution function $F(x)$.
 \end{tabb}


barF

public static double barF(double theta,
                          int x)
. \begin{tabb}Computes the complementary distribution function.
 \emph{WARNING:} Th...
 ...ntary distribution function is defined as
 $\bar F(x) = P[X \ge x]$.
 \end{tabb}


inverseF

public static int inverseF(double theta,
                           double u)

getMLE

public static double[] getMLE(int[] x,
                              int n)
. \begin{tabb}
 Estimates the parameter $\theta$\ of the logarithmic distribution
 ...
 ...$\bar{x}_n$\ is the average of $x[0], \ldots, x[n-1]$.
 \end{detailed}\end{tabb}
xthe list of observations used to evaluate parameters nthe number of observations used to evaluate parameters returns the parameter [ $ \hat{{\theta}}$]


getInstanceFromMLE

public static LogarithmicDist getInstanceFromMLE(int[] x,
                                                 int n)
. \begin{tabb}
 Creates a new instance of a logarithmic distribution with paramete...
 ...ethod based on the $n$
 observations $x[i]$, $i = 0, 1, \ldots, n-1$.
 \end{tabb}
xthe list of observations to use to evaluate parameters nthe number of observations to use to evaluate parameters


getMean

public static double getMean(double theta)
. \begin{tabb}Computes and returns the mean
 of the logarithmic distribution with parameter $\theta = $\ \texttt{theta}.
 \end{tabb}
the mean of the logarithmic distribution E[X] = - θ/((1 - θ)ln(1 - θ))


getVariance

public static double getVariance(double theta)
. \begin{tabb}Computes and returns the variance
 of the logarithmic distribution with parameter $\theta =$\ \texttt{theta}.
 \end{tabb}
the variance of the logarithmic distribution Var[X] = - θ(θ + ln(1 - θ))/((1 - θ)2(ln(1 - θ))2)


getStandardDeviation

public static double getStandardDeviation(double theta)
. \begin{tabb}Computes and returns the standard deviation of the
 logarithmic distribution with parameter $\theta = $\ \texttt{theta}.
 \end{tabb}
the standard deviation of the logarithmic distribution


getTheta

public double getTheta()
. \begin{tabb}
 Returns the $\theta$\ associated with this object.
 \end{tabb}


setTheta

public void setTheta(double theta)
. \begin{tabb}
 Sets the $\theta$\ associated with this object.
 \end{tabb}


getParams

public double[] getParams()
. \begin{tabb}
 Return a table containing the parameters of the current distribution.
 \end{tabb}

 


toString

public String toString()
. \begin{hide}
 \par
 \begin{tabb}
 Returns a \texttt{String} containing information about the current distribution.
 \end{tabb}\end{hide}

Overrides:
toString in class Object

SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.