stan-dev / stan-dev/bayesplot

Updating residual plots

Open
#358 3 comments 0 reactions 1 assignee View on GitHub

@behramulukir is already working on this.

Since Jul 2, 2025.

  • #368 by @behramulukir — open
feature new plot
Dominant language
R
Stars
442
Forks
93
Avg merge
3h 11m
Merged PRs (30d)
1

Description

In #343, @TeemuSailynoja highlighted the lack of residual plots, especially for discrete observations. It is about the fact that ppc_error_scatter_vs_x scatter doesn't work for discrete observations, and ppc_error_binned doesn't currently support covariates on the x-axis. I think, as he suggested, adding an optional x argument to ppc_error_binned, which would work similarly to ppc_interval, makes sense. That way, users will have the ability to plot residuals against x, but since it's optional, this change won't break any existing plots.

Another point regarding residual plots is having a new plot -possibly- named ppc_residual suggested by @jgabry and @avehtari at #349. That new function would plot y - stat(y_rep) on the y-axis and stat(y_rep) on the x-axis. This, again, is a good new plot to implement in my opinion since it gives users a chance to analyse a different aspect of the data.

I am willing to work on both of these functions and more if there is more to update regarding residual plots, however, I am not sure where to start since there are open PRs connected to residual plots.

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.