joshspeagle / dynesty

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

Converting samples to a different parameter set #180

Closed ahallcosmo closed 4 years ago

ahallcosmo commented 4 years ago

Hi,

I have the results of a Nested Sampling run with a particular set of parameters. If I want to post-process the results to a different parameterisation (e.g., to plot the posterior of exp(x) rather than x), is it just a case of applying the appropriate transform to the samples? So for a 1D problem, with samples from the posterior of x, I could do something like results['samples'] = np.exp(results['samples']) to get a results class entirely equivalent to what I would have got by using exp(x) as a parameter in the sampling rather than x? Or are there any other metadata in the results class that would need to be modified too?

Best wishes, Alex

joshspeagle commented 4 years ago

I could do something like results['samples'] = np.exp(results['samples'])

Yes, that should work with no problems (or at least that's what I do!). No other (meta)data should need to be modified as far as I'm aware, but if you spot weirdness please let me know.

ahallcosmo commented 4 years ago

Thanks!