CobayaSampler / cobaya

Code for Bayesian Analysis
http://cobaya.readthedocs.io/en/latest/
Other
126 stars 125 forks source link

"The sum of logpriors in the sample is not consistent." when resuming chains #346

Closed gerrfarr closed 7 months ago

gerrfarr commented 8 months ago

I am getting recurring errors stating that "The sum of logpriors in the sample is not consistent." I tracked the issue to the check here https://github.com/CobayaSampler/cobaya/blob/a3cb9bfb2c63fb5ed1315e9f0f5299cf72e6c8cc/cobaya/collection.py#L467

I can see that the relative tolerance was already increased slightly recently. Would it be a bad idea to also increase the absolute tolerance a bit? It appears that the issue arises when the logprior is close to zero.

cmbant commented 7 months ago

Seems like https://github.com/CobayaSampler/cobaya/issues/306 is not fixed. If you have a simple reproducing example that may help Jesus to figure it out (introduced in https://github.com/CobayaSampler/cobaya/pull/276)

gerrfarr commented 7 months ago

I don't have one on hand, but I could possibly construct something. I figured out that I can alleviate the problem in my case by simply adjusting the absolute tolerance up to 1e-7 (from the default of 1e-8). I suspect it's one of my custom priors which may have fluctuations which are bit larger than usual

JesusTorrado commented 7 months ago

Hi @gerrfarr

You can try https://github.com/CobayaSampler/cobaya/pull/349 if you have time.