Extends the class DiscreteDistributionInt for the Poisson distribution [118] (page 325) with mean \(\lambda\ge0\). More...
Public Member Functions | |
PoissonDist (double lambda) | |
Creates an object that contains the probability and distribution functions, for the Poisson distribution with parameter lambda , which are computed and stored in dynamic arrays inside that object. | |
double | prob (int x) |
double | cdf (int x) |
double | barF (int x) |
int | inverseFInt (double u) |
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 | getLambda () |
Returns the \(\lambda\) associated with this object. | |
void | setLambda (double lambda) |
Sets the \(\lambda\) associated with this object. | |
double [] | getParams () |
Return a table containing the parameter of the current distribution. | |
String | toString () |
Returns a String containing information about the current distribution. | |
![]() | |
abstract double | prob (int x) |
Returns \(p(x)\), the probability of \(x\). More... | |
double | cdf (double x) |
Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )). More... | |
abstract double | cdf (int x) |
Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )). More... | |
double | barF (double x) |
Returns \(\bar{F}(x)\), the complementary distribution function. More... | |
double | barF (int x) |
Returns \(\bar{F}(x)\), the complementary distribution function. More... | |
int | getXinf () |
Returns the lower limit \(x_a\) of the support of the probability mass function. More... | |
int | getXsup () |
Returns the upper limit \(x_b\) of the support of the probability mass function. More... | |
double | inverseF (double u) |
Returns the inverse distribution function \(F^{-1}(u)\), where. More... | |
int | inverseFInt (double u) |
Returns the inverse distribution function \(F^{-1}(u)\), where. More... | |
Static Public Member Functions | |
static double | prob (double lambda, int x) |
Computes and returns the Poisson probability \(p(x)\) for \(\lambda= \) lambda , as defined in ( fmass-Poisson ). More... | |
static double | cdf (double lambda, int x) |
Computes and returns the value of the Poisson distribution function \(F(x)\) for \(\lambda= \) lambda , as defined in ( FPoisson ). More... | |
static double | barF (double lambda, int x) |
Computes and returns the value of the complementary Poisson distribution function, for \(\lambda= \) lambda . More... | |
static int | inverseF (double lambda, double u) |
Performs a linear search to get the inverse function without precomputed tables. | |
static double [] | getMLE (int[] x, int n) |
Estimates the parameter \(\lambda\) of the Poisson distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\). More... | |
static PoissonDist | getInstanceFromMLE (int[] x, int n) |
Creates a new instance of a Poisson distribution with parameter \(\lambda\) estimated using the maximum likelihood method based on the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\). More... | |
static double | getMean (double lambda) |
Computes and returns the mean \(E[X] = \lambda\) of the Poisson distribution with parameter \(\lambda\). More... | |
static double | getVariance (double lambda) |
Computes and returns the variance \(= \lambda\) of the Poisson distribution with parameter \(\lambda\). More... | |
static double | getStandardDeviation (double lambda) |
Computes and returns the standard deviation of the Poisson distribution with parameter \(\lambda\). More... | |
Static Public Attributes | |
Constant | |
static double | MAXLAMBDA = 100000 |
The value of the parameter \(\lambda\) above which the tables are not precomputed by the constructor. | |
![]() | |
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. More... | |
Additional Inherited Members | |
![]() | |
double | cdf [] = null |
double | pdf [] = null |
int | xmin = 0 |
int | xmax = 0 |
int | xmed = 0 |
int | supportA = Integer.MIN_VALUE |
int | supportB = Integer.MAX_VALUE |
![]() | |
static final double | EPS_EXTRA = 1.0e-6 |
Extends the class DiscreteDistributionInt for the Poisson distribution [118] (page 325) with mean \(\lambda\ge0\).
\begin{align} p(x) & = \frac{e^{-\lambda} \lambda^x}{x!}, \qquad\mbox{for } x=0,1,…\tag{fmass-Poisson} \end{align}
and the distribution function is
\begin{align} F(x) & = e^{-\lambda} \sum_{j=0}^x\; \frac{\lambda^j}{j!}, \qquad\mbox{for } x=0,1,…. \tag{FPoisson} \end{align}
If one has to compute \(p(x)\) and/or \(F(x)\) for several values of \(x\) with the same \(\lambda\), where \(\lambda\) is not too large, then it is more efficient to instantiate an object and use the non-static methods, since the functions will then be computed once and kept in arrays.
For the static methods that compute \(F(x)\) and \(\bar{F}(x)\), we exploit the relationship \(F(x) = 1 - G_{x+1}(\lambda)\), where \(G_{x+1}\) is the gamma distribution function with parameters \((\alpha,\lambda) = (x+1, 1)\).
|
static |
Computes and returns the value of the complementary Poisson distribution function, for \(\lambda= \) lambda
.
WARNING: The complementary distribution function is defined as \(\bar{F}(x) = P[X \ge x]\).
|
static |
Computes and returns the value of the Poisson distribution function \(F(x)\) for \(\lambda= \) lambda
, as defined in ( FPoisson ).
To compute \(F(x)\), all non-negligible terms of the sum are added if \(\lambda\le200\); otherwise, the relationship \(F_{\lambda}(x) = 1 - G_{x + 1}(\lambda)\) is used, where \(G_{x+1}\) is the gamma distribution function with parameter \(\alpha= x+1\) (see GammaDist ).
|
static |
Creates a new instance of a Poisson distribution with parameter \(\lambda\) 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 |
|
static |
Computes and returns the mean \(E[X] = \lambda\) of the Poisson distribution with parameter \(\lambda\).
|
static |
Estimates the parameter \(\lambda\) of the Poisson distribution using the maximum likelihood method, from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\).
The maximum likelihood estimator \(\hat{\lambda}\) satisfy the equation \(\hat{\lambda} = \bar{x}_n\), where \(\bar{x}_n\) is the average of \(x[0], …, x[n-1]\) (see [118] (page 326)).
x | the list of observations used to evaluate parameters |
n | the number of observations used to evaluate parameters |
|
static |
Computes and returns the standard deviation of the Poisson distribution with parameter \(\lambda\).
|
static |
Computes and returns the variance \(= \lambda\) of the Poisson distribution with parameter \(\lambda\).
|
static |
Computes and returns the Poisson probability \(p(x)\) for \(\lambda= \) lambda
, as defined in ( fmass-Poisson ).
If \(\lambda\ge20\), this (static) method uses the logarithm of the gamma function, defined in ( Gamma ), to estimate the density.