Minimax-regret aggregator for multisite function-valued estimands
Source:R/minmax_regret.R
minmax_regret.RdImplements the minimax-regret estimator of Zhang, Huang, and Imai
(arXiv:2412.11136) for
aggregating site-level function estimates. Given study-level functions
\(\hat f^{(i)}\), the estimator is
$$\hat q = \arg\min_{q \in \Delta_{m-1}}\
q^\top \hat\Gamma\, q - \hat d^\top q,
\qquad
\hat\Gamma_{ij} = \sum_g w_g\, \hat f^{(i)}(x_g)\hat f^{(j)}(x_g),\ \
\hat d_i = \sum_g w_g\, (\hat f^{(i)}(x_g))^2,$$
yielding the predicted target function
\(\tilde f(x) = \sum_{i=1}^m \hat q_i\, \hat f^{(i)}(x)\).
Unlike metahunt(), this method does not use study-level covariates;
the target is the worst-case-regret aggregator over the convex hull of
source functions.
Arguments
- F_hat
An
m-by-G_gridnumeric matrix of source-site function evaluations on a shared grid; rowiis \(\hat f^{(i)}\).- grid_weights
Optional length-
G_gridnon-negative numeric vector defining the target measure used to compute \(\hat\Gamma\) and \(\hat d\). Defaults to uniform weights1 / G_grid.- ridge
Non-negative scalar; replaces \(\hat\Gamma\) with \(\hat\Gamma + \text{ridge}\cdot I\) for numerical stability. Defaults to
1e-10.- wrapper
Optional reduction function (see
apply_wrapper()). IfNULL,predictionis the length-G_gridpredicted target function; if a function,predictionis the scalarwrapper(prediction)(e.g. an ATE whenwrapper = meanand rows ofF_hatare CATE evaluations).
Value
An object of class "minmax_regret": a list with
predictionPredicted target. Length-
G_gridvector whenwrapper = NULL; scalar otherwise.qLength-
msimplex weights from the minimax-regret QP.GammaThe
m-by-mGram matrix used (post-ridge).dLength-
mlinear coefficient vector.grid_weightsGrid weights used.
ridgeRidge value used.
wrapperWrapper function or
NULL.
Details
The simplex-constrained QP is solved with quadprog::solve.QP().
A small ridge is added to \(\hat\Gamma\) for numerical stability when
source functions are highly collinear. The resulting q is clipped to
be non-negative and renormalised to sum to 1 to absorb floating-point
drift.
References
Zhang, Y., Huang, M., and Imai, K. (2024). Minimax regret estimation for generalizing heterogeneous treatment effects with multisite data. arXiv:2412.11136.
Examples
set.seed(1)
G <- 30; m <- 6
x <- seq(0, 1, length.out = G)
F_hat <- rbind(
sin(pi * x),
cos(pi * x),
x,
0.5 * sin(pi * x) + 0.5 * x,
0.3 * cos(pi * x) + 0.7 * x,
0.4 * sin(pi * x) + 0.4 * cos(pi * x) + 0.2 * x
)
fit <- minmax_regret(F_hat)
fit$q # simplex weights over sources
#> [1] 0.0 0.5 0.5 0.0 0.0 0.0
length(fit$prediction) # G: predicted target function
#> [1] 30
# ATE-style scalar via wrapper
minmax_regret(F_hat, wrapper = mean)$prediction
#> [1] 0.25