Feature request: support for weighted draws
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 442
- Forks
- 93
- Avg merge
- 3h 11m
- Merged PRs (30d)
- 1
Description
I think it could be useful to have a way to specify weights for draws for functions like mcmc_hist and mcmc_dens. This way when dealing with weighted draws (e.g. a posterior::draws_array object with weights from importance sampling), the same functions could be used as for raw mcmc draws without needing to resample.
As far as I understand, geom_density and geom_histogram already have aesthetic mapping for weights as an option, so it might be possible to use this directly.
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 tracing the mcmc_hist and mcmc_dens entry points and how they pass data to geom_histogram and geom_density. Check how weighted draws from a posterior::draws_array are represented, then define completion as supporting weights in both plotting functions without requiring resampling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100