Skip to content

Function to compute iso_probability_contours for given MCMCSamples or NestedSamples object #178

Open
@Stefan-Heimersheim

Description

@Stefan-Heimersheim

Is your feature request related to a problem? Please describe.
It is not trivial how to compute confidence intervals from MCMCSamples or NestedSamples even though we have this functionality in the 1d plots (with facecolor=True).

There is a function iso_probability_contours_from_samples which sounds like it should do that (but does not seem to), the documentation does not explain much and the source code looks mostly like iso_probability_contours.

Describe the solution you'd like
A function analogous to plot_1d which returns confidence intervals, e.g. MCMCSamples.confidence_1d(key, type='fastkde', confidence_level=[0.68, 0.95]) could return [[(1.2,1.4), (1.53,1.55)], [(1.1, 1.6)]]. Possible types would be hist, kde, and fastkde.
Edit: We need to return a list of tuples in case there are multiple peaks

Describe alternatives you've considered
In the past I just used the samples to compute the kde manually and compute this, but a built-in functionality would surely be beneficial for many users and also encourage using a sensible definition of confidence levels.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions