stan-dev / stan-dev/bayesplot

Unified PPC/PPD interface via observed argument

Open
#434 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
R
Stars
442
Forks
93
Avg merge
3h 11m
Merged PRs (30d)
1

Description

Summary

bayesplot currently maintains two parallel function families:

  • ppc_* functions: Compare predictive draws against observed data y.
  • ppd_* functions: Display predictive draws without observed data.

Conceptually, these families seem to be similar except for the inclusion of y. Maintaining two separate namespaces can make it harder for new users to navigate the package and understand the distinction between the two modules.

Proposed Change

Introduce a unified top-level interface where the presence or absence of observed data is controlled by an additional argument (e.g., observed):

# With observed data (PPC)
pp_dens(y, yrep, observed = TRUE, ...)

# Without observed data (PPD)
pp_dens(yrep = yrep, observed = FALSE, ...)

Relationship to Other Issues

This proposal is related to Issue#433, as both aim to unify the API through high-level wrapper functions. However, while Issue#433 focuses on unifying functions within a specific family (e.g., distributions, intervals, errors), this issue addresses the broader relationship between the PPC and PPD modules.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing ppc_* and ppd_* function families and the related unification proposal in Issue #433. Determine the scope of the shared interface, including how observed data and existing function names should be handled. Done should mean an agreed, consistent API design with its migration impact clearly specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
api, data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.