DistDiscrete

class pydsol.core.distributions.DistDiscrete(stream: StreamInterface)[source]

Bases: Distribution

The Discrete distribution. For more information on this distribution see https://mathworld.wolfram.com/DiscreteDistribution.html.

__init__(stream: StreamInterface)[source]

Initialize the distribution with a random stream.

abstract probability(observation: int) float[source]

Returns the probability of the observation for the distribution.

abstract draw() int | float

Draw a random value from the distribution function. For discrete distributions, this function will return an int, for continuous distributions it will return a float.

property stream: StreamInterface

Return the current random stream for this distribution.