cleverly.datasets.make_weak_overlap#

cleverly.datasets.make_weak_overlap(n: int = 1000, *, seed: int | Generator | None = None, strength: float = 3.0, backend: Literal['pandas', 'polars'] | str | None = None) → tuple[Any, dict[str, float]][source]#

A practical positivity violation.

Propensity scores reach into the tails, so a handful of units carry enormous inverse-probability weight. Used to check that truncation diagnostics fire and that the estimate degrades gracefully rather than catastrophically.

Parameters:
nint

Number of observations.

seedint, Generator, or None

Seed or NumPy random generator.

strengthfloat

Coefficient scale of the treatment mechanism. Larger values push more propensity scores towards zero and one.

backend{“pandas”, “polars”, “pyarrow”} or None, default=None

Dataframe backend. None uses pandas when installed, then the first available backend.

Returns:
dataframe

Simulated observations whose propensity scores approach their bounds.

truthdict of str to float

Exact causal parameters for the data-generating process.