stormvogel.model.distribution

A distribution object.

Classes

Distribution

A sparse distribution mapping support elements to probability values.

Module Contents

class stormvogel.model.distribution.Distribution[ValueType: stormvogel.model.value.Value, SupportType](distribution: dict[SupportType, ValueType] | list[tuple[ValueType, SupportType]] | Distribution[ValueType, SupportType] | None = None)

A sparse distribution mapping support elements to probability values.

_distribution: dict[SupportType, ValueType]
property support: set[SupportType]

Returns the support of this distribution (elements with non-zero probability).

property probabilities: list[ValueType]

Returns the probability values of this distribution.

is_stochastic(epsilon: float = 1e-06) bool

Returns whether this distribution sums to 1.

For interval and parametric distributions we always return True.

__eq__(other: object) bool
__repr__() str
__str__
__add__(other: Distribution[ValueType, SupportType]) Distribution[ValueType, SupportType]
__iter__()
__len__() int
__getitem__(key: SupportType) ValueType
__setitem__(key: SupportType, value: ValueType)
__contains__(key: SupportType) bool