default

Simple Inverse-Transform Sampling Strategy

This module provides a basic univariate sampler based on inverse transform sampling (also known as the quantile/PPF method). It is used as a fallback when advanced sampling methods (e.g. UNU.RAN) are not available.

class pysatl_core.sampling.default.DefaultSamplingUnivariateStrategy(*args, **kwargs)[source]

Bases: SamplingStrategy

Default univariate sampler based on inverse transform sampling.

This strategy generates samples by applying the PPF (inverse CDF) to uniformly distributed random variables.

Notes

  • Requires the distribution to provide a PPF computation method.

  • Assumes that the PPF follows NumPy semantics (vectorized evaluation).

  • Graph-derived PPFs (scalar-only) are currently not supported.

  • Returns a NumPy array containing the generated samples.

sample(n, distr, **options)[source]

Generate samples from the distribution.

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

  • distr (Distribution) – Distribution to sample from.

  • **options (Any) – Additional options forwarded to the PPF computation.

Returns:

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

Return type:

NumericArray