-
Notifications
You must be signed in to change notification settings - Fork 30
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 request: HDI intervals #89
Comments
That's a very good idea, and it should be possible. Maybe you could try implementing it for one parameter based on the posterior samples? General recipe:
The approach can in principle give you multimodal regions, which is fine or not depending on what you want. If you do not want it multimodal, you would need to add in also the bins in between in step (3). Step 1 may also not be trivial. |
Another approach is to use a kernel-density estimation library (fastkde, getdist, etc) to do the job. I am not sure which one, perhaps arviz also has an implementation. I'd be interested to hear how you solve this. |
Your pointer to arviz proved to be the quickest way to obtain a HDI.
and that you ran UltraNest:
To convert the UltraNest output to an Arviz InferenceData object I used
which is quite likely not the shortest way. :-)
leading in my example to
|
@JorisDeRidder btw, how do you get the highest density point though? |
You mean the MAP? Some software packages (e.g. PyMC I believe) simply numerically maximize the logPosterior = logLikelihood + logPrior function. It works well if your posterior is monomodal. If that's not the case, you might want to consider constructing a KDE of your posterior and determine the MAP from that. |
Here is an approach based on getdist, which supports bounds: https://gist.github.com/JohannesBuchner/2027d0f313521387c2cded2424cdcfeb |
Bayesian credible intervals can currently be derived using quantiles. Would it be possible to implement an HDI interval as well?
The text was updated successfully, but these errors were encountered: