|
|
| 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 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...
|
| |
Extends the class DiscreteDistributionInt for the Poisson distribution [118] (page 325) with mean \(\lambda\ge0\).
The mass function is
\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 double [] getMLE |
( |
int [] |
x, |
|
|
int |
n |
|
) |
| |
|
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)).
- Parameters
-
| x | the list of observations used to evaluate parameters |
| n | the number of observations used to evaluate parameters |
- Returns
- returns the parameter [ \(\hat{\lambda}\)]