Learn R Programming

spatstat.random (version 3.3-3)

recipEnzpois: First Reciprocal Moment of the Truncated Poisson Distribution

Description

Computes the first reciprocal moment (first negative moment) of the truncated Poisson distribution (the Poisson distribution conditioned to have a nonzero value).

Usage

recipEnzpois(mu, exact=TRUE)

Value

A single numerical value or a numeric vector.

Arguments

mu

The mean of the original Poisson distribution. A single positive numeric value, or a vector of positive numbers.

exact

Logical value specifying whether to use the exact analytic formula if possible.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

Details

This function calculates the expected value of \(1/N\) given \(N > 0\), where \(N\) is a Poisson random variable with mean \(\mu\).

If the library gsl is loaded, and if exact=TRUE (the default), then the calculation uses the exact analytic formula $$ \nu = \frac{e^{-\mu}}{1- e^{-\mu}} \left( Ei(\mu) - \log \mu - \gamma \right) $$ (see e.g. Grab and Savage, 1954) where \(\nu\) is the desired reciprocal moment, and $$ Ei(x) = \int_{-\infty}^x t e^{-t} dt $$ is the first exponential integral, and \(\gamma \approx 0.577\) is the Euler-Mascheroni constant.

If gsl is not loaded, or if exact=FALSE is specified, the value is computed approximately (and more slowly) by summing over the possible values of \(N\) up to a finite limit.

References

Grab, E.L. and Savage, I.R. (1954) Tables of the expected value of 1/X for positive Bernoulli and Poisson variables. Journal of the American Statistical Association 49, 169--177.

See Also

rpoisnonzero

Examples

Run this code
  if(require(gsl)) {
    v <- recipEnzpois(10)
    print(v)
  }
  recipEnzpois(10, exact=FALSE)

Run the code above in your browser using DataLab