recipEnzpois {spatstat.random} | R 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
given
, where
is a Poisson random variable
with mean
.
If the library gsl is loaded, and if exact=TRUE
(the
default), then the calculation uses
the exact analytic formula
(see e.g. Grab and Savage, 1954)
where is the desired reciprocal moment, and
is the first exponential integral, and
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 up to a finite limit.
Value
A single numerical value or a numeric vector.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au.
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
Examples
if(require(gsl)) {
v <- recipEnzpois(10)
print(v)
}
recipEnzpois(10, exact=FALSE)