Skip to main content

Discrete

Produces random integers with probabilities determined by the given weights (with default value [1.0]).

The probability density is given by,

P(kwk)=wkkwk.P(k | w_k) = \frac{w_k}{\sum_k w_k}.

where wkw_k represents the elements of the weights parameter.

Constructors

Discrete(const Discrete distribution) -> Discrete

Copy constructor for Discrete distribution.

Parameters

  • distribution: Discrete distribution to be copied

Symbols

NameDescription
=Copy assignment operator for Discrete distribution.

Members

NameDescription
maxReturns the maximum possible value from the distribution
minReturns the minimum possible value from the distribution
probabilitiesProbabilities of each outcome.
sampleSample from distribution.