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

Add support for discrete variables in rank plots #1433

Merged
merged 4 commits into from
Nov 9, 2020
Merged

Conversation

aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented Oct 26, 2020

Use a similar trick to the one used in plot_bpv for discrete variables.

  • Follows official PR format
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • New features are properly documented (with an example if appropriate)?
  • Includes new or updated tests to cover the new feature
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

Good sample

OLD
trace_rank_old

NEW

trace_rank_new

Bad sample (excess of 2s in one chain)

OLD
trace_rank_old_bad_00

NEW
trace_rank_new_bad_00

Bad sample (two different distributions)

OLD
trace_rank_old_bad_01

NEW
trace_rank_new_bad_01

As you can see with the old version discrete samples always look bad (and more or less the same). With the new version not only they look good when they should, they actually reflect the nature of problem with the sampling went wrong.

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #1433 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1433   +/-   ##
=======================================
  Coverage   91.91%   91.92%           
=======================================
  Files         105      105           
  Lines       11207    11216    +9     
=======================================
+ Hits        10301    10310    +9     
  Misses        906      906           
Impacted Files Coverage Δ
arviz/plots/backends/bokeh/rankplot.py 94.59% <100.00%> (-0.08%) ⬇️
arviz/plots/backends/matplotlib/rankplot.py 96.92% <100.00%> (-0.05%) ⬇️
arviz/plots/plot_utils.py 91.49% <100.00%> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c21881...2fa6b69. Read the comment docs.

@aloctavodia aloctavodia changed the title fix rank plots for discrete variables Add support for discrete variables in rank plots Oct 27, 2020
@aloctavodia aloctavodia merged commit 63759c2 into master Nov 9, 2020
@aloctavodia aloctavodia deleted the rank_discrete branch November 9, 2020 11:21
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.

1 participant