Skip to content

Add prior_posterior_overlap() for quantifying prior-to-posterior learning #532

@ishaan-arora-1

Description

@ishaan-arora-1

Hi @jgabry — as part of my GSoC proposal work on prior vs posterior comparison plots, I've been prototyping different visualizations and one thing that kept coming up during testing was the need for a simple numeric summary of how much the posterior has moved away from the prior.

MCMCvis has something like this (MCMCtrace with PPO_out = TRUE), but bayesplot doesn't have an equivalent. I think a standalone prior_posterior_overlap() function would be useful even outside the context of the plotting module — it gives users a quick per-parameter number (0 = completely disjoint, 1 = identical) to answer "did my data actually inform this parameter?"

The implementation would be straightforward:

  • Accept posterior and prior draws in the standard bayesplot formats (matrix, 3D array, draws objects)
  • Support pars, regex_pars, transformations like other mcmc_* functions
  • Return a data frame with Parameter and Overlap columns
  • Overlap computed as the integral of min(f_prior, f_posterior) over a shared density grid

Would it make sense for me to implement this as a PR? Happy to hear your thoughts on scope or naming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions