Repository navigation
Conversation
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 3dbe017 is merged into master:
|
florence-bockting
approved these changes
Oct 28, 2026
florence-bockting
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. I just add the entry to the NEWS.md
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.
This PR was assisted by Claude
Summary
Current master:
.ess_quantile()computes the ESS of the indicatorx <= quantile(x, prob)for everyprob. For discrete draws, or for draws with many ties, this makes the two tails behave differently. If more than 5% of the draws are at the maximum, the 95% quantile is the maximum, the indicator isTRUEfor every draw, andess_quantile(x, 0.95)andess_tail(x)areNA. The lower tail isNAonly if more than 95% of the draws are at the maximum.New: This PR uses
x >= quantile(x, prob)forprob > 0.5. Because type 7 quantiles satisfyquantile(-x, p) = -quantile(x, 1 - p), the upper-tail indicator ofxis then the lower-tail indicator of-x, andess_quantile(x, p)equalsess_quantile(-x, 1 - p).For the tail-ESS, the upper-tail indicator changes from
x <= q95tox >= q95, as in Stan (stan::analyze::split_rank_normalized_ess(), used by CmdStanstansummary). With stan-dev/stan#3454, both then give the same tail-ESS for discretexand-x, and a finite tail-ESS for discrete draws with more than 5% at the maximum.Effect
x >= qis the complement ofx <= q, and an indicator and its complement have the same ESS.ess_quantile(x, 0.95)andess_tail(x)are finite.ess_tail(x)isNA, at the minimum and at the maximum alike.mcse_quantile(), andpareto_smooth()withoutr_eff(it usesess_tail()), change only for draws with ties at the quantile.Tests
A new test in
test-convergence.Ruses 4 chains of 1000 Bernoulli(0.3) draws. It checks thatess_quantile(x, 0.95)andess_tail(x)are notNA, thatess_quantile(x, p)equalsess_quantile(-x, 1 - p)forp = 0.05and0.95, and thatess_tail(x)equalsess_tail(-x). It also checks that for continuous draws the result equals the ESS ofx <= q. Withmaster, 4 of the 6 expectations fail.Copyright and Licensing
Copyright holder: Aalto University
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: