CobayaSampler / cobaya

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

Acceptance Rate too Low #207

Closed Saber-of-QFT closed 2 years ago

Saber-of-QFT commented 2 years ago

Dear Jesús, I met a problem when running mcmc. I try to run a cosmological forecast using cobaya. The constraint result is good actually, but the acceptance rate is too low, lower than 1%

[0 : mcmc] Progress @ 2021-10-18 09:33:17 : 696097 steps taken, and 2141 accepted. [1 : mcmc] Progress @ 2021-10-18 09:34:31 : 587109 steps taken, and 1976 accepted. [3 : mcmc] Progress @ 2021-10-18 09:34:32 : 577346 steps taken, and 1908 accepted. [2 : mcmc] Progress @ 2021-10-18 09:34:33 : 329333 steps taken, and 1261 accepted.

It takes a very long time to get only 8000 samples. It there any solution to solve the acceptance rate too low problem? Thank you!

JesusTorrado commented 2 years ago

Hi @Saber-of-QFT

Low acceptance rate usually means that your proposal is too large, at least along some particular direction. To ameliorate that, you can set a proposal value for each parameter and make it smaller until you hit higher initial acceptance rate. If there are strong degeneracies, it may be a good idea to pass a covariance matrix to the mcmc sampler (see docs, let me know if you have a particular problem with that).

You mention that the results look OK but the acceptance rate is low. Does that mean that you have already had a run close to convergence? In that case, it should have produced a [prefix].covmat file. Put it where your input yaml files are, and add to the mcmc block covmat: [prefix].covmat.

I'll close this because this is not a code issue, but feel free to keep me updated here (without re-opening it, please).