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.
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 (
MCMCtracewithPPO_out = TRUE), but bayesplot doesn't have an equivalent. I think a standaloneprior_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:
posteriorandpriordraws in the standard bayesplot formats (matrix, 3D array, draws objects)pars,regex_pars,transformationslike othermcmc_*functionsParameterandOverlapcolumnsmin(f_prior, f_posterior)over a shared density gridWould it make sense for me to implement this as a PR? Happy to hear your thoughts on scope or naming.