Add prior_posterior_overlap() for quantifying prior-to-posterior learning
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- r
- Domain
- data-visualization
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.
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.
- Dominant language
- R
- Stars
- 442
- Forks
- 93
- Avg merge
- 3h 17m
- Merged PRs (30d)
- 2
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.
More from stan-dev/bayesplot
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
pp_check and rvars Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
documentation
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
documentation
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in stan-dev/bayesplot
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pharmaverse/rtables#1123 · 1 comment ·
-
Trying to reassign a reactiveVal to the name of an existing reactiveVal doesn't overwrite the latter Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
RConsortium/rconsortium_website#649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
posit-dev/r-shinylive#203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100