treble_tsdk.collections.distributions

Classes

class treble_tsdk.collections.distributions.Beta
__init__(a: float, b: float, seed: int | None = None)

Initialize the distribution with an optional seed.

Parameters:

seed – Random seed for reproducibility. If None, non-deterministic.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

sample(n: int, rng: np.random.Generator | None = None) np.ndarray
class treble_tsdk.collections.distributions.Bimodal
__init__(mean1: float, std1: float, mean2: float, std2: float, weight1: float = 0.5, seed: int | None = None)

Initialize the distribution with an optional seed.

Parameters:

seed – Random seed for reproducibility. If None, non-deterministic.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

sample(n: int, rng: np.random.Generator | None = None) np.ndarray

Sample from bimodal distribution by mixing samples from both distributions.

class treble_tsdk.collections.distributions.DistributionBase
__init__(seed: int | None = None)

Initialize the distribution with an optional seed.

Parameters:

seed – Random seed for reproducibility. If None, non-deterministic.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

abstract sample(n: int) numpy.ndarray
class treble_tsdk.collections.distributions.Exponential
__init__(scale: float, seed: int | None = None)

Initialize the distribution with an optional seed.

Parameters:

seed – Random seed for reproducibility. If None, non-deterministic.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

sample(n: int, rng: np.random.Generator | None = None) np.ndarray
class treble_tsdk.collections.distributions.Gaussian
__init__(mean: float, std: float, seed: int | None = None)

Initialize the distribution with an optional seed.

Parameters:

seed – Random seed for reproducibility. If None, non-deterministic.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

sample(n: int, rng: np.random.Generator | None = None) np.ndarray
class treble_tsdk.collections.distributions.LogNormal
__init__(mean: float, sigma: float, seed: int | None = None)

Initialize the distribution with an optional seed.

Parameters:

seed – Random seed for reproducibility. If None, non-deterministic.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

sample(n: int, rng: np.random.Generator | None = None) np.ndarray
class treble_tsdk.collections.distributions.ScaledBeta
__init__(low: float, high: float, a: float = 2.0, b: float = 2.0, step: float | None = None, seed: int | None = None)

Beta distribution scaled to a given range [low, high] with optional discrete grid points.

Parameters:
  • low – The lower bound of the range.

  • high – The upper bound of the range.

  • a – The shape parameter of the beta distribution.

  • b – The shape parameter of the beta distribution.

  • step – The spacing between discrete grid points; if None, values are sampled continuously to floating point precision.

  • seed – The seed for the random number generator.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

sample(n: int, rng: np.random.Generator | None = None) np.ndarray
class treble_tsdk.collections.distributions.Uniform
__init__(low: float, high: float, step: float | None = None, seed: int | None = None)

Uniform distribution on a given range [low, high] with optional discrete grid points.

Parameters:
  • low – The lower bound of the range.

  • high – The upper bound of the range.

  • step – The spacing between discrete grid points; if None, values are sampled continuously to floating point precision.

  • seed – The seed for the random number generator.

reset_seed(seed: int | None = None) None

Reset the random number generator with a new seed.

sample(n: int, rng: np.random.Generator | None = None) np.ndarray