Pragmatic Bayes

Martin Modrák

2025-05-13

What is this about?

Modified from http://www.ForestWander.com, CC BY-SA 3.0 US, via Wikimedia Commons, https://mc-stan.org/bayesplot/

I don’t want to convert you

Philafrenzy, CC BY-SA 4.0, via Wikimedia Commons, [2][3], Public domain, via Wikimedia Commons, Gnathan87, CC0, via Wikimedia Commons

Pragmatic Bayes: a collection of ideas

Contrast with full Bayesian epistemology

No shaming our subjective/objective Bayesian friends!

Epistemology / philsci is not solved

Can we do Bayesian statistics without committing to Bayesian philosophy?

Main Influences

Deborah Mayo

Andrew Gelman

Stan community more broadly

Berna Devezer

Danielle J. Navarro

Theoretical background

Ag2gaeh, CC BY-SA 4.0, via Wikimedia Commons

Frequentist calibration

(continuous parameter)

  • Confidence interval:
    • For any fixed parameter value, \(x\%\) CI contains the true value at least \(x\%\) of the time.
    • Worst case
    • Usually conservative approximation

Bayesian calibration

(continuous parameter)

  • Credible interval
    • Averaged over the prior, \(x\%\) CrI contains the true value exactly \(x\%\) of the time.
    • Specific values may lead to low coverage
    • Usually exact*

Frequentist calibration example

\[ y \sim \text{Binomial}(20, \theta) \]

Other inference goals

Frequentist Test = inverted confidence interval

Bayes factor = calibrated posterior model probability

Pragmatic Bayesian can outfreq the freq

Modified from Smahdavi4, CC BY-SA 4.0, via Wikimedia Commons

Bayes approximates freq

We do not live in asymptotic utopia

Most freq methods are approximations!

  • ML + Normal approximation
  • ML + profile likelihood
    • \(\chi^2\) asymptotics of the likelihood-ratio test
    • Computationally expensive!

Bayes as a freq tool - example

Fitting a negative binomial model, with 4 observations per group:

Frequentist via MASS package:

MASS::glm.nb(y ~ group, data = data)

Frequentist via gamlss package:

gamlss::gamlss(y ~ group, family = "NBI")

Bayesian with flat prior via brms package:

brms::brm(y ~ group, data = data, family = "negbinomial", 
  prior = brms::prior("", class = "Intercept"))

Bayes as a freq tool - example II

It is hard to be a frequentist!

(with exact finite-sample guarantees)

  • Exact freq computation is very hard
  • Freq properties hard to empirically check
  • Bayesian computation can be verified empirically (SBC, Yao et al.)

Pragmatic Bayesian tests their assumptions

KF, Public domain, via Wikimedia Commons

Which assumptions?

All of them

Modern Bayesian computation succeeds or fails loudly

Pragmatic Bayesian understands Bayesian limits

TeWeBs, CC BY-SA 4.0, via Wikimedia Commons

Selection effects

10 patients get sick, 10 recover. What is the likely recovery probability?

Should your inference change if you learn that the experimenter would only ever report the results to you if everybody recovered?

In Bayesian statistics it should not! 🤯

\[ \pi_\text{post}(\theta \mid y, \text{ accept(y)}) = \pi_\text{post}(\theta \mid y) \]

Selection effects - intuition

Frequentist simulation:

prob_recovery = some_number
repeat {
  y = binomial_rng(N = 10, prob = prob_recovery)
  if(y == 10) then break
}

Bayesian simulation:

repeat {
  prob_recovery = prior_rng()
  y = binomial_rng(N = 10, prob = prob_recovery)
  if(y == 10) then break
}

Modelling selection

Bayesian can model the frequentist process as a truncated distribution.

In the example, this leads to \(\pi_\text{post}(\theta \mid y) = \pi_\text{prior}(\theta)\).

More generally to an interesting class of models

Pragmatically: we rarely can build a good model of the selection

Early stopping

Should your inferences change when you learn that data collection stopped once \(p < 0.05\)?

  • The likelihood principle says NO
  • No easy cop-out this time

Early stopping - example

Binomial model, max steps = 10000, optional stopping after each step

Stopping when 95% CrI excludes 0.5

Stopping when 95% CrI excludes 0.4 - 0.6

Stopping when the width of 95% CrI is < 0.1

Possible solutions to early stopping

  • Smarter stopping rules
  • Include time in your model
  • Simulate to get freq properties
    • Shoutout to bayesflow

Frequentist don’t have it all

  • Freq approaches to early stopping approximate
    • And bespoke/limited
  • You need simulations anyway

Pragmatic Bayesian is not afraid of freq

Lukáš Beneda, CC BY-SA 4.0, via Wikimedia Commons

Some use cases of freq

  • Sequential designs
  • Freq as approximate Bayes

Pragmatic Bayesian thinks about causality

Bayesian causality

Pragmatic Bayesian aligns inferences with scientific questions

Bergin, Jerry, Public domain, via Wikimedia Commons

Rich models

  • Varying scale between groups already difficult in freq

  • Differential equations

  • hidden Markov models

  • Simulation-based inference (Bayesflow workshop yesterday)

Rich inferences

Inferences on derived quantities, prediction intervals?

  • Just compute per sample!

  • Some questions don’t have freq answers without regularization (e.g. mean of general distribution).

    • Once you regularize, you may as well do Bayes.

My personal non-reasons to use Bayes

Prior information

No!

We can rarely elicit and express precise enough priors

Sequential updating?

No!

In practice just fit a big model to all data.

Epistemology?

No!

Severity of tests matters.

Especially no to Bayes factors.

Why I use Bayesian tools

And maybe you should too?

Pragmatic reasons

  • Useful!
  • One coherent approach!
  • Finite sample guarantees!
  • Rich models!

Thanks for your attention!

Slide & simulation sources:
https://github.com/martinmodrak/pragmatic-bayes