distribution

Distribution Interface

This module defines the public Distribution protocol that serves as the abstract interface for all probability distributions in the system.

class pysatl_core.distributions.distribution.Distribution(*args, **kwargs)[source]

Bases: Protocol

Protocol defining the interface for probability distributions.

This protocol is the central abstraction used throughout the system. Concrete distribution implementations must provide the properties and methods defined here.

distribution_type

Type information about the distribution (kind, dimension, etc.).

Type:

DistributionType

analytical_computations

Direct analytical computations provided by the distribution.

Type:

Mapping[str, AnalyticalComputation]

sampling_strategy

Strategy for generating random samples.

Type:

SamplingStrategy

computation_strategy

Strategy for computing characteristics and conversions.

Type:

ComputationStrategy

support

Support of the distribution, if defined.

Type:

Support or None

property distribution_type: pysatl_core.types.DistributionType
property analytical_computations: Mapping[GenericCharacteristicName, AnalyticalComputation[Any, Any]]
property sampling_strategy: pysatl_core.distributions.strategies.SamplingStrategy
property computation_strategy: ComputationStrategy[Any, Any]
property support: Support | None
query_method(characteristic_name, **options)[source]

Query a computation method for a specific characteristic.

Parameters:
  • characteristic_name (str) – Name of the characteristic to compute (e.g., “pdf”, “cdf”).

  • **options (Any) – Additional options for the computation.

Returns:

Callable method that computes the characteristic.

Return type:

Method

calculate_characteristic(characteristic_name, value, **options)[source]

Calculate a characteristic at the given value.

Parameters:
  • characteristic_name (str) – Name of the characteristic to compute.

  • value (Any) – Point(s) at which to evaluate the characteristic.

  • **options (Any) – Additional computation options.

Returns:

Value of the characteristic at the given point(s).

Return type:

Any

sample(n, **options)[source]

Generate random samples from the distribution.

Parameters:
  • n (int) – Number of samples to generate.

  • **options (Any) – Additional sampling options forwarded to the underlying sampling strategy.

Returns:

NumPy array containing n generated samples. The exact array shape depends on the distribution and the sampling strategy.

Return type:

NumericArray

__init__(*args, **kwargs)