onemkl::rng::multinomial

Generates multinomially distributed random numbers.

Syntax

template<typename T = std::int32_t, method Method      = poisson_inverse>
  class multinomial {
  public:
    multinomial(double ntrial, std::vector<double>      p)
    multinomial(const multinomial<T, Method>& other)
    std::int32_t ntrial() const
    std::vector<double> p() const
    multinomial<T, Method>& operator=(const      multinomial<T, Method>& other)
  }

Include Files

  • mkl_sycl.hpp

Description

The onemkl::rng::multinomial class object is used in the onemkl::rng::generate function to provide multinomially distributed random numbers with ntrial independent trials and k possible mutually exclusive outcomes, with corresponding probabilities pi, where pi∈R; 0 ≤pi≤ 1, m∈N, k∈N.

The probability distribution is given by:


image0

Input Parameters

Name

Type

Description

method

onemkl::rng::method

Generation method. The specific values are as follows: onemkl::rng::poisson_inverse See brief descriptions of the methods in Distributions Template Parameter onemkl::rng::method Values.

ntrial

std::int32_t

Number of independent trials m.

p

std::vector<double>

Probability vector of possible outcomes (k length).