pymargins

Expert-mode marginal effects for Python. Session-level analytical pre-commitment, JAX-native autodiff, and a κ-driven simulation fallback when the delta method is unsafe.

pymargins wraps a fitted statistical model in a Margins session, then computes adjusted predictions, slopes, contrasts, and arbitrary differentiable estimands — with uncertainty from the delta method, Krinsky–Robb simulation, or bootstrap — across statsmodels, linearmodels, lifelines, and scikit-learn model classes.

Getting started

Indices