Clean up estimate_secondary ESS warnings in the prior choice guide and deduplicate per-chain fit warnings - #1518
Merged
Merged
Conversation
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
sbfnk
marked this pull request as ready for review
September 2, 2026 15:35
sbfnk
approved these changes
Sep 2, 2026
Member
|
merging as docs only |
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.
Description
Two small, related fixes for noisy diagnostics when fitting the auxiliary models.
Vignette —
estimate_secondary()low tail-ESS. After the earlier warmup/sample bump, the prior choice guide render still showed low tail effective-sample-size warnings forestimate_secondary(). Reproducing the fit locally, bulk ESS already cleared at the fast settings (500 samples / 250 warmup) but tail ESS did not (min ESS ~384, just under the ~400 threshold). Giving the twoestimate_secondary()examples a dedicatedstan_secondaryobject (1000 samples / 500 warmup) clears it with comfortable margin (min ESS ~726, max R-hat 1.004). The change is scoped to theestimate_secondary()examples so the other models' rendered output is unaffected.Logging — duplicated per-chain warnings. In the non-
futurefitting path,estimate_secondary()andestimate_truncation()fit all chains in onerstan::sampling()call, but the caught-warning handler inR/fit.Rformatted each pooled warning with the whole chain vector, sosprintfrecycled it and every message printed once per chain ((chain: 1),(chain: 2), ...). Collapsing the chain vector withtoString()prints each pooled warning once as(chain: 1, 2). Thefuturepath (scalar chain id per call) is unchanged.There is no dedicated issue for these;
estimate_truncation()'s remaining ESS/divergence warnings are tracked separately.Initial submission checklist
lintr).