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

change kde limits and hdi computation #1215

Merged
merged 4 commits into from
Jun 1, 2020
Merged

change kde limits and hdi computation #1215

merged 4 commits into from
Jun 1, 2020

Conversation

aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented May 29, 2020

  • 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

This makes two important changes. compute the kde over the data range (not over 0, 1). This help to spots problems, as the KDE is "not adding data". Compare our example in the gallery, with the new version.

lala.

This also introduce a theoretical HDI, instead of estimating the HDI from the samples.

lala_hdi

maybe we should enforce the zero y-bottom-limit.

@codecov
Copy link

codecov bot commented May 29, 2020

Codecov Report

Merging #1215 into master will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1215      +/-   ##
==========================================
- Coverage   93.14%   93.07%   -0.07%     
==========================================
  Files          94       94              
  Lines        9497     9504       +7     
==========================================
  Hits         8846     8846              
- Misses        651      658       +7     
Impacted Files Coverage Δ
arviz/plots/backends/bokeh/loopitplot.py 89.18% <100.00%> (+0.30%) ⬆️
arviz/plots/backends/matplotlib/loopitplot.py 97.29% <100.00%> (+0.52%) ⬆️
arviz/plots/loopitplot.py 98.87% <100.00%> (ø)
arviz/plots/hdiplot.py 83.92% <0.00%> (-3.58%) ⬇️
arviz/utils.py 89.33% <0.00%> (-1.84%) ⬇️

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 ec33b4c...a5b597b. Read the comment docs.

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about not setting the range between 0 and 1.

Here is an example of bad behaviour I think this would introduce: imagine we have 1e6 observations whose 1e6 loo-pit values are uniformally distributed between .3 and .7. Old behaviour would set the kde limits to 0,1 and the resulting kde would have an inverted U shape whereas with this change the kde would be perfectly flat and it would be the fact that the range is not from 0 to 1 what should warn the user of the extremely bad loo pit result they actually have.

arviz/plots/loopitplot.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@OriolAbril
Copy link
Member

Is this ready to merge?

@aloctavodia
Copy link
Contributor Author

Yes.

@OriolAbril OriolAbril merged commit 259010a into master Jun 1, 2020
@OriolAbril OriolAbril deleted the loo_pit_dens branch June 1, 2020 16:49
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.

2 participants