Roever 2020 - Posterior Predictive Checks and Frequentist Connection

Summary

Two bridges to classical practice. (1) A frequentist REML random-effects fit equals the Bayesian conditional posterior under a uniform effect prior; the Bayesian result differs by integrating over . (2) Posterior predictive -values test hypotheses such as , or by simulating replicate data from the posterior restricted to the null; with Cochran’s as statistic for the result matches the classical test.

Overview

Posterior predictive checks (Gelman et al. 1996; Gelman et al. 2014) compare actual data to data simulated from the posterior; a discrepancy signals misfit. For a one-dimensional statistic, the share of replicate values above or below the observed value is a posterior predictive -value, closely related to classical -values (Meng 1994; Berkhof et al. 2000).

Main Content

REML fit as a conditional posterior

With a uniform prior for , the conditional posterior mean and SD of at equal the usual random-effects estimate and its standard error: , . The choice of heterogeneity prior is irrelevant for this conditional statement. Both approaches share the likelihood; the Bayesian one adds a prior on both parameters and integrates over rather than plugging in.

Transplant data: REML vs Bayes

Posterior predictive -values (Sec. 2.10, 3.6)

Posterior predictive -value for the NNHM

Given a null hypothesis about , or and a discrepancy statistic : (1) draw , i.e. from the posterior conditional on ; (2) simulate ; (3) compute ; (4) the -value is the fraction of replicates with at least as extreme as the observed in the rejection region. Implemented by pppvalue(bmr, parameter, value, alternative, statistic, n).

Setup of the example (two randomised studies). Restricting the six studies to the two randomised ones (Heffron 2003, Spada 2006) gives (half-normal(0.5), ): posterior mean , 95% interval , prediction (Fig. 6: raw intervals Heffron , Spada ).

HypothesisStatisticResultInterpretation
vs (posterior CDF at 0) (10 of 1000 replicates exceed it; binomial 95% interval about 0.5% to 2%)data inconsistent with no/harmful effect
vs Cochran’s (classical -based value would be identical)no evidence of heterogeneity from 2 studies
vs Bayes factor for (rejection region: lower tail)similar
the latest study alone, judged against prior evidence, is not conclusive

Notes: the posterior CDF at is always 0, so it cannot test ; use or a Bayes factor. Using a Bayes factor requires matching prior settings inside the statistic function and interval.type="central" for speed; n=1000 replications “may take a few minutes”, n of about 100 is usually enough for rough values. Figure 7 visualises replicate draws confined to (left) and the empirical CDF of the statistic with the observed value 0.9975 in the upper tail (right).

Examples

import numpy as np
def ppp_cochran_q(y, sigma, n=2000, seed=0):
    """Posterior predictive p for H0: tau=0 with Cochran's Q. Under H0 Q ~ chi2(k-1): simulate and compare."""
    rng = np.random.default_rng(seed); k = len(y); w = 1/sigma**2
    def Q(yy): m = (w*yy).sum()/w.sum(); return (w*(yy-m)**2).sum()
    mu = (w*y).sum()/w.sum()                      # plug-in; Q is pivotal under H0 so mu is irrelevant
    q_obs = Q(y)
    reps = np.array([Q(rng.normal(mu, sigma)) for _ in range(n)])
    return (reps >= q_obs).mean()

Connections

See Also