support
Support Structures for Probability Distributions
This module defines support structures for probability distributions, including continuous intervals and discrete point sets.
Support defines the set of values where a probability distribution is defined (non-zero probability for discrete, non-zero density for continuous).
- class pysatl_core.distributions.support.Support(*args, **kwargs)[source]
Bases:
ProtocolProtocol for distribution support structures.
Support defines the set of values where a distribution is defined.
- contains(**kwds)
Helper for @overload to raise when called.
- __init__(*args, **kwargs)
- class pysatl_core.distributions.support.ContinuousSupport(left=-inf, right=inf, left_closed=True, right_closed=True)[source]
Bases:
Interval1D,SupportSupport for continuous distributions represented as an interval.
This class inherits from Interval1D and implements the Support protocol for continuous distributions defined on an interval [left, right].
- class pysatl_core.distributions.support.DiscreteSupport(*args, **kwargs)[source]
-
Protocol for discrete distribution supports.
Discrete supports consist of distinct points where the distribution has non-zero probability mass.
- class pysatl_core.distributions.support.ExplicitTableDiscreteSupport(points, assume_sorted=False)[source]
Bases:
DiscreteSupportDiscrete support defined by an explicit list of points.
This implementation stores points in a sorted array for efficient membership testing and iteration.
- Parameters:
- _points
Sorted unique points array.
- Type:
- contains(x)[source]
Check if point(s) are in the support.
- Parameters:
x (
NumberorNumericArray) – Point(s) to check.- Returns:
True for points in the support, False otherwise.
- Return type:
boolorBoolArray
- class pysatl_core.distributions.support.IntegerLatticeDiscreteSupport(residue, modulus, min_k=None, max_k=None)[source]
Bases:
DiscreteSupportDiscrete support defined by an integer lattice: {residue + k * modulus}.
- Parameters:
- Raises:
ValueError – If modulus is not positive.
- contains(x)[source]
Check if point(s) are in the integer lattice support.
Points must be integers satisfying: x = residue (mod modulus) and be within bounds if min_k/max_k are specified.
- iter_points()[source]
Iterate through all points in the integer lattice support. :rtype:
Iterator[int]Note
If bounded from above and unbounded from below then iterates from upper bound in decreasing order
- Raises:
RuntimeError – If both min_k and max_k are None (unbounded both ways).
- Return type:
- __init__(residue, modulus, min_k=None, max_k=None)
- __iter__()
Iterate through all points in the integer lattice support. :rtype:
Iterator[int]Note
If bounded from above and unbounded from below then iterates from upper bound in decreasing order
- Raises:
RuntimeError – If both min_k and max_k are None (unbounded both ways).
- Return type: