CobayaSampler / cobaya

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

oversample_thin reports acceptance rate 1 #310

Closed cmbant closed 1 year ago

cmbant commented 1 year ago

As in example yaml from https://github.com/CobayaSampler/cobaya/issues/308.

 All chains are ready to check convergence and learn a new proposal covmat
[0 : mcmc]  - Acceptance rate: 1.000 = avg([1.0, 1.0, 1.0, 1.0])
[0 : mcmc]  - Convergence of means: R-1 = 0.011349 after 333 accepted steps = sum([80, 86, 86, 81])
vivianmiranda commented 1 year ago

It is not exactly one, but still weird in many of my LSST chains (it seems to slowly drift toward 1 or maintain an equilibrium that depends maybe on the speed hierarchy and the oversampling that is happening)

I attached an example:

acceptance_rate_lssty1_cosmicshear.txt

cmbant commented 1 year ago

I think it makes sense, but the message is rather misleading - these numbers are basically the inverse of the mean thinned weight of the samples remaining after thinning. Doesn't look as though there's a very simple way to get the actual acceptance rate, so I've changed the reporting message to be consistent: https://github.com/CobayaSampler/cobaya/pull/319

JesusTorrado commented 1 year ago

Addressed by #319