Causal Inference

Calibrated DML for doubly robust inference

Circular calibratedDML package badge with a calibration plot

calibratedDML implements calibrated doubly robust estimators for mean potential outcomes and treatment-versus-control contrasts. The standard workflow fits or accepts cross-fitted nuisance estimates, calibrates them, and then forms point estimates and confidence intervals.

Overview

Supported estimands

The standard implementation estimates arm means and treatment-versus-control contrasts. You can run the full procedure from raw data or start from cross-fitted nuisance estimates prepared elsewhere.

Primary method

Calibrated DML for doubly robust inference

The standard estimator is the main entry point for interval valid inference on arm means and treatment-versus-control contrasts.

CalibratedDML(...).fit(X, A, y)
calibrated_dml(data, outcome, treatment, covariates, ...)

Calibration

Why not use a standard doubly robust estimator?

Standard doubly robust estimators mainly protect point estimates, but valid confidence intervals often still depend on both nuisance functions being estimated well enough. This package adds a calibration step before debiasing so confidence intervals can remain valid under weaker nuisance-rate conditions.

In practice, calibration can also stabilize extreme inverse weights and reduce variance, especially when overlap is limited; see Stabilized Inverse Probability Weighting via Isotonic Calibration. This does not remove the population-level overlap assumptions required by the theory.

Outcome Regression Calibration

Outcome predictions are put on the right scale

Predicted outcome Observed outcome Raw Calibrated

Calibration adjusts the outcome-regression scale so predicted values better match observed outcomes among comparable units.

Propensity Calibration

Propensity calibration fixes the weighting scale

Estimated propensity score True propensity score Raw Calibrated

Calibration helps ensure that inverse-propensity weights are large only when they need to be. If calibrated propensities are still very small, that points to real limited overlap rather than avoidable estimation error.

In calibrated DML, these calibration steps are what connect the practical procedure to the inferential guarantees.

Installation

Installation

The repository provides both Python and R interfaces for the standard calibrated DML estimator.

Python

PyPI

pip install calibratedDML

Python

GitHub

pip install "git+https://github.com/Larsvanderlaan/calibratedDML.git"

R

GitHub

remotes::install_github("Larsvanderlaan/calibratedDML")

Workflows

Common workflows

The package supports estimation from raw data, estimation from supplied nuisance functions, and multi-arm analyses.

Estimate from raw data

Choose this path if the package should fit the nuisance models, perform calibration, and report inference.

Call: CalibratedDML(...).fit(...) or calibrated_dml(...)

Start from nuisance estimates

Choose this path when cross-fitted nuisance estimates come from an external pipeline and only calibration, debiasing, and inference should be run here.

Call: fit_from_nuisances(...) or calibrated_dml_from_nuisances(...)

Analyze multi-arm treatment

The standard estimator also handles treatments with more than two levels, returning arm means and contrasts relative to a specified control arm.

Call: standard calibrated DML with control_level

References

Where are the paper and related resources?

The main paper, repository, and related references are collected here.

ppi_aipw package badge

Companion package

ppi_aipw

Semisupervised mean inference with AIPW, calibration, and uncertainty quantification.

Companion package site