CobayaSampler / cobaya

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

Sampling data calibrated parameters and stuck chains #265

Open cmbant opened 1 year ago

cmbant commented 1 year ago

For example, for future CMB data might want to sample a high-L C_L amplitude parameter rather than A_s, to avoid issues with this parameter being extremely tightly constrained by the data but with large degeneracies between A_s, tau, ommh2 etc. I don't think there's a very clear way to sample theory derived parameters at the moment.

I frequently get issues with "chain is stuck". E.g. using a covmat from an LCDM run and adding a new theory parameter with no covmat. The initial points will be widely dispersed, so the C_L amplitude will not match the data. The covmat for the standard parameters knows that the amplitude is very well constrained, so allows almost no movement in LCDM parameters that change it. However, if the new parameter affects the amplitude, it can rapidly shoot off to a weird value, to make the starting amplitudes match the data (e.g. weird new parameter, weird tau, to give consistent high-L). tau becoming very low seems to be one way to get the stuck messages, presumably to do with the factor of 1/2 acceptance from the lower bound (?). Perhaps the "stuck" message should only count rejections by the likelihood rather than the priors.

Could also help to have covmat learning determined by something other than R-1 (which will always be bad as long as amplitude do not match, even if per-chain covariances are reasonable).

cmbant commented 1 year ago

Possible stuck warning tweak: https://github.com/CobayaSampler/cobaya/compare/master...stuck_warning

cmbant commented 1 year ago

This does not escape the main issue, but some of the stuck cases were probably cause by nasty CAMB bug fixed in v1.5 (https://github.com/cmbant/CAMB/commit/1754b9eef5bb819d138ffb04ea906dff0771c53b)