stan-dev / stan-dev/bayesplot

Improve functions available for discrete observations

Open
#343 10 comments 0 reactions 1 assignee View on GitHub

@TeemuSailynoja is already working on this.

Since Apr 14, 2025.

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

Description

Currently bayesplot offers are three functions for discrete PPCs: ppc_bars, ppc_bars_grouped, and ppc_rootogram.

In our preprint, we argue why bar graphs are usually not a good PPC, especially for binary observations.

Image

Calibration plots

I suggest adding the binned calibration plot and PAV-adjusted calibration plot under a function called ppc_calibration. For ordinal or categorical data, it would possibly be clearer to have another function that produces calibration plots for 1-vs-others, or cumulative event probability.

Residual plots

Another missing function are residual plots, ppc_error_scatter_vs_x, and ppc_error_binned work on this field, but the scatter doesn't work for discrete observations, and ppc_error_binned doesn't currently support covariates on the x-axis.

Image

  • The confidence bands in these need work, but at the very least adding options for binned residual plots and PAV-adjusted residuals would be an improvement.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.