Creates an S3 object representing a Poisson distribution with rate parameter \(\lambda\). The PMF is \(P(X = k) = \lambda^k e^{-\lambda} / k!\) for \(k = 0, 1, 2, \ldots\).

poisson_dist(lambda)

Arguments

lambda

Rate parameter (mean), must be a positive scalar.

Value

A poisson_dist object with classes c("poisson_dist", "univariate_dist", "discrete_dist", "dist").

Examples

x <- poisson_dist(lambda = 5)
mean(x)
#> [1] 5
vcov(x)
#> [1] 5
format(x)
#> [1] "Poisson distribution (lambda = 5)"