---
title: "Incremental effects for continuous exposures"
date: "2026-10-05"
---
The [LMTP chapter](lmtp.html) answered questions like "what if every unit's dose were one unit lower?" That shift needs positivity at the shifted dose. A unit whose dose sits near the edge of the support, or just beside a gap in it, is moved to a dose that no comparable unit ever received. @schindl-2026 study an intervention that avoids this. Instead of moving each unit's dose, it reweights the distribution each unit's dose is drawn from, so that higher (or lower) doses become more likely. Doses the unit could never receive stay impossible.
For a binary treatment this is the incremental propensity score intervention of @kennedy-2019, which multiplies every unit's odds of treatment by a factor. `npcausal::ipsi()` estimates it, and `lmtp::ipsi()` gives a shift function for binary exposures that scales the probability of treatment by a risk ratio. This chapter is about the continuous version, for which the authors provide replication code but no package. We write the estimator, check it in a simulation, and apply it to the authors' example, political ads and campaign contributions.
## The exponential tilt
We observe covariates $X$, a dose $A$ and an outcome $Y$. Let $\pi(a \mid x)$ be the conditional distribution of the dose and $\mu(x, a) = E(Y \mid X = x, A = a)$ the outcome regression. For a number $\delta$, the tilted distribution of the dose is [@schindl-2026, eq. 1; the construction is from @diaz-hejazi-2020]
$$
q_\delta(a \mid x) = \frac{e^{\delta a}\, \pi(a \mid x)}{\int e^{\delta t}\, \pi(t \mid x)\, dt}.
$$ {#eq-incremental-tilt}
The denominator only makes the result integrate to one. On the log scale, $\log q_\delta(a \mid x) = \log \pi(a \mid x) + \delta a - \text{const}$: we add a line of slope $\delta$ to the log density, which tips it toward high doses when $\delta > 0$ and toward low doses when $\delta < 0$. That is why it is called a tilt. It goes back to @esscher-1932 in actuarial work and is the standard device in importance sampling. A normal density with mean $m$ and variance $s^2$, tilted by $\delta$, becomes a normal with mean $m + \delta s^2$ and the same variance: adding $\delta a$ to the exponent $-(a - m)^2/(2s^2)$ and completing the square moves the centre to $m + \delta s^2$ and leaves the coefficient on $a^2$ alone. On a bounded support it cannot shift forever, so the mass piles up against the edge, and as $\delta \to \infty$ all of it ends up at the top dose.
Two features matter for what follows. First, $\delta$ is not a dose. It is the slope of the log likelihood ratio between $q_\delta$ and $\pi$, measured in one over the units of $A$. The dose change it implies is the change in the conditional mean. The derivative of the tilted mean with respect to $\delta$ is the tilted variance, so for small $\delta$ the change is about $\delta \operatorname{var}(A \mid X)$. Second, where $\pi(a \mid x) = 0$, so is $q_\delta(a \mid x)$. The tilt never sends anyone to a dose they could not have received.
The estimand is the mean outcome when $X$ keeps its distribution and each unit's dose is drawn from $q_\delta$ [@schindl-2026, eq. 2]:
$$
\psi(\delta) = E\left[\int \mu(X, a)\, q_\delta(a \mid X)\, da\right].
$$ {#eq-incremental-psi}
Under consistency and conditional exchangeability, $\psi(\delta)$ is identified by @eq-incremental-psi [@schindl-2026, Section 3.4], and it needs no positivity, because the integral only uses $\mu$ where $\pi$ is positive. At $\delta = 0$ the tilt does nothing and $\psi(0) = E(Y)$. That gives an exact check on any estimator.
## Tilt or shift
The two interventions differ in what they act on. A shift, the modified treatment policy of @diaz-2012 and @haneuse-2013 that `lmtp` estimates, acts on each unit's own dose: it replaces the observed $A$ with $A + s$, or with $A + s$ only when that dose is still feasible. A tilt acts on the distribution the dose is drawn from. Each unit keeps its covariates and receives a new dose drawn from $q_\delta(\cdot \mid X)$, and its observed dose plays no part.
Four differences follow. A shift needs positivity at the shifted dose, $\pi(a + s \mid x) > 0$ wherever $\pi(a \mid x) > 0$; a tilt needs none. A shift moves everyone by $s$ in dose units; a tilt moves the conditional mean by about $\delta \operatorname{var}(A \mid X)$, so units whose dose is more uncertain given their covariates move further. The efficient influence function of a shift weights residuals by the density ratio $\pi(A - s \mid X)/\pi(A \mid X)$ [@diaz-2023], which `lmtp` estimates with a classifier; the tilt weights them by $e^{\delta A}/E(e^{\delta A} \mid X)$. And when the dose is normal given $X$ with variance $\sigma^2(X)$, the tilt by $\delta$ is exactly a shift by $\delta\sigma^2(X)$, by the completing-the-square argument above, so with constant variance the two are the same intervention. They part ways when the support is bounded, lumpy or has holes, which is the setting where the shift's positivity condition bites.
## Efficiency, and why the tilt size matters
Write $E_Q(\mu \mid X) = \int \mu(X, a)\, q_\delta(a \mid X)\, da$ for the regression averaged over the tilted distribution. For bounded $\delta$, the efficient influence function is the following. It is Proposition 1 of @schindl-2026, who write it as three terms that add up to this form, and it was first derived by @diaz-hejazi-2020.
$$
\varphi(Z; \delta) = \frac{q_\delta(A \mid X)}{\pi(A \mid X)}\bigl\{Y - E_Q(\mu \mid X)\bigr\} + E_Q(\mu \mid X) - \psi(\delta),
$$ {#eq-incremental-eif}
and the one-step estimator replaces the nuisances by cross-fitted estimates and averages $\hat\varphi + \hat\psi$ over the sample. The likelihood ratio in @eq-incremental-eif has a simple form, $q_\delta(A \mid X)/\pi(A \mid X) = e^{\delta A} / \int e^{\delta t} \pi(t \mid X)\, dt$, by @eq-incremental-tilt, so we never need the density at the observed dose, only integrals against it.
That ratio grows with $\delta$. If $\pi$ is uniform on $[0, 1]$, it equals $\delta e^{\delta a}/(e^\delta - 1)$, which is at least $\delta$ at $a = 1$ [@schindl-2026, Section 4.1]. @schindl-2026 show that, when the dose density is bounded below on an interval at the top of the support (they call this weak positivity), the variance of $\varphi$ is bounded above and below by multiples of $\delta$ (their Lemma 1). A two-point argument then gives a minimax lower bound of order $\sqrt{\delta / n}$ for any estimator (their Theorem 2), and the cross-fitted one-step estimator attains it (their Theorems 3 and 4). The effective sample size is $n / \delta$. Without weak positivity, for example when the density goes to zero at the top edge, the variance can grow like any power of $\delta$ (their Section 10). As $\delta \to \infty$ in both directions around an interior dose $a'$, a "reflected" tilt also gives an estimate of the dose-response curve $E(Y^{a'})$, with $\delta$ playing the role of an inverse bandwidth. We come back to that at the end.
## Implementing it
The paper estimates $\pi(a \mid x)$ on a grid of design points $a_j$ by regressing the kernel-transformed outcome $K_h(A - a_j)$ on $X$ (their Section 5.1), since $E\{K_h(A - a) \mid X = x\}$ is close to $\pi(a \mid x)$ for small $h$. The integrals in @eq-incremental-tilt and $E_Q(\mu \mid X)$ are then weighted sums over the grid. We keep that approach and change four things.
The first is the bandwidth. The authors' code chooses $h$ by the cross-validated RMSE of the regression of $K_h(A - a_j)$ on $X$. The variance of $K_h(A - a)$ is of order $1/h$, so the criterion is not comparable across bandwidths. Run on a subsample of the application data, it picks an end of its grid at every design point: the largest bandwidth wherever doses are nearby, and the smallest wherever the design point falls between the discrete dose values, since there a narrow kernel sees no data and its target is close to zero. We fix $h$ by Silverman's rule. The second is normalisation. Their $\hat\pi$ for $\psi(\delta)$ is not rescaled to integrate to one, so $\hat q_\delta / \hat\pi$ is off by a factor $1 / \int \hat\pi$, and $\hat\psi(0)$ need not equal $\bar Y$. We renormalise each unit's density. The third is the edge of the support. A Gaussian kernel loses about half its mass at the boundary, which is exactly where the tilt puts its weight, so we reflect the kernel at both ends. The fourth is specific to the application: 12% of the ZIP codes there have no ads at all, so many units share the dose $A = 0$ exactly and no smooth density describes them. The tilt in @eq-incremental-tilt still works: the zero dose keeps weight $e^{0} = 1$, so $q_\delta / \pi = e^{\delta A} / \nu(X)$ with $\nu(x) = E(e^{\delta A} \mid X = x)$, also at $A = 0$. We estimate $P(A = 0 \mid X)$ with a classification forest and fit the kernel to the positive doses only. The influence function keeps the form of @eq-incremental-eif, since the derivation behind Proposition 1 uses only that $q_\delta/\pi$ is a likelihood ratio, which it still is when some units have dose exactly zero. The simulation below supports this: with the true dose distribution the estimator is unbiased with 95% coverage. The paper instead smooths the zeros into the density.
The paper also mentions a version with no density at all (their Remark 3). Since $E_Q(\mu \mid X) = \eta(X)/\nu(X)$ with $\eta(x) = E\{e^{\delta A}\mu(X, A) \mid X = x\}$, both pieces are regressions on $X$. The estimated influence value is $e^{\delta A}(Y - \hat\eta/\hat\nu)/\hat\nu + \hat\eta/\hat\nu$. Its expectation given $X$ is $\eta/\hat\nu - \nu\hat\eta/\hat\nu^2 + \hat\eta/\hat\nu$, and subtracting $\eta/\nu$ leaves a bias of $(\hat\nu - \nu)(\hat\eta/\hat\nu - \eta/\nu)/\hat\nu$, a product of errors, so it is as doubly robust as the density version. The authors report that it is unstable, and we include it in the simulation to see.
All four estimators below share the outcome forest and the cross-fitting. `tilt_grid()` takes a function that returns the conditional dose distribution on a grid, so the same code runs with ours, with the paper's, and with the true distribution in the simulation.
```{r}
#| label: incremental-functions
#| code-fold: true
#| code-summary: "Show the estimator code"
#| message: false
library(ranger)
# ---- Our estimator: tilts through regressions on X -------------------------
# With nu(x) = E[exp(delta A) | X = x] and eta(x) = E[exp(delta A) mu(X, A) | X = x],
# the tilted mean of mu is eta / nu and q / pi at the observed dose is
# exp(delta A) / nu. Both are regressions on X, so no conditional density is
# needed and an atom in the dose distribution (here, A = 0) is handled as it is.
# The influence value is (q / pi)(Y - eta / nu) + eta / nu. eta is fitted to
# exp(delta A) mu_hat(X, A), using out-of-bag predictions of mu on the training
# fold. Exponentials are scaled by exp(-delta c) with c = max(A) for delta > 0,
# which cancels in every ratio. With shift = TRUE we also return the implied
# change in the mean dose, E_Q(A | X) - E(A | X), averaged over units.
tilt_regression <- function(y, a, x, deltas, folds, shift = FALSE, cluster = NULL,
num.trees = 200, threads = 1) {
x <- as.data.frame(x)
n <- length(y)
phi <- matrix(NA_real_, n, length(deltas))
dA <- matrix(NA_real_, n, length(deltas))
reg <- function(target, tr, va) {
f <- ranger(t ~ ., data = data.frame(x[tr, , drop = FALSE], t = target),
num.trees = num.trees, num.threads = threads)
predict(f, data = x[va, , drop = FALSE], num.threads = threads)$predictions
}
for (k in sort(unique(folds))) {
va <- which(folds == k); tr <- which(folds != k)
fmu <- ranger(y ~ ., data = data.frame(x[tr, , drop = FALSE], a = a[tr], y = y[tr]),
num.trees = 500, num.threads = threads)
mu_oob <- fmu$predictions
if (shift) ea0 <- reg(a[tr], tr, va)
for (j in seq_along(deltas)) {
d <- deltas[j]
c0 <- if (d > 0) max(a) else 0
t <- exp(d * (a[tr] - c0))
nu <- reg(t, tr, va)
eq <- reg(t * mu_oob, tr, va) / nu
qp <- exp(d * (a[va] - c0)) / nu
phi[va, j] <- qp * (y[va] - eq) + eq
if (shift) dA[va, j] <- reg(t * a[tr], tr, va) / nu - ea0
}
}
out <- data.frame(delta = deltas, est = colMeans(phi), se = if_se(phi))
if (!is.null(cluster)) out$se_cluster <- if_se(phi, cluster)
if (shift) out$mean_shift <- colMeans(dA)
out
}
# ---- Conditional law of the dose on a grid ----------------------------------
# pi(a | x) at each of D design points a_j is the regression on X of the
# kernel-transformed outcome K_h(A - a_j), as in Section 5.1 of the paper, with
# two changes to the authors' code: h is fixed by Silverman's rule (their CV on
# the RMSE of K_h always picks the largest h) and each unit's density is
# renormalised to integrate to one. With atom = TRUE (our default) the zeros
# get their own probability p0(x) from a classification forest and the kernel
# is fitted to the positive doses only; with reflect = TRUE the kernel is
# reflected at the ends of the support so it does not lose mass there. The
# paper's version is atom = FALSE, reflect = FALSE.
fit_kernel_law <- function(a_tr, x_tr, x_va, atom = TRUE, reflect = TRUE, D = 50,
num.trees = 100, threads = 1) {
p0 <- rep(0, nrow(x_va))
if (atom) {
d0 <- data.frame(x_tr, zero = factor(a_tr == 0, levels = c(FALSE, TRUE)))
f0 <- ranger(zero ~ ., data = d0, probability = TRUE,
num.trees = 300, num.threads = threads)
p0 <- predict(f0, data = x_va, num.threads = threads)$predictions[, "TRUE"]
x_tr <- x_tr[a_tr > 0, , drop = FALSE]; a_tr <- a_tr[a_tr > 0]
}
L <- min(a_tr); U <- max(a_tr); h <- bw.nrd0(a_tr)
ag <- L + (U - L) * (seq_len(D) - 0.5) / D
Fh <- sapply(ag, function(g) {
k <- dnorm((a_tr - g) / h)
if (reflect) k <- k + dnorm((2 * L - a_tr - g) / h) + dnorm((2 * U - a_tr - g) / h)
f <- ranger(k ~ ., data = data.frame(x_tr, k = k / h),
num.trees = num.trees, num.threads = threads)
predict(f, data = x_va, num.threads = threads)$predictions
})
list(p0 = p0, agrid = matrix(ag, nrow(x_va), D, byrow = TRUE),
W = Fh / rowSums(Fh), da = (U - L) / D)
}
mu_on_grid <- function(fmu, x_va, agrid, threads = 1) {
G <- ncol(agrid)
xx <- x_va[rep(seq_len(nrow(x_va)), times = G), , drop = FALSE]
pr <- predict(fmu, data = data.frame(xx, a = as.vector(agrid)),
num.threads = threads)$predictions
matrix(pr, nrow(x_va), G)
}
# Grid estimator for a given conditional law: law(a_tr, x_tr, x_va) returns an
# atom probability p0 at A = 0, a dose grid, weights summing to one per unit and
# the cell width da. Used with fit_kernel_law and, in the simulation, the truth.
tilt_grid <- function(y, a, x, deltas, folds, law, cluster = NULL, threads = 1) {
x <- as.data.frame(x)
n <- length(y)
phi <- matrix(NA_real_, n, length(deltas))
dA <- matrix(NA_real_, n, length(deltas))
for (k in sort(unique(folds))) {
va <- which(folds == k); tr <- which(folds != k)
fmu <- ranger(y ~ ., data = data.frame(x[tr, , drop = FALSE], a = a[tr], y = y[tr]),
num.trees = 500, num.threads = threads)
f <- law(a[tr], x[tr, , drop = FALSE], x[va, , drop = FALSE])
ea0 <- (1 - f$p0) * rowSums(f$W * f$agrid) # E(A | X)
mu_g <- mu_on_grid(fmu, x[va, , drop = FALSE], f$agrid, threads)
mu_0 <- predict(fmu, data = data.frame(x[va, , drop = FALSE], a = 0),
num.threads = threads)$predictions
for (j in seq_along(deltas)) {
d <- deltas[j]
c0 <- if (d > 0) max(a) else 0
# exact integral of exp(delta a) over each grid cell of width da
cf <- if (d == 0) 1 else sinh(d * f$da / 2) / (d * f$da / 2)
ew <- cf * f$W * exp(d * (f$agrid - c0))
nu <- f$p0 * exp(-d * c0) + (1 - f$p0) * rowSums(ew)
eq <- (f$p0 * exp(-d * c0) * mu_0 + (1 - f$p0) * rowSums(ew * mu_g)) / nu
qp <- exp(d * (a[va] - c0)) / nu
phi[va, j] <- qp * (y[va] - eq) + eq
dA[va, j] <- (1 - f$p0) * rowSums(ew * f$agrid) / nu - ea0
}
}
out <- data.frame(delta = deltas, est = colMeans(phi), se = if_se(phi),
mean_shift = colMeans(dA))
if (!is.null(cluster)) out$se_cluster <- if_se(phi, cluster)
out
}
# Standard error of a mean of influence values, one column per estimand:
# iid by default, or clustered when units share a cluster (here, a market).
# With a cluster, the estimators return both.
if_se <- function(phi, cluster = NULL) {
n <- nrow(phi)
if (is.null(cluster)) return(apply(phi, 2, sd) / sqrt(n))
ctr <- sweep(phi, 2, colMeans(phi))
sqrt(colSums(rowsum(ctr, cluster)^2)) / n
}
# Reflected tilt at interior doses a1 (dose-response): tilt up below a1 and
# down above it, with side weights omega = P(A <= a1 | X) and 1 - omega. The
# atom at 0 lies below every a1 > 0. The influence value is (r / pi)(Y - U) + U,
# where U is the tilted mean of mu on the side of a1 where the unit's dose lies.
reflect_grid <- function(y, a, x, a1s, delta, folds, law, cluster = NULL,
threads = 1) {
x <- as.data.frame(x)
n <- length(y)
phi <- matrix(NA_real_, n, length(a1s))
cf <- function(da) sinh(delta * da / 2) / (delta * da / 2)
for (k in sort(unique(folds))) {
va <- which(folds == k); tr <- which(folds != k)
fmu <- ranger(y ~ ., data = data.frame(x[tr, , drop = FALSE], a = a[tr], y = y[tr]),
num.trees = 500, num.threads = threads)
f <- law(a[tr], x[tr, , drop = FALSE], x[va, , drop = FALSE])
mu_g <- mu_on_grid(fmu, x[va, , drop = FALSE], f$agrid, threads)
mu_0 <- predict(fmu, data = data.frame(x[va, , drop = FALSE], a = 0),
num.threads = threads)$predictions
for (j in seq_along(a1s)) {
a1 <- a1s[j]
lo <- f$agrid <= a1
elo <- cf(f$da) * f$W * exp(delta * (f$agrid - a1)) * lo # at most 1
ehi <- cf(f$da) * f$W * exp(-delta * (f$agrid - a1)) * !lo # at most 1
p0s <- f$p0 * exp(-delta * a1)
D1 <- p0s + (1 - f$p0) * rowSums(elo)
D2 <- (1 - f$p0) * rowSums(ehi)
om <- f$p0 + (1 - f$p0) * rowSums(f$W * lo)
m1 <- (p0s * mu_0 + (1 - f$p0) * rowSums(elo * mu_g)) / D1
m2 <- ((1 - f$p0) * rowSums(ehi * mu_g)) / D2
low <- a[va] <= a1
rp <- ifelse(low, om * exp(delta * (a[va] - a1)) / D1,
(1 - om) * exp(-delta * (a[va] - a1)) / D2)
U <- ifelse(low, m1, m2)
phi[va, j] <- rp * (y[va] - U) + U
}
}
out <- data.frame(a1 = a1s, delta = delta, est = colMeans(phi), se = if_se(phi))
if (!is.null(cluster)) out$se_cluster <- if_se(phi, cluster)
out
}
```
## Simulation
We check two things: whether the one-step estimator is right when the dose distribution is known, and what estimating it costs. The covariates $X_1$ and $X_2$ are independent uniforms on $(0, 1)$. With probability $\operatorname{expit}(-1.5 + X_1)$ the dose is zero. Otherwise it is drawn from a density on $(0, 1)$ that depends on $X_2$ and is at least $0.5$ everywhere, so weak positivity holds at both edges. The outcome is $Y = 1 + X_1 + X_2 + 2A + \sin(3A) + \varepsilon$ with standard normal $\varepsilon$, and the true $\psi(\delta)$ comes from numerical integration.
All estimators are the cross-fitted one-step estimator of @eq-incremental-eif with the same outcome forest. They differ only in the dose distribution plugged into it: the known one that generated the data (the oracle), which no one has in practice; ours, which models the zeros separately; and the paper's, which smooths the zeros into the density. We use $n = 1000$ with 200 replications and $n = 4000$ with 100, and tilts from $-10$ to $25$. The run takes about two hours on six cores, so the code reads saved results.
```{r}
#| label: incremental-sim-dgp
#| code-fold: true
#| code-summary: "Show the simulation code"
mu_true <- function(x1, x2, a) 1 + x1 + x2 + 2 * a + sin(3 * a)
p0_true <- function(x1) plogis(-1.5 + x1)
# density of A given A > 0: half Uniform(0, 1), half Beta(1 + 2 x2, 1), so it is
# at least 0.5 on all of [0, 1] (weak positivity at both edges)
f_pos <- function(a, x2) 0.5 + 0.5 * dbeta(a, 1 + 2 * x2, 1)
sim_data <- function(n) {
x1 <- runif(n); x2 <- runif(n)
zero <- runif(n) < p0_true(x1)
pos <- ifelse(runif(n) < 0.5, runif(n), rbeta(n, 1 + 2 * x2, 1))
a <- ifelse(zero, 0, pos)
y <- mu_true(x1, x2, a) + rnorm(n)
list(y = y, a = a, x = data.frame(x1 = x1, x2 = x2))
}
# True psi(delta) by quadrature: midpoint grids over (x1, x2) and over a.
true_psi <- function(deltas, nx = 100, na = 2000) {
g <- (seq_len(nx) - 0.5) / nx
ag <- (seq_len(na) - 0.5) / na
X <- expand.grid(x1 = g, x2 = g)
sapply(deltas, function(d) {
p0 <- p0_true(X$x1)
num <- den <- numeric(nrow(X))
c0 <- if (d > 0) 1 else 0 # scale exp(delta a) by exp(-delta c0)
for (j in seq_len(nrow(X))) {
f <- f_pos(ag, X$x2[j]) / na
ew <- f * exp(d * (ag - c0))
den[j] <- sum(ew)
num[j] <- sum(ew * mu_true(X$x1[j], X$x2[j], ag))
}
s <- exp(-d * c0) # same scaling for the atom
mean((p0 * s * mu_true(X$x1, X$x2, 0) + (1 - p0) * num) /
(p0 * s + (1 - p0) * den))
})
}
oracle_law <- function(a_tr, x_tr, x_va, G = 200) {
ag <- (seq_len(G) - 0.5) / G
W <- t(sapply(x_va$x2, function(v) { f <- f_pos(ag, v); f / sum(f) }))
list(p0 = p0_true(x_va$x1), agrid = matrix(ag, nrow(x_va), G, byrow = TRUE), W = W,
da = 1 / G)
}
one_rep <- function(n, deltas) {
d <- sim_data(n)
folds <- sample(rep(1:5, length.out = n))
out <- rbind(
data.frame(estimator = "regression",
tilt_regression(d$y, d$a, d$x, deltas, folds)),
data.frame(estimator = "mixed",
tilt_grid(d$y, d$a, d$x, deltas, folds, law = fit_kernel_law)),
data.frame(estimator = "paper",
tilt_grid(d$y, d$a, d$x, deltas, folds, law = function(...)
fit_kernel_law(..., atom = FALSE, reflect = FALSE))),
data.frame(estimator = "oracle",
tilt_grid(d$y, d$a, d$x, deltas, folds, law = oracle_law)))
stopifnot(all(abs(out$est[out$delta == 0] - mean(d$y)) < 1e-8))
out$n <- n
out
}
```
```{r}
#| label: incremental-sim-run
#| code-fold: true
#| code-summary: "Show the runner"
library(parallel)
# About 40 minutes for n = 1000 and 95 for n = 4000 on six cores, so the chunk
# reads the saved results when they exist.
if (!file.exists("incremental-effects-sim.rds")) {
RNGkind("L'Ecuyer-CMRG"); set.seed(20261005)
deltas <- c(-10, -5, -2, 0, 2, 5, 10, 25)
truth <- data.frame(delta = deltas, truth = true_psi(deltas))
res <- list()
for (n in c(1000, 4000)) {
reps <- if (n == 1000) 200 else 100
t0 <- Sys.time()
out <- mclapply(seq_len(reps), function(r) {
o <- try(one_rep(n, deltas)); if (!inherits(o, "try-error")) o$rep <- r; o
}, mc.cores = 6, mc.set.seed = TRUE)
bad <- vapply(out, inherits, logical(1), "try-error")
if (any(bad)) message("n=", n, ": ", sum(bad), " failed reps: ", out[bad][[1]])
res[[as.character(n)]] <- do.call(rbind, out[!bad])
message("n=", n, " done in ", format(Sys.time() - t0))
saveRDS(list(truth = truth, sims = do.call(rbind, res)), "incremental-effects-sim.rds")
}
}
sim <- readRDS("incremental-effects-sim.rds")
```
```{r}
#| label: incremental-sim-table
#| echo: false
sims <- merge(sim$sims, sim$truth, by = "delta")
sims$cover <- abs(sims$est - sims$truth) <= qnorm(0.975) * sims$se
summ <- do.call(rbind, lapply(split(sims, list(sims$estimator, sims$n, sims$delta), drop = TRUE),
function(s) data.frame(estimator = s$estimator[1], n = s$n[1], delta = s$delta[1],
bias = mean(s$est - s$truth), sd = sd(s$est),
se = mean(s$se), cover = mean(s$cover))))
summ$estimator <- factor(summ$estimator, c("oracle", "mixed", "paper", "regression"))
summ <- summ[order(summ$estimator, summ$n, summ$delta), ]
```
```{r}
#| label: tbl-incremental-sim
#| tbl-cap: "Bias and coverage of nominal 95% intervals for $\\psi(\\delta)$. All three estimators use @eq-incremental-eif with the same outcome forest and differ only in the dose distribution $\\pi$: the known one used to generate the data (the oracle), ours (zeros modelled separately), or the paper's (zeros smoothed into the density)."
#| echo: false
cell <- function(e, nn, d, v) summ[summ$estimator == e & summ$n == nn & summ$delta == d, v]
keep <- subset(summ, estimator != "regression" & delta %in% c(-5, -2, 2, 10))
wide <- reshape(keep[, c("estimator", "n", "delta", "bias", "cover")],
idvar = c("n", "delta"), timevar = "estimator", direction = "wide")
wide <- wide[order(wide$n, wide$delta),
c("n", "delta", "bias.oracle", "cover.oracle", "bias.mixed", "cover.mixed",
"bias.paper", "cover.paper")]
knitr::kable(wide, digits = c(0, 0, 3, 2, 3, 2, 3, 2), row.names = FALSE,
col.names = c("$n$", "$\\delta$", "Known $\\pi$: bias", "Known $\\pi$: cover", "Ours: bias",
"Ours: cover", "Paper's: bias", "Paper's: cover"))
```
With the true dose distribution the estimator is unbiased and covers at about 95% at every tilt, so @eq-incremental-eif and the one-step estimator are right. With our estimated distribution the bias at $\delta = -5$ falls only from `r round(cell("mixed", 1000, -5, "bias"), 3)` to `r round(cell("mixed", 4000, -5, "bias"), 3)` when $n$ quadruples, while the standard deviation halves, so coverage falls from `r round(cell("mixed", 1000, -5, "cover"), 2)` to `r round(cell("mixed", 4000, -5, "cover"), 2)`. The reason is that the remainder contains the squared error of the density estimate [@schindl-2026, Theorem 3], so a good outcome model does not protect us and the density has to be estimated well at every dose. Smoothing the zeros into the density, as the paper's code does, is worse: at negative tilts its coverage is close to zero at both sample sizes. The density-free regression version of the previous section, which we also ran, was unstable at large positive tilts, as the authors reported.
## Political ads and campaign contributions
The application follows @urban-niebler-2014, with data from @fong-2018 as distributed in the authors' repository. The units are 16,265 ZIP codes in states that were not competitive in the 2008 presidential election. Media markets cross state lines, so some of these ZIP codes received ads aimed at a neighbouring competitive state. The dose is $\log(\text{ads} + 1)$. The outcome is the ZIP code's total contributions to the two presidential campaigns, $C$, in thousands of dollars, entered as $\log(C + 1)$. Thirty-six percent of ZIP codes gave nothing and the median gave \$750. It is a total, not an amount per person, which is one reason log population is among the eight covariates, which are those of the paper. Two facts about the dose shape the analysis. Twelve percent of ZIP codes have no ads, and none has between about 3.6 and 5.0 log ads. And ads are bought by media market, so every ZIP code in one of the 138 markets has the same dose. The dose takes only 73 distinct values. The paper treats the ZIP codes as independent. We cross-fit with folds made of whole markets and report standard errors clustered by market next to the iid ones.
```{r}
#| label: incremental-app
e <- new.env(); load("FECForCEM.RData", envir = e); fec <- e$x
y <- log(fec$Cont + 1)
a <- log(fec$TotAds + 1)
X <- model.matrix(~ -1 + log(TotalPop) + PercentOver65 + log(Inc + 1) + PercentHispanic +
PercentBlack + density + per_collegegrads + CanCommute, data = fec)
colnames(X) <- make.names(colnames(X))
market <- fec$DMACode
set.seed(20261005)
mk <- unique(market)
folds <- sample(rep(1:5, length.out = length(mk)))[match(market, mk)]
if (!file.exists("incremental-effects-app.rds")) {
deltas <- seq(-2.5, 5, by = 0.05)
mixed <- tilt_grid(y, a, X, deltas, folds, cluster = market, threads = 6,
law = function(...) fit_kernel_law(..., D = 100, threads = 6))
paper <- tilt_grid(y, a, X, deltas, folds, cluster = market, threads = 6,
law = function(...) fit_kernel_law(..., atom = FALSE, reflect = FALSE,
D = 100, threads = 6))
stopifnot(abs(mixed$est[mixed$delta == 0] - mean(y)) < 1e-8,
abs(paper$est[paper$delta == 0] - mean(y)) < 1e-8)
apos <- a[a > 0]
delta_dr <- length(y)^(1/3) / diff(range(apos))
a1s <- c(1, 2, 3, 5.5, 6.5, 7.5, 8.5, 9.5)
dr <- reflect_grid(y, a, X, a1s, delta_dr, folds, cluster = market, threads = 6,
law = function(...) fit_kernel_law(..., D = 100, threads = 6))
saveRDS(list(mixed = mixed, paper = paper, dr = dr, delta_dr = delta_dr, ybar = mean(y)),
"incremental-effects-app.rds")
}
app <- readRDS("incremental-effects-app.rds")
```
```{r}
#| label: fig-incremental-app
#| fig-cap: "Estimated incremental effect of political ads on log contributions (top) and the implied change in the mean dose (bottom), with the zeros modelled separately (ours) and smoothed into the density (the paper's). Bands are 95% intervals clustered by media market."
#| fig-height: 6
#| echo: false
#| message: false
library(ggplot2)
lab <- c(mixed = "zeros modelled separately (ours)", paper = "zeros smoothed into density (paper)")
long <- rbind(
data.frame(law = unname(lab["mixed"]), delta = app$mixed$delta, panel = "psi(delta)", value = app$mixed$est,
lo = app$mixed$est - 1.96 * app$mixed$se_cluster, hi = app$mixed$est + 1.96 * app$mixed$se_cluster),
data.frame(law = unname(lab["paper"]), delta = app$paper$delta, panel = "psi(delta)", value = app$paper$est,
lo = app$paper$est - 1.96 * app$paper$se_cluster, hi = app$paper$est + 1.96 * app$paper$se_cluster),
data.frame(law = unname(lab["mixed"]), delta = app$mixed$delta, panel = "change~'in mean log ads'",
value = app$mixed$mean_shift, lo = NA, hi = NA),
data.frame(law = unname(lab["paper"]), delta = app$paper$delta, panel = "change~'in mean log ads'",
value = app$paper$mean_shift, lo = NA, hi = NA))
long$panel <- factor(long$panel, c("psi(delta)", "change~'in mean log ads'"))
ggplot(long, aes(delta, value, colour = law, fill = law)) +
geom_ribbon(aes(ymin = lo, ymax = hi), alpha = 0.15, colour = NA, na.rm = TRUE) +
geom_line(linewidth = 0.8) +
facet_wrap(~ panel, ncol = 1, scales = "free_y", labeller = label_parsed) +
labs(x = expression(delta~"(per log ad)"), y = NULL, colour = NULL, fill = NULL) +
theme_minimal(base_size = 12) + theme(legend.position = "bottom")
mx <- function(d, v = "est") app$mixed[[v]][abs(app$mixed$delta - d) < 1e-9]
px <- function(d, v = "est") app$paper[[v]][abs(app$paper$delta - d) < 1e-9]
```
The check at zero holds: $\hat\psi(0) =$ `r round(mx(0), 4)`, the sample mean of log contributions. The first thing the bottom panel shows is how strong these tilts are. The dose has variance `r round(var(a), 1)` across ZIP codes, so $\delta = 0.05$ already moves the mean dose by `r round(mx(0.05, "mean_shift"), 2)` log ads, and the paper's largest tilt, $\delta = 5$, moves it by `r round(mx(5, "mean_shift"), 2)`, which puts nearly every ZIP code at the largest ad counts. The range of $\delta$ the paper plots, from $-2.5$ to $5$, runs from almost no ads to the maximum.
The estimated curve rises slightly from `r round(mx(0), 3)` to a peak of `r round(max(app$mixed$est), 3)` near $\delta =$ `r app$mixed$delta[which.max(app$mixed$est)]`, then falls to `r round(mx(5), 3)` at $\delta = 5$. Negative tilts lower it to `r round(mx(-2.5), 3)` at $\delta = -2.5$. For positive tilts the two versions agree, because the zeros get little weight there. For negative tilts the paper's version gives lower values, `r round(px(-2.5), 3)` at $\delta = -2.5$, which is the same direction as its bias in the simulation.
The standard errors clustered by market are about ten times the iid ones: `r round(mx(0, "se_cluster"), 3)` against `r round(mx(0, "se"), 3)` at $\delta = 0$. Ads vary across 138 markets, and the iid errors treat 16,265 ZIP codes as independent doses. With intervals of about $\pm 0.24$, moderate tilts cannot be told apart from no tilt, and the simulation warns that even these intervals are too narrow at moderate $\delta$. We read the curve as descriptive.
This does not match the paper's application. It describes its results as average individual contributions rising from about \$2.00 at $\delta = 0$ to \$2.20 at $\delta = 5$, with most of the gain below $\delta = 1$. The outcome is neither individual nor in dollars: it is the log of ZIP-level totals in thousands of dollars. Undoing the log at $\delta = 0$ gives $e^{\hat\psi(0)} - 1 =$ `r round(exp(mx(0)) - 1, 2)` thousand dollars per ZIP code, and that is a geometric-type average of totals, not a mean contribution. The missing normalisation of $\hat\pi$ in their code does not account for the difference either: run on a subsample of the data, their code puts $\hat\psi(0)$ within 0.01 of the sample mean. We could not find how the dollar figures were computed.
## Shift and tilt on the same ZIP codes
We now estimate shifts with `lmtp` on the same data: the same covariates, a ranger learner for both nuisances, cross-fitting and standard errors by market. Each unit's dose moves by $s = \pm 0.5$ log ads when the shifted dose stays inside the observed range and is left alone otherwise. For each shift we take the tilt whose implied change in the mean dose is the same, read off the fine grid of $\delta$ above, so the two interventions move the average dose by the same amount.
```{r}
#| label: incremental-lmtp
# Shift interventions on the same ZIP codes with lmtp: move each unit's dose by
# s log ads when the shifted dose stays inside the observed range, and leave it
# unchanged otherwise. Same covariates, a ranger learner for both nuisances,
# cross-fitting and standard errors by media market.
library(lmtp); library(SuperLearner)
SL.ranger6 <- function(...) SL.ranger(..., num.trees = 500, num.threads = 6)
feasible_shift <- function(s, lo, hi) function(data, trt) {
a <- data[[trt]]
ifelse(a + s >= lo & a + s <= hi, a + s, a)
}
fec_df <- data.frame(X, a = a, y = y, market = market)
if (!file.exists("incremental-effects-lmtp.rds")) {
shifts <- c(-0.5, 0.5)
lmtp_fits <- lapply(shifts, function(s) {
f <- lmtp_sdr(fec_df, trt = "a", outcome = "y", baseline = colnames(X),
shift = feasible_shift(s, min(a), max(a)), mtp = TRUE,
outcome_type = "continuous", id = "market",
learners_outcome = "SL.ranger6", learners_trt = "SL.ranger6", folds = 5)
d <- feasible_shift(s, min(a), max(a))(fec_df, "a")
data.frame(s = s, est = f$estimate@x, se = f$estimate@std_error,
mean_shift = mean(d - a), share_moved = mean(d != a))
})
lmtp_res <- do.call(rbind, lmtp_fits)
saveRDS(lmtp_res, "incremental-effects-lmtp.rds")
}
lmtp_res <- readRDS("incremental-effects-lmtp.rds")
```
```{r}
#| label: incremental-lmtp-table
#| echo: false
match_tilt <- function(s) {
d <- approx(app$mixed$mean_shift, app$mixed$delta, xout = s)$y
c(delta = d, est = approx(app$mixed$delta, app$mixed$est, xout = d)$y,
se = approx(app$mixed$delta, app$mixed$se_cluster, xout = d)$y)
}
cmp <- do.call(rbind, lapply(seq_len(nrow(lmtp_res)), function(j) {
t <- match_tilt(lmtp_res$mean_shift[j])
data.frame(s = lmtp_res$s[j], share = lmtp_res$share_moved[j], dA = lmtp_res$mean_shift[j],
shift = lmtp_res$est[j], shift_se = lmtp_res$se[j],
delta = t["delta"], tilt = t["est"], tilt_se = t["se"])
}))
knitr::kable(cmp, digits = 3, row.names = FALSE,
col.names = c("$s$", "Share moved", "Mean change in dose", "Shift estimate", "SE",
"Matched $\\delta$", "Tilt estimate", "SE"),
caption = "Shift (lmtp) and tilt with the same change in the mean dose. Standard errors clustered by market; the tilt estimate is interpolated on the grid of $\\delta$.")
```
For a change of half a log ad in the average dose, the two estimates are almost the same: `r round(cmp$shift[2], 3)` for the shift and `r round(cmp$tilt[2], 3)` for the tilt when the mean dose rises, and `r round(cmp$shift[1], 3)` against `r round(cmp$tilt[1], 3)` when it falls. Both are within a few thousandths of $\bar Y =$ `r round(app$ybar, 3)`, and the differences are far inside the standard errors. Small changes in ads move contributions very little under either intervention.
They differ in who moves. The shift moves everyone it can by the same amount: `r round(100 * cmp$share[2], 1)`% of ZIP codes for the upward shift, and `r round(100 * cmp$share[1], 1)`% for the downward one, since the ZIP codes with no ads cannot go lower. The tilt with the same mean moves units in proportion to the spread of their dose given covariates and never sends anyone to a dose they could not receive. The shift also sends every ZIP code it moves to an ad count that no market had. The dose takes only 73 values, and none of the shifted doses, `r format(sum(a - 0.5 >= min(a)), big.mark = ",")` downward and `r format(sum(a + 0.5 <= max(a)), big.mark = ",")` upward, equals one of them. Staying inside the observed range therefore does not make a shifted dose supported. The data say nothing directly about outcomes at those doses, and `lmtp`'s outcome model and density-ratio classifier fill the gaps by smoothing between the observed doses. The tilt, by contrast, only reweights doses that occur. Its standard errors here are larger, `r round(cmp$shift_se[2], 3)` against `r round(cmp$tilt_se[2], 3)`.
So the two estimates are close, but they do not rest on the same evidence. The tilt estimate is identified from the doses the markets received. The shift estimate depends on how the models extrapolate to doses no market received, so the comparison is a check of that extrapolation and not a second identified estimate that agrees with the first. Under both, a small change in ads moves contributions very little. The choice of intervention matters for what the estimate means and for what the data must support. A shift asks what would happen if every ZIP code saw half a log ad more. It is stated in dose units, and it needs the shifted doses to be ones that comparable ZIP codes actually received. A tilt asks what would happen if higher ad counts became more likely. It never needs an impossible dose, but its $\delta$ has to be translated into a change in the dose, as the bottom panel of @fig-incremental-app does. We would use a shift when the shifted doses are plausible, and a tilt when the edges of the support, gaps in it, or a pile of zeros rule shifts out. Either way the intervals depend on estimating the dose distribution well. Our simulation shows this for the tilt; we have not checked it for `lmtp`.
## Dose-response by a reflected tilt
To reach an interior dose $a'$, tilt upward below $a'$ and downward above it. With $\omega(x) = P(A \le a' \mid X = x)$, the reflected tilt is the following [@schindl-2026, Section 6; Theorem 5 gives its influence function]
$$
r_\delta(a \mid x) = \omega(x)\, \frac{e^{\delta a}\pi(a\mid x)\, 1(a \le a')}{\int_{t \le a'} e^{\delta t}\pi(t\mid x)\, dt} + \{1 - \omega(x)\}\, \frac{e^{-\delta a}\pi(a\mid x)\, 1(a > a')}{\int_{t > a'} e^{-\delta t}\pi(t\mid x)\, dt},
$$ {#eq-incremental-reflect}
and $\psi_R(\delta, a')$ averages $\mu$ over it. As $\delta \to \infty$ it converges to $E(Y^{a'})$. If $\mu$ is Lipschitz in the dose, the estimate is within $O_P(1/\delta + \sqrt{\delta/n})$ of $E(Y^{a'})$ (their Theorem 6), so $\delta$ of order $n^{1/3}$ gives the usual $n^{-1/3}$ rate. The two sides of $a'$ get the weights $\omega$ and $1 - \omega$, which makes the tilt an asymmetric exponential kernel. Its bias is first order in $1/\delta$, which is why the result stops at Lipschitz smoothness. The rate is stated for a dose on $[0, 1]$, so we set $\delta = n^{1/3}$ on that scale, which is $\delta =$ `r round(app$delta_dr, 2)` per log ad here, and evaluate the curve away from the hole, where weak positivity fails.
Two qualifications apply to the figure below. First, the dose takes only 73 values, and none of the eight targets $a'$ is one of them; the nearest observed doses are `r round(min(gap_a1 <- sapply(app$dr$a1, function(v) min(abs(unique(a) - v)))), 3)` to `r round(max(gap_a1), 3)` log ads away. Theorem 6 assumes a positive conditional density of the dose near $a'$, which a discrete dose does not have. As $\delta$ grows, the tilt applied to the true dose distribution piles onto the observed doses next to $a'$, not onto $a'$ itself. Our estimated dose density is smooth, so it puts mass between the observed doses, but the data cannot tell us the outcome there. Second, the $n^{1/3}$ rule is derived for independent units. We use $n$ = 16,265 ZIP codes, but the dose is set by 138 markets, and with $n = 138$ the same rule gives a $\delta$ about five times smaller. We therefore read the curve as a smoothed, model-dependent description of how contributions vary with ads, not as estimates of $E(Y^{a'})$.
```{r}
#| label: fig-incremental-dr
#| fig-cap: "Smoothed, model-dependent description of log contributions against log ads by the reflected tilt, with 95% intervals clustered by market. The curve is not evaluated in the hole of the dose distribution between about 3.6 and 5.0."
#| fig-height: 3.6
#| echo: false
ggplot(app$dr, aes(a1, est)) +
annotate("rect", xmin = 3.56, xmax = 5.0, ymin = -Inf, ymax = Inf, alpha = 0.12) +
geom_pointrange(aes(ymin = est - 1.96 * se_cluster, ymax = est + 1.96 * se_cluster)) +
geom_hline(yintercept = app$ybar, linetype = 2, colour = "grey50") +
labs(x = "log(ads + 1)", y = "Smoothed log contributions (tilt target)") +
theme_minimal(base_size = 12)
```
The estimated curve is flat within its noise. It rises from `r round(app$dr$est[1], 3)` at one log ad to `r round(max(app$dr$est), 3)` at `r app$dr$a1[which.max(app$dr$est)]` and falls to `r round(app$dr$est[nrow(app$dr)], 3)` at `r app$dr$a1[nrow(app$dr)]`, with clustered standard errors between `r round(min(app$dr$se_cluster), 2)` and `r round(max(app$dr$se_cluster), 2)`. The dashed line is the sample mean. The same caveats apply as before: intervals that understate uncertainty when the density is estimated, a bias of order $1/\delta$, and targets that lie between the observed doses.
## Summary
An incremental effect tilts each unit's dose distribution toward higher or lower doses, $q_\delta(a \mid x) \propto e^{\delta a}\pi(a \mid x)$, and asks for the mean outcome under the tilted distribution. Doses a unit could never receive stay impossible, so the effect is identified without positivity, which a shift of the dose needs. The price is that $\delta$ is not a dose: it changes the mean dose by about $\delta \operatorname{var}(A \mid X)$. Its efficient influence function weights residuals by $e^{\delta A}/E(e^{\delta A} \mid X)$. Under weak positivity at the top of the support, the best attainable error is of order $\sqrt{\delta/n}$, and the cross-fitted one-step estimator attains it when the nuisances are good enough.
"Good enough" is the catch. In our simulation the one-step estimator is unbiased and covers at 95% when the dose distribution is known. With the distribution estimated by the paper's kernel regression, made to integrate to one, reflected at the edges and given a separate probability for zero doses, the bias falls more slowly than the standard error, and coverage at moderate tilts gets worse as $n$ grows. The remainder contains the squared error of the density estimate, so the conditional density has to be estimated well, uniformly over doses. Smoothing the zeros into the density biases negative tilts badly, and the regression version without a density is unstable.
In the political-ads data the tilts are strong, standard errors must be clustered by the 138 media markets that set the dose, and the curve is flat within those errors. Shifting the dose by half a log ad with `lmtp` gives almost the same estimate as a tilt with the same change in the mean dose. The shifted doses are values no market received, so the shift estimate rests on the models' smoothing between observed doses. The reflected-tilt dose-response curve rests on the same smoothing, because its targets also lie between the 73 observed doses.
---
<!-- see-also-footer -->
*Systematic treatment: [R](https://xiangao.github.io/causal_econometrics_guide/continuous-treatments.html) · [Julia](https://xiangao.github.io/causal_econometrics_julia/continuous-treatments.html).*