Learn R Programming

Runuran (version 0.40)

udpois: UNU.RAN object for Poisson distribution

Description

Create UNU.RAN object for a Poisson distribution with parameter lambda.

[Distribution] -- Poisson.

Usage

udpois(lambda, lb = 0, ub = Inf)

Value

An object of class "unuran.discr".

Arguments

lambda

(non-negative) mean.

lb

lower bound of (truncated) distribution.

ub

upper bound of (truncated) distribution.

Author

Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.

Details

The Poisson distribution has density $$ p(x) = \frac{\lambda^x e^{-\lambda}}{x!} $$ for \(x = 0, 1, 2, \ldots\).

The domain of the distribution can be truncated to the interval (lb,ub).

References

N.L. Johnson, S. Kotz, and A.W. Kemp (1992): Univariate Discrete Distributions. 2nd edition, John Wiley & Sons, Inc., New York. Chap. 4, p. 151.

See Also

unuran.discr.

Examples

Run this code
## Create distribution object for Poisson distribution
dist <- udpois(lambda=2.3)
## Generate generator object; use method DARI
gen <- darid.new(dist)
## Draw a sample of size 100
x <- ur(gen,100)

Run the code above in your browser using DataLab