Repository navigation
Use ci_prob for the tail ESS in pareto_khat, power_scale_lw and thin_factor - #498
Open
kojikojikojikoji wants to merge 1 commit into
Open
kojikojikojikoji wants to merge 1 commit into
kojikojikojikoji wants to merge 1 commit into
Conversation
…factor The tail ESS used for r_eff in pareto_khat, pareto_min_ss and power_scale_lw and the one in the array thin_factor were fixed to 5%/95%. They now follow stats.ci_prob like ess(method="tail"), see arviz-devs#490. Signed-off-by: Koji Miyazawa <24467062+kojikojikojikoji@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #498 +/- ##
=======================================
Coverage 84.63% 84.64%
=======================================
Files 48 48
Lines 6978 6981 +3
=======================================
+ Hits 5906 5909 +3
Misses 1072 1072 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Documentation build overview
13 files changed ·
|
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.
Follow up to #490. @aloctavodia and @jordandeklerk agreed to use
rcParams["stats.ci_prob"]for the tail ESS everywhere (#490 (comment), #490 (comment)).Three places still used a fixed 5%/95%:
_pareto_khat, whenr_effis not given. This is used bypareto_khat,pareto_min_ss, themin_sscolumn ofsummaryand the k-hat inloo_expectations._power_scale_lw. This is used bypsense,psense_summaryandpower_scale_dataset.thin_factorusedprob=0.95. The DataArraythin_factoralready usedci_prob. The two could return different factors for the same draws.How
probis passed:pareto_khat,pareto_min_ssandpower_scale_lwtakeprob=Noneand resolve it withvalidate_ci_prob, likeessdoes.pareto_khat,pareto_min_ss,power_scale_lwandthin_factortakeprobwith a default of 0.89. The array layer does not read rcParams. Existing array calls keep working. They give the same result as the DataArray functions with the default rcParams.r_effstill takes priority inpareto_khat.Values that change (centered_eight posterior and
tests/univariate_normal.nc):pareto_khat, mupareto_khat, theta[0]pareto_khat, theta[3]pareto_min_ss, theta[0]pareto_min_ss, theta[3]thin_factor, mupsenseprior, mu / sigmapsenselikelihood, mu / sigmatau does not change because it uses the
n_draws / 5branch for the tail length. Thepsense_summaryoutput is the same after rounding. The reference values intests/test_psense.pydid not need updating.k-hat values now differ a little from
posterior::pareto_khat, which computesr_efffromess_tailwith the 5% and 95% quantiles.Tests added in
tests/base/test_stats.py:pareto_khatandpareto_min_sson a DataArray followstats.ci_probset withrc_context, and give the same values as the array functions called with the sameprob.power_scale_lw.thin_factornow return the same value for centered_eight mu.Should
probbe required in these array functions, like it is foress(method="tail"), instead of defaulting to 0.89? I kept the default so existing array calls do not break. I can change it.