Samreay / ChainConsumer

Corner plots, LaTeX tables and plotting walks.
https://samreay.github.io/ChainConsumer
MIT License
82 stars 18 forks source link

Gelman-Rubin #87

Closed irmaR closed 2 years ago

irmaR commented 2 years ago

Why does the Gelman-Rubin diagnostics output Rhat for each chain provided - shouldn't it be just one value per parameter, that is, across all chains?

Samreay commented 2 years ago

I think theres been confusion here across what we mean by chains. For example, if you have a MH algo with four walkers each taking 1000 steps, you would concatenate those into a single chain of 4000 long, and the GR diagonstic would split it up, and check the converge between those four walkers. If you were fitting two separate models using the MH algo, and had four walkers each, youd have two chains of 4k samples, and you'd want to know if both of them have converged. You wouldnt submit to chainconsumer each of the individual walker samples as its own chain (otherwise I'd agree that in that case it would be correct to take all the "chains" coming in).

So, a chain being all the samples (even from multiple walkers) for a given fit to a posterior surface, you'd want (and get) one diagnostic per chain. Hope that helps clarify!