joshspeagle / dynesty

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

Questions about DynamicNestedSampler setting #459

Closed gwwydru closed 9 months ago

gwwydru commented 9 months ago

Hi, I'm currently using dynesty for a 10-dimensional sampling task, and the posterior results for most parameters look good. However, I consistently get incorrect results for two specific parameters. I'm currently using rslice with 40 slices, 2000 livepoints and balls as the bound. Could you please advise on how to adjust the settings to obtain the correct results?

This is the likelihood value for the x6, the red vertical dashed line is the truth and the blue one is the result of the sample. The x axis is value of parameter and the y axis is the value of likelihood. 0 95 this is the likelihood for x7 ss and this is the traceplot of x6 and x7 微信图片_20231113111304 And I also find that more livepoints seem to make the results worse, is there a way to determine the appropriate number of livepoints (or slice for rslice method)?

segasai commented 9 months ago

Hi,

I think from your question it is not clear why you think it's a dynesty issue. I think there are two options here

I am happy to be convinced that it's the former, but you need to show why you think that. For example if you show that the logl value at true parameter values is higher (or comparable) to the maximum likelihood dynesty finds is a good proof.

Also, I don't know how to interpret the first two plots, and what the 1-D curved represent (i.e. are those slices of likelihood or what exactly).

gwwydru commented 9 months ago

Thanks for your reply. Sorry for the misuse of the issue. It is indeed the case that Dynesty fails to get a correct posterior. The logl valuefor the true parameter values is ~0, and for my dynesty run is loglstar: -inf < -19.534 < inf.

segasai commented 9 months ago

If the numbers you give are correct and logL_max_dynesty=-19 and logL(true_x)=0, that would likely indicate dynesty finding a narrow node in the posterior. Since you have not provided many details, such as

I am not sure there much I can suggest, other then the main parameters helping with the discovery of multiple modes are the number of live-points. You can also adding manual nested runs ( see #327 ) to see if that helps.

gwwydru commented 9 months ago

Thank you very much!