Riesz Representers for Causal Machine Learning
Software written by Christian Testa, Salvador V. Balkus, and Nima S. Hejazi.
The RieszCML R package provides a unified framework for constructing
asymptotically efficient, doubly-robust estimators — both one-step and
targeted maximum likelihood-based estimators (TMLE) — of statistical
functionals whose efficient influence function (EIF) can be expressed in
terms of a Riesz representer (Balkus, Testa, and Hejazi 2026;
Chernozhukov, Newey, and Singh 2022; Hirshberg and Wager 2021). This
class of functionals encompasses a wide range of estimands from causal
inference and missing data problems, including counterfactual means,
average treatment effects, effects of modified treatment policies,
subgroup effects, direct and indirect effects from causal mediation
analysis, and the effects of time-varying treatments in longitudinal
settings subject to treatment-confounder feedback.
Rather than requiring a bespoke derivation and implementation of the EIF
for each new estimand, RieszCML asks the user to specify only a few
modular ingredients of the target parameter:
- a set of nuisance function estimates (e.g., outcome regressions, propensity scores), fit by any means the user prefers;
- a formula for the Riesz representer
alpha(e.g., an inverse probability weight or density ratio); - formulas
fandhdefining the regression being “residualized” and the plug-in transformation appearing in the parameter mapping; and - an expression for the (uncentered) influence curve, typically of
the form
~ h + alpha * (Y - f).
These ingredients are collected in a RieszCurve object, from which
estimators and Wald-style inference follow automatically via
riesz_estimate() (one-step) or riesz_tmle() (TMLE, with identity or
logistic fluctuations). Nested and sequential estimands — for example,
the iterated conditional expectations arising in longitudinal causal
inference (van der Laan and Gruber 2012; Dı́az et al. 2021) or
corrections for two-phase sampling designs (Rose and van der Laan 2011)
— are handled compositionally by chaining RieszCurve objects together
with ComposedRieszCurve, whose EIF involves a product of the
stage-specific Riesz representers. Smooth transformations of one or more
estimands (differences, risk ratios, odds ratios, and arbitrary
user-specified contrasts) are supported through the delta method via
riesz_delta() and friends.
A catalog of pre-specified estimands is provided in
riesz_curve_catalog, including the counterfactual mean under a static
treatment (cfmean_a), the average treatment effect (ate), the
average treatment effect among the treated (att), subgroup means
(subgroup_mean), the mean of an outcome missing at random
(missing_mean), and modified treatment policies (mtp). Nuisance
function estimation may be carried out flexibly via the super learner
algorithm (van der Laan, Polley, and Hubbard 2007), as implemented in
the nadir package.
RieszCML implements the methodology described in Balkus, Testa, and
Hejazi (2026), which develops the
sequential “Riesz EIF” representation underlying the package and its
associated TMLE algorithms.
Install the most recent version of RieszCML from GitHub via
remotes:
remotes::install_github("nshlab/RieszCML")We also recommend installing
nadir, which allows ensemble
machine learning to be used for nuisance parameter estimation:
remotes::install_github("ctesta01/nadir")To illustrate how RieszCML may be used to estimate the effect of a
treatment, consider estimating the average treatment effect (ATE) in a
simple point-treatment setting. We first simulate data with a known
additive treatment effect:
library(RieszCML)
set.seed(1)
n <- 5000
tau <- 1.5
L <- rnorm(n)
A <- rbinom(n, size = 1, prob = plogis(L))
Y <- 2 + L + tau * A + rnorm(n, sd = 0.25)
df <- data.frame(L = L, A = A, Y = Y)The ATE is available directly from the estimand catalog. The user supplies only a nuisance-fitting function returning the outcome regression evaluated at the natural and counterfactual treatment values, along with the propensity score:
rc_ate <- riesz_curve_catalog$ate(
nuis = function(data) {
m_fit <- lm(Y ~ L + A, data = data)
g_fit <- glm(A ~ L, family = binomial(), data = data)
data1 <- data0 <- data
data1$A <- 1
data0$A <- 0
list(
m = predict(m_fit, newdata = data),
m1 = predict(m_fit, newdata = data1),
m0 = predict(m_fit, newdata = data0),
g = predict(g_fit, newdata = data, type = "response")
)
}
)A one-step (de-biased) estimate, with influence function-based inference, is then a single function call:
riesz_estimate(data = df, rc = rc_ate)
#> Riesz fit
#> Estimator: one-step
#> n: 5000
#>
#> Estimate: 1.49630
#> Std. Error: 0.00799
#> 95% CI: [1.48064, 1.51196]
#>
#> Stored internals: icAlternatively, riesz_tmle() constructs a targeted maximum likelihood
estimator by fluctuating the initial regression fit using the Riesz
representer as a “clever covariate”:
riesz_tmle(
data = df,
rc = rc_ate,
fluctuation_type = "identity",
outcome_col = "Y"
)
#> Riesz fit
#> Estimator: TMLE
#> n: 5000
#>
#> Estimate: 1.49628
#> Std. Error: 0.00799
#> 95% CI: [1.48062, 1.51194]
#>
#> Fluctuation epsilon: 0.00038
#>
#> Stored internals: ic, ic_star, f_star, h_star, fluctuation_modelMore involved estimands are constructed compositionally. For example,
the counterfactual mean under a two-timepoint treatment regime — a
nested sequence of conditional expectations — may be estimated by
composing one RieszCurve per timepoint via ComposedRieszCurve;
corrections for outcomes missing at random or for two-phase sampling
designs amount to prepending one further stage. See the package
vignettes for worked examples covering longitudinal treatment regimes,
missing outcomes, subgroup average derivative effects, delta-method
contrasts, and super learning with cross-fitting.
-
A Riesz representer perspective on targeted learning (Balkus, Testa, and Hejazi, 2026) - The companion paper to this package, deriving the sequential “Riesz EIF” for nested linear functionals and the TMLE algorithms implemented in
RieszCML. -
Automatic debiased machine learning for dynamic treatment effects and general nested functionals (Chernozhukov, Newey, Singh, and Syrgkanis, 2022, updated 2026) - Extends automatic debiasing to the dynamic treatment regime, showing the multiply robust formula for nested mean regressions admits a recursive Riesz representer characterization; each representer is estimated by a sequential Riesz loss, avoiding analytic derivation of inverse-propensity products, with extensions to nested nonlinear/IV functionals and long-term effects with surrogates.
-
Riesz representers for the rest of us (Williams, Hines, and Rudolph, 2025) - A gentle, worked-example introduction to the Riesz representation theorem for epidemiologists, including a simple recursive algorithm for deriving EIFs of estimands built from iterated conditional expectations.
-
Learning density ratios in causal inference using Bregman-Riesz regression (Hines and Miles, 2025) - Connects Riesz regression to density ratio estimation under Bregman divergences, of interest when Riesz representers take the form of density or probability ratios.
-
Two approaches to direct estimation of Riesz representers (Bruns-Smith, 2026) - Relates the “Riesz loss” of the automatic debiased machine learning literature to an older sieve-based formulation from conditional moment models, showing when the two direct estimation strategies coincide.
-
General targeted machine learning for modern causal mediation analysis (Liu, Williams, Rudolph, and Díaz, 2024) - A one-step estimation framework covering six families of mediation estimands via sequential regressions and sequential Riesz learning, implemented in the
crumbleR package. -
Automatic debiased machine learning via Riesz regression (Chernozhukov, Newey, Quintas-Martínez, and Syrgkanis; Econometric Society lecture) - The foundational proposal for estimating Riesz representers directly via empirical risk minimization of a tailored “Riesz loss”, bypassing estimation of constituent nuisance components such as propensity scores.
-
Riesz representer fitting under Bregman divergence: a unified framework for debiased machine learning (Kato, 2026) - A generalized Riesz regression framework encompassing the squared-error Riesz loss, tailored loss minimization, and covariate balancing as special cases, with an accompanying Python package.
The Riesz representation
theorem
tells us that every bounded linear functional in a Hilbert space can be
represented as an inner product with an element
Since our article describes the construction of nested sequential one-step and targeted maximum likelihood estimators based on using Riesz representers, our logo reflects this recursive orthogonal projection structure.
Additionally, for fun, there is an important equation in the upper left hand corner.
If you encounter any bugs or have any specific feature requests, please file an issue.
After using the RieszCML R package, please cite the following:
@article{balkus2026riesz,
author = {Balkus, Salvador V and Testa, Christian and Hejazi,
Nima S},
title = {A {Riesz} Representer Perspective on Targeted Learning},
year = {2026},
journal = {arXiv preprint arXiv:2604.21721},
url = {https://arxiv.org/abs/2604.21721}
}
@software{balkus2026rieszcml-rpkg,
author = {Testa, Christian, Balkus, Salvador V and Hejazi,
Nima S},
title = {{RieszCML}: {Riesz} Representers for Causal Machine
learning},
year = {2026},
url = {https://github.com/nshlab/RieszCML},
note = {R package}
}
The development of this software was supported in part by a grant from the National Science Foundation (award no. DGE 2140743).
© 2026 Christian Testa, Salvador V. Balkus, Nima S. Hejazi
The contents of this repository are distributed under the MIT license.
See file LICENSE.md for details.
Balkus, Salvador V, Christian Testa, and Nima S Hejazi. 2026. “A Riesz Representer Perspective on Targeted Learning.” arXiv Preprint arXiv:2604.21721. https://arxiv.org/abs/2604.21721.
Chernozhukov, Victor, Whitney K Newey, and Rahul Singh. 2022. “Automatic Debiased Machine Learning of Causal and Structural Effects.” Econometrica 90 (3): 967–1027. https://doi.org/10.3982/ECTA18515.
Dı́az, Iván, Nicholas Williams, Katherine L Hoffman, and Edward J Schenck. 2021. “Nonparametric Causal Effects Based on Longitudinal Modified Treatment Policies.” Journal of the American Statistical Association 118 (542): 846–57. https://doi.org/10.1080/01621459.2021.1955691.
Hirshberg, David A, and Stefan Wager. 2021. “Augmented Minimax Linear Estimation.” The Annals of Statistics 49 (6): 3206–27. https://doi.org/10.1214/21-AOS2080.
Rose, Sherri, and Mark J van der Laan. 2011. “A Targeted Maximum Likelihood Estimator for Two-Stage Designs.” The International Journal of Biostatistics 7 (1): 1–21. https://doi.org/10.2202/1557-4679.1217.
van der Laan, Mark J, and Susan Gruber. 2012. “Targeted Minimum Loss Based Estimation of Causal Effects of Multiple Time Point Interventions.” The International Journal of Biostatistics 8 (1). https://doi.org/10.1515/1557-4679.1370.
van der Laan, Mark J, Eric C Polley, and Alan E Hubbard. 2007. “Super Learner.” Statistical Applications in Genetics and Molecular Biology 6 (1). https://doi.org/10.2202/1544-6115.1309.
