cleverly.datasets.make_nonlinear_ate#

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

Nonlinear nuisance functions and a heterogeneous effect.

This is the process that exercises double robustness: a linear model is wrong for both g and Qbar, the treatment effect varies with W, and so ate, att and atc all differ. An estimator that quietly assumes a constant effect will fail here.

The propensity lies in [0.05, 0.95] (strong positivity), so the ATE has a finite efficiency bound. nonlinear_dgp() states the law and why the bound is needed.

Parameters:
nint

Number of observations.

seedint, Generator, or None

Seed or NumPy random generator.

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

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

Returns:
dataframe

Simulated observations with outcome, treatment, and adjustment columns.

truthdict of str to float

Exact causal parameters for the data-generating process.