onemkl::rng::negbinomial

Generates random numbers with negative binomial distribution.

Syntax

template<typename T = std::int32_t, method Method      = nbar>
  class negbinomial {
  public:
    negbinomial(): negbinomial(0.1, 0.5){}
    negbinomial(double a, double p)
    negbinomial(const negbinomial<T, Method>& other)
    double a() const
    double p() const
    negbinomial<T, Method>& operator=(const      negbinomial<T, Method>& other)
  }

Include Files

  • mkl_sycl.hpp

Description

The onemkl::rng::negbinomial class object is used in the onemkl::rng::generate function to provide random numbers with negative binomial distribution and distribution parameters a and p, where p, aR; 0 < p < 1; a > 0.

If the first distribution parameter aN, this distribution is the same as Pascal distribution. If aN, the distribution can be interpreted as the expected time of a-th success in a sequence of Bernoulli trials, when the probability of success is p.

The probability distribution is given by:


image0

The cumulative distribution function is as follows:


image1

Input Parameters

Name

Type

Description

method

onemkl::rng::method

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

a

double

The first distribution parameter a.

p

double

The second distribution parameter p.