distributions#

Define random-number-safe distributions.

Classes

Dists

Class for managing a collection of Dist objects

Dist

Base class for tracking one random number generator associated with one distribution, i.e. one decision per timestep.

random

Random distribution, with values on the interval (0, 1)

uniform

Uniform distribution, values on interval (low, high)

normal

Normal distribution

lognorm_ex

Lognormal distribution, parameterized in terms of the "explicit" (lognormal) distribution, with mean=mean and std=std for this distribution (see lognorm_im for comparison).

lognorm_im

Lognormal distribution, parameterized in terms of the "implicit" (normal) distribution, with mean=loc and std=scale (see lognorm_ex for comparison).

expon

Exponential distribution

poisson

Poisson distribution

weibull

Weibull distribution (specifically, scipy.stats.weibull_min)

gamma

Gamma distribution (specifically, scipy.stats.gamma)

constant

Constant (delta) distribution: equivalent to np.full()

randint

Random integer distribution, on the interval [low, high)

rand_raw

Directly sample raw integers (uint64) from the random number generator.

bernoulli

Bernoulli distribution: return True or False with the specified probability (which can be an array)

choice

Random choice between discrete options (note: dynamic parameters not supported)

histogram

Sample from a histogram with defined bins

multi_random

A class for holding two or more ss.random() distributions, and generating random numbers linked to each of them.

Functions

link_dists

Link distributions to the sim and the module; used in module.init() and people.init()

make_dist

Make a distribution from a dictionary