multi_random#

class multi_random(names, *args, **kwargs)[source]#

Bases: prettyobj

A class for holding two or more ss.random() distributions, and generating random numbers linked to each of them. Useful for e.g. pairwise transmission probabilities.

See ss.combine_rands() for the manual version; in almost all cases this class should be used instead.

Usage:

multi = ss.multi_random(‘source’, ‘target’) rvs = multi.rvs(source_uids, target_uids)

Methods

init(*args, **kwargs)[source]#

Not usually needed since each dist will handle this automatically; for completeness only

reset(*args, **kwargs)[source]#

Not usually needed since each dist will handle this automatically; for completeness only

jump(*args, **kwargs)[source]#

Not usually needed since each dist will handle this automatically; for completeness only

static combine_rvs(rvs_list, int_type, int_max)[source]#

Combine inputs into one number

rvs(*args)[source]#

Get random variates from each of the underlying distributions and combine them efficiently