Skip to contents

Usage

dist_poisson(lambda = NULL)

Arguments

lambda

Scalar rate parameter, or NULL as a placeholder.

Value

A PoissonDistribution object.

Details

The parameter can be overridden with with_params = list(lambda = ...).

Examples

d_pois <- dist_poisson(lambda = 5.0)
x <- d_pois$sample(100)
d_emp <- dist_empirical(x)

plot_distributions(
  empirical = d_emp,
  theoretical = d_pois,
  estimated = d_pois,
  with_params = list(
    estimated = inflate_params(
      fitdistrplus::fitdist(x, distr = "pois")$estimate
    )
  ),
  .x = 0:max(x)
)