Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make E_loo Pareto-k diagnostic more robust #251

Merged
merged 4 commits into from
Feb 29, 2024
Merged

Conversation

avehtari
Copy link
Collaborator

Fixes #250 (although the reason was not posterior version)

E_loo was giving warnings and errors in certain cases with binary x. If h(theta) is a step function and h is 0/1 binary, then when computing Pareto-k the one of the tails is likely to be just 0's. In such cases, using the same argument as for type="quantile", we can return the Pareto-k just for r. To make the function to complain less, the same approach is now used for constant, NA, NaN, and infinite x. Added also tests that these don't cause warnings.

@codecov-commenter
Copy link

codecov-commenter commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.76%. Comparing base (45c261e) to head (42f24bd).

❗ Current head 42f24bd differs from pull request most recent head be0266c. Consider uploading reports for the commit be0266c to get more accurate results

Files Patch % Lines
R/E_loo.R 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #251      +/-   ##
==========================================
- Coverage   92.78%   92.76%   -0.03%     
==========================================
  Files          31       31              
  Lines        2829     2834       +5     
==========================================
+ Hits         2625     2629       +4     
- Misses        204      205       +1     

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

Copy link
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I fixed a typo in a comment so the unit tests are running again but this is ready to merge when they finish running.

@jgabry jgabry merged commit 0d21e4d into master Feb 29, 2024
6 checks passed
@jgabry jgabry deleted the E_loo_robustification branch February 29, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E_loo fails with github version of posterior
3 participants