joshspeagle / dynesty

Dynamic Nested Sampling package for computing Bayesian posteriors and evidences
https://dynesty.readthedocs.io/
MIT License
346 stars 76 forks source link

Importing Nested Sampling chains from file to plot #455

Closed BorisDeletic closed 10 months ago

BorisDeletic commented 10 months ago

Hi,

I would like to use dyplot to do some analysis on nested sampling chains generated by an external sampler. I am looking for a way to load in the output files containing the data of the full NS run into the dyplot Results and then make some graphs. I cant find anywhere in the docs about loading data from files, so would appreciate any pointers if I have missed that, or advice how to acheive this.

Regards

segasai commented 10 months ago

Hi,

The plotting needs a dynesty.results.Results object:

You can probably fake it with something like this:

 import dynesty.results

res= dynesty.results.Results([('logl', [1, 2, 3]), ('samples_it',[1,2,3])])

But it's not suported, you will need to provide multiple attributes to make the Results object.

BorisDeletic commented 10 months ago

Thanks for the help. I think it would be a very useful feature for dynesty as the plotting and analysis tools are very neat and well developed. I may add a PR if I get this working with Polychord chains.