Approximate Poisson generator

Share:

Description

This function considers the possible values of a Poisson random variable to lay within 3*sqrt(lambda) of lambda and is proposed for comparison with the regular rpois generator.

Usage

1
test3(Nsim = 10^4, lambda = 100)

Arguments

Nsim

Number of simulations

lambda

Poisson parameter

Details

This function replicates rpois(Nsim,lambda) and thus should not be used.

Value

This function produces a integer vector of size Nsim

warning

The output is not an exact Poisson sample because of the truncation on the support. Use rpois instead.

Author(s)

Christian P. Robert and George Casella

References

From Chapter 2 of EnteR Monte Carlo Statistical Methods

See Also

test4,rpois

Examples

1
2
mean(test3(Nsim=10^4))
# providing [1] 114

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.