distr_poisson function

Creates a Poisson distribution parameterized by rate, the rate parameter.

Creates a Poisson distribution parameterized by rate, the rate parameter.

Samples are nonnegative integers, with a pmf given by [REMOVE_ME]\mboxrateke\mboxratek![REMOVEME2] \mbox{rate}^{k} \frac{e^{-\mbox{rate}}}{k!} [REMOVE_ME_2]

distr_poisson(rate, validate_args = NULL)

Arguments

  • rate: (numeric, torch_tensor): the rate parameter
  • validate_args: whether to validate arguments or not.

Description

Samples are nonnegative integers, with a pmf given by

\mboxrateke\mboxratek! \mbox{rate}^{k} \frac{e^{-\mbox{rate}}}{k!}

Examples

if (torch_is_installed()) { m <- distr_poisson(torch_tensor(4)) m$sample() }

See Also

Distribution for details on the available methods.

Other distributions: distr_bernoulli(), distr_chi2(), distr_gamma(), distr_multivariate_normal(), distr_normal()

  • Maintainer: Daniel Falbel
  • License: MIT + file LICENSE
  • Last published: 2025-02-14