poisson_v#

Class is used for generation of Poisson distributed integer types random numbers with varying mean.

Description

The class object is used in the oneapi::mkl::rng::generate() function to provide n random numbers Poisson distributed, with distribution parameter \(\lambda_i\), where \(\lambda_i \in R; \lambda_i > 0; i = 1, ... , n\).

The probability distribution is given by:

\[P(X_i = k) = \frac{\lambda_i^ke^{-\lambda_i}}{k!}, k \in \{0, 1, 2, ... \}.\]

The cumulative distribution function is as follows:

\[\begin{split}F_{\lambda_i}(x) = \left\{ \begin{array}{rcl} \sum_{k = 0}^{\lfloor x \rfloor} \frac{\lambda_i^ke^{-\lambda_i}}{k!}, x \ge 0 \\ 0, x < 0 \end{array}\right.\end{split}\]

class poisson_v#

Syntax

namespace oneapi::mkl::rng {
template<typename IntType = std::int32_t, typename Method = poisson_v_method::by_default>
class poisson_v {
public:
    using method_type = Method;
    using result_type = IntType;
    explicit poisson_v(std::vector<double> lambda);
    std::vector<double> lambda() const;
};
}

Template parameters

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

typename Method = oneapi::mkl::rng::poisson_v_method::by_default

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

  • oneapi::mkl::rng::poisson_v_method::by_default

  • oneapi::mkl::rng::poisson_v_method::gaussian_icdf_based

See description of the methods in Distributions methods template parameter.

Class Members

Routine

Description

explicit poisson_v(std::vector<double> lambda)

Constructor with parameters

std::vector<double> lambda() const

Method to obtain distribution parameter

Member types

poisson_v::method_type = Method

Description

The type which defines transformation method for generation.

poisson_v::result_type = IntType

Description

The type which defines type of generated random numbers.

Constructors

explicit poisson_v::poisson_v(std::vector<double> lambda)

Description

Constructor with parameters. lambda is a distribution parameter.

Throws

oneapi::mkl::invalid_argument

Exception is thrown when \(lambda.size() \leq 1\)

Characteristics

double poisson_v::lambda() const

Return Value

Returns the distribution parameter lambda.

Parent topic: Distributions