Skip to content

Conversation

behramulukir
Copy link
Collaborator

In #361 and #358, as part of our discussion related to enhancing error/residual plots in general, we talked about implementing a new function named ppc_residual_scatter. The idea of such a function originated in #349 and #350 due to a demand for a function that creates plots of y - stat(yrep) instead of what existing error functions plot, stat(y - yrep). So, the logic of ppc_residual_scatter is what @jgabry said in his comment here:

  1. Keep ppc_error_scatter_avg as you have it and add a new one that does y - stat(y_rep) on the y-axis and stat(y_rep) on the x-axis. We could call it ppc_residual() or something like that. I think with the right documentation having both would probably be ok.

This PR is about my work on creating the ppc_residual_scatter.

  • implement ppc_residual_scatter
  • write documentation
  • add tests

The problem I have is that I am a little confused about my implementation. When I look at it, it seems logical and in some cases, I am fine with the results. However, there are some cases which confused me, such as ppc_residual_scatter(y, yrep, x) and ppc_error_scatter_avg(y, yrep, x) having the same plot. I think these plots shouldn't look identical, but somehow, to me, they look like they are the same plot.

Examples

y <- example_y_data()
yrep <- example_yrep_draws()
x <- example_x_data()

ppc_residual_scatter(y, yrep)
residual_scatter
ppc_error_scatter_avg(y, yrep)
error_scatter
ppc_residual_scatter(y, yrep, x)
residual_scatter_x
ppc_error_scatter_avg(y, yrep, x)
error_scatter_x

@behramulukir behramulukir linked an issue Aug 27, 2025 that may be closed by this pull request
@behramulukir behramulukir self-assigned this Aug 27, 2025
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.05%. Comparing base (e7d10d9) to head (015e4d3).

Files with missing lines Patch % Lines
R/ppc-errors.R 0.00% 33 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #368      +/-   ##
==========================================
- Coverage   98.62%   98.05%   -0.57%     
==========================================
  Files          35       35              
  Lines        5729     5762      +33     
==========================================
  Hits         5650     5650              
- Misses         79      112      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating residual plots
2 participants