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

[Feature suggestion] Use fast credibility intervals to compute contours #20

Open
Stefan-Heimersheim opened this issue Jul 19, 2022 · 2 comments

Comments

@Stefan-Heimersheim
Copy link
Collaborator

Instead of estimating the PDF and drawing contours with plt.contour, we could directly use credible intervals (fastCI) in y-direction to compute the contours. This avoids typical KDE/PDF-estimation problems like many of the fluctuations due to sample density. It would also allow drawing lines corresponding to lower and upper bounds.

I plan to make a PR for this eventually, just wanted to mention this here already; if anyone is interested in having this right now send me an email and I'll be happy to help!

I will finish my PR in anesthetic first, but in principle this method also works very well for fgivenx. I have just implemented fgivenx with credibility intervals for a project here (will add examples later).

@williamjameshandley
Copy link
Collaborator

Keen for this update. One query which could be relevant for anesthetic and fastCl. How well does/could this handle multimodal posteriors?

@Stefan-Heimersheim
Copy link
Collaborator Author

It cannot. Fundamentally you cannot compute arbitrary multi-modal iso-PDF intervals based on samples, without assuming some KDE or smoothness of the PDF, because you could always choose tiny intervals around the samples with almost zero volume.

(This isn't meant as a replacement of kde of course, but you can use it if you know/see it's unimodal.)

What we might be able to do:

  • Just say this is only for Highest Prior Density Interval as in, single interval, rather than iso-PDF / waterline method.
  • Fix number of modes and find the set of N intervals including 68% of the points while minimizing the sum of the volumes of the intervals. I believe this optimization problem might be not-too-hard since the optimizations of will be independent, i.e. N 1d minimizers rather than 1 Nd minimizer. But not 100% sure about this, haven't tried this. Maybe one can do evidence-based selection of N but now it becomes rather complex.

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

No branches or pull requests

2 participants