Repository navigation
Conversation
n_pareto() used ceiling() for the tail length, while the PSIS paper (Appendix H) and posterior::ps_tail_length() use floor(). As discussed in stan-dev#408 it only has to be an integer, so loo now uses floor() too for consistency. The roxygen note also said 3*sqrt(S)/r_eff, which is fixed to match the code (3*sqrt(S/r_eff)). The tail can be one draw shorter, so results change slightly. The affected snapshots are updated, and the pinned mcse_elpd_loo value in the moment matching test goes from 0.1904162 to 0.1941738. Part of stan-dev#408 Signed-off-by: Soujas K <kudchadkarsoujas@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #437 +/- ##
=======================================
Coverage 92.81% 92.81%
=======================================
Files 31 31
Lines 3074 3074
=======================================
Hits 2853 2853
Misses 221 221 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if eef9b69 is merged into master:
Further explanation regarding interpretation and methodology can be found in the documentation. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #408
As discussed in #408,
n_pareto()now usesfloor()for the PSIS tail length instead ofceiling(), same as the PSIS paper (Appendix H) andposterior::ps_tail_length().Changes:
R/psis.R:ceiling()->floor(). I also fixed the roxygen note, which said3*sqrt(S)/r_effwhile the code computes3*sqrt(S/r_eff).tests/testthat/_snaps: updated the snapshots that changed. The tail can be one draw shorter, so the values move a little (e.g.elpd_loo-83.58926 -> -83.58963 indeprecated_extractors). Every changed snapshot block has a real value change.tests/testthat/test_loo_moment_matching.R: the pinnedmcse_elpd_loofrom 23005f4 goes from 0.1904162 to 0.1941738. I checked that the same test setup gives exactly 0.1904162 withceiling()and 0.1941738 withfloor(), so the change comes only from the tail length. @avehtari could you check this one is ok?NEWS.md: add a bulletTests:
devtools::test()passes locally (1366 passed, 0 failed, 0 skipped) with R 4.4.3. The serialized snapshots were written with R 4.4.3, so their header bytes differ from the old ones written with 4.5.0.expect_snapshot_value()compares the deserialized values, so this doesn't affect the tests.@florence-bockting
AI disclosure: I used Claude to help prepare this change. I reviewed and understood all of it and can explain and defend it in review.