Ji 2024 - Infinitesimal Jackknife Standard Errors

Summary

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 is - 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 have = number of times unit appears in a resample. The weighted log-likelihood is ( = contribution of unit ).

Linear approximation of the resampled posterior mean (Eqs. 4-5; Giordano et al. 2018, Thm. 1; Efron 2015)

where is the -vector of unit log-likelihood contributions. The matrix of derivatives equals the posterior covariance of with each ; estimate it by the empirical covariance across MCMC draws.

IJ variance estimator

Empirical influence of unit : . Then

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 clusters and units, cluster influence with , 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-(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 np
def 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.

Connections

Ji 2024 - Yang-Wang-He Sandwich Adjustment (competitor); the bootstrap-calibrated learning rate in Ji 2024 - Gibbs Posterior and Learning-Rate Calibration also uses resampling but tunes instead of the SE. Cluster-robust ideas parallel those in Geo-Experiment Methodology - Overview.

See Also

Ji 2024 - Valid Standard Errors for Bayesian Quantile Regression - Overview