recipEnzpois: First Reciprocal Moment of the Truncated Poisson Distribution

View source: R/truncpois.R

recipEnzpoisR Documentation

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)

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.

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.

Value

A single numerical value or a numeric vector.

Author(s)

\adrian

.

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

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

spatstat.random documentation built on Oct. 22, 2023, 1:17 a.m.