Extends the class DiscreteDistributionInt for the logarithmic distribution. More...
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. | |
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.
| umontreal.ssj.probdist.LogarithmicDist.LogarithmicDist | ( | double | theta | ) |
Constructs a logarithmic distribution with parameter \(\theta= \) theta.
Definition at line 68 of file LogarithmicDist.java.
|
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.
| 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.
| x | value at which the complementary distribution function must be evaluated |
Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.
Definition at line 90 of file LogarithmicDist.java.
|
static |
Computes the distribution function \(F(x)\).
Definition at line 134 of file LogarithmicDist.java.
| double umontreal.ssj.probdist.LogarithmicDist.cdf | ( | int | x | ) |
Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
| x | value at which the distribution function must be evaluated |
Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.
Definition at line 78 of file LogarithmicDist.java.
|
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\).
| x | the list of observations to use to evaluate parameters |
| n | the number of observations to use to evaluate parameters |
Definition at line 214 of file LogarithmicDist.java.
| 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.
|
static |
Computes and returns the mean.
\[ E[X] = \frac{-\theta}{(1 - \theta)\ln(1 - \theta)} \]
of the logarithmic distribution with parameter \(\theta= \) theta.
Definition at line 227 of file LogarithmicDist.java.
|
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]\).
| x | the list of observations used to evaluate parameters |
| n | the number of observations used to evaluate parameters |
Definition at line 187 of file LogarithmicDist.java.
| 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.
| 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.
|
static |
Computes and returns the standard deviation of the logarithmic distribution with parameter \(\theta= \) theta.
Definition at line 257 of file LogarithmicDist.java.
| double umontreal.ssj.probdist.LogarithmicDist.getTheta | ( | ) |
Returns the \(\theta\) associated with this object.
Definition at line 264 of file LogarithmicDist.java.
| 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.
|
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.
Definition at line 243 of file LogarithmicDist.java.
| 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.
| u | value in the interval \((0,1)\) for which the inverse distribution function is evaluated |
| IllegalArgumentException | if \(u\) is not in the interval \((0,1)\) |
| ArithmeticException | if 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.
|
static |
Computes the logarithmic probability \(p(x)\) given in ( flogar ) .
Definition at line 123 of file LogarithmicDist.java.
| double umontreal.ssj.probdist.LogarithmicDist.prob | ( | int | x | ) |
Returns \(p(x)\), the probability of \(x\).
| x | value at which the mass function must be evaluated |
Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.
Definition at line 72 of file LogarithmicDist.java.
| void umontreal.ssj.probdist.LogarithmicDist.setTheta | ( | double | theta | ) |
Sets the \(\theta\) associated with this object.
Definition at line 271 of file LogarithmicDist.java.
| String umontreal.ssj.probdist.LogarithmicDist.toString | ( | ) |
Returns a String containing information about the current distribution.
Definition at line 290 of file LogarithmicDist.java.