Skip to main content

AliasedDiscrete

Base class: Distribution

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

The probability density is given by,

P(k∣wk)=wk∑kwk.P(k | w_k) = \frac{w_k}{\sum_k w_k}.

where wkw_k represents the elements of the weights parameter.

Constructors​

AliasedDiscrete(const AliasedDiscrete distribution) -> AliasedDiscrete​

Copy constructor for AliasedDiscrete distribution.

Parameters​

Symbols​

NameDescription
=Copy assignment operator for AliasedDiscrete 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.