poisson

Contents

poisson#

Generates Poisson distributed random values.

Description

The poisson class object is used in the generate and function to provide Poisson distributed random numbers with distribution parameter \(\lambda\), where \(\lambda \in R; \lambda > 0\).

The probability distribution is given by:

\[P(X = k) = \frac{\lambda^k e^{-\lambda}}{k!}\]

\(k \in \{0, 1, 2, \ldots \}\).

The cumulative distribution function is as follows:

\[\begin{split}F_{\lambda}(x) = \begin{cases} \sum_{k=0}^{\lfloor x \rfloor} \frac{\lambda^k e^{-\lambda}}{k!}, & x \geq 0 \\ 0, & x < 0 \end{cases}, x \in R\end{split}\]

class poisson#

Syntax

namespace oneapi::math::rng::device {
  template<typename IntType, typename Method>
  class poisson {
  public:
    using method_type = Method;
    using result_type = IntType;

    poisson();
    explicit poisson(double lambda);

    double lambda() const;
  };
}

Template parameters

typename IntType
Type of the produced values. Supported types:
  • std::int32_t

  • std::uint32_t

typename Method = oneapi::math::rng::poisson_method::by_default

Transformation method, which will be used for generation. Supported types:

  • oneapi::math::rng::device::poisson_method::by_default

  • oneapi::math::rng::device::poisson_method::devroye

See description of the methods in Distributions methods template parameter.

Class Members

Routine

Description

poisson()

Default constructor

explicit poisson(double lambda)

Constructor with parameters

double lambda() const

Method to obtain distribution parameter

Member types

poisson::method_type = Method

Description

The type which defines transformation method for generation.

poisson::result_type = IntType

Description

The type which defines type of generated random numbers.

Constructors

poisson::poisson()

Description

Default constructor for distribution, parameters set as lambda = 0.5.

explicit poisson::poisson(double lambda)

Description

Constructor with parameters. lambda is a distribution parameter.

Throws

oneapi::math::invalid_argument

Exception is thrown when \(lambda \leq 0\)

Characteristics

double poisson::lambda() const

Return Value

Returns the distribution parameter lambda.

Parent topic: Device Distributions