The Bayesian infinitesimal jackknife approximates the resampling (bootstrap) variance of a posterior mean using a first-order expansion in data-point weights. The influence of unit i is ncovθ∣D[θ,ℓi(D∣θ)] - computable from a single MCMC run if per-unit log-likelihood contributions are saved. A cluster version sums the influence over clusters.
Overview
Resampling-based SEs (bootstrap, jackknife) are standard in frequentist quantile regression (Bose and Chatterjee 2003; Portnoy 2014; Koenker 2021) but infeasible for repeated MCMC. IJ (Jaeckel 1972; Jennrich 2008 in covariance structure analysis; Giordano and Broderick 2024 for Bayes, built on Giordano et al. 2018, 2020; Giordano 2020) gives a linear approximation. The R package StanSensitivity computes IJ for sensitivity analysis; the authors’ IJSE is tailored to brms.
Main Content
Weighted log-likelihood and resampling weights
Let w∈Rn have wi = number of times unit i appears in a resample. The weighted log-likelihood is ∑i=1nwiℓi(D∣θ) (ℓi = contribution of unit i).
Linear approximation of the resampled posterior mean (Eqs. 4-5; Giordano et al. 2018, Thm. 1; Efron 2015)
where ℓ(D∣θ) is the n-vector of unit log-likelihood contributions. The matrix of derivatives equals the posterior covariance of θ with each ℓi; estimate it by the empirical covariance across MCMC draws.
IJ variance estimator
Empirical influence of unit i: Ii=dwidE(θ∣D,w)w=1⋅n=ncovθ∣D[θ,ℓi(D∣θ)]. Then
V^IJ=n(n−1)1i=1∑n(Ii−Iˉ)(Ii−Iˉ)′,
Iˉ the mean influence. The “standard error” is the square root of the diagonal; intervals use a normal approximation about the posterior mean.
Clustered IJ
With J clusters and n units, cluster j influence Ij(cl)=J∑i∈jIi/n=Jcovθ∣D[θ,ℓj(cl)(D∣θ)] with ℓj(cl)=∑i∈jℓi, and
Justified by resampling entire clusters. Targets the marginal quantile (ignore clustering for point estimation, correct only the SE, as in Hagemann 2017’s cluster-robust bootstrap); regression coefficients in cluster-specific random/fixed-effects quantile models (Koenker and Hallock 2004; Geraci and Bottai 2007, 2014; Reich et al. 2010) have no meaningful marginal interpretation.
Variants.IJf = IJ with σ fixed (e.g. 1); IJ = IJ with σ estimated (half-t(3) prior in brms), preferred in applications. The AL assumption of independence is violated by clustered data, which is why clustering is handled in the SE rather than the likelihood.
Examples
Python: IJ variance from posterior draws
import numpy as npdef ij_cov(theta_draws, loglik_draws, cluster=None): """theta_draws: (S, p) draws; loglik_draws: (S, n) per-unit log-lik at each draw.""" S, n = loglik_draws.shape if cluster is None: L, scale = loglik_draws, n; m = n else: ids = np.unique(cluster) L = np.stack([loglik_draws[:, cluster == j].sum(1) for j in ids], 1) m = len(ids); scale = m th = theta_draws - theta_draws.mean(0) Lc = L - L.mean(0) infl = scale * (th.T @ Lc) / (S - 1) # (p, m) influence matrix, cov(theta, l_i) * scale infl_c = infl - infl.mean(1, keepdims=True) return infl_c @ infl_c.T / (m * (m - 1))
With PyMC use pm.compute_log_likelihood(idata) for the per-unit contributions, flattening chains and draws.