Add prior_posterior_overlap() for quantifying prior-to-posterior learning
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 442
- Forks
- 93
- Avg merge
- 3h 11m
- Merged PRs (30d)
- 1
Description
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
posteriorandpriordraws in the standard bayesplot formats (matrix, 3D array, draws objects) - Support
pars,regex_pars,transformationslike othermcmc_*functions - Return a data frame with
ParameterandOverlapcolumns - 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing mcmc_* input handling and the MCMCvis prior-to-posterior overlap behavior referenced in the issue. Define how matrix, 3D array, and draws-object inputs, parameter selection, and transformations should work; done means a prior_posterior_overlap() result with Parameter and Overlap columns using the stated 0-to-1 density-overlap measure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100